Skip to content

Commit f4cdf98

Browse files
committed
Fix invalid schemas and timestamp formatting
While testing running this tap against stitch itself there were a few validations that cropped up - mainly around timestamps that actually need to be optional but are not. There was a typo on another field also which has been corrected. The final change was to the timestamp for when a record has been emitted. The stitch documentation says: ``` This should be an RFC3339 formatted date-time, like "2017-11-20T16:45:33.000Z". ``` What they don't say is that their python library demands it's locked to UTC e.g. you cannot have an actually valid RFC3339 timestamp such as: `time_extracted=2023-10-22T19:28:41+01:00` which has the timezone present. Why is this? Who knows - it's a timestamp, it's valid, it has timezone information in it that would let you calculate UTC. So for now lets just emit with things cast to UTC first.
1 parent e49dd08 commit f4cdf98

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

model/action_v2.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func (actionV2) Schema() Property {
2323
Types: []string{"string"},
2424
},
2525
"assignee": Optional(UserV1.Schema()),
26-
"completed_at": DateTime.Schema(),
26+
"completed_at": Optional(DateTime.Schema()),
2727
"created_at": DateTime.Schema(),
2828
"updated_at": DateTime.Schema(),
2929
},

model/follow_up_v2.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func (followUpV2) Schema() Property {
2828
Types: []string{"string", "null"},
2929
},
3030
"external_issue_reference": Optional(ExternalIssueReferenceV2.Schema()),
31-
"completed_at": DateTime.Schema(),
31+
"completed_at": Optional(DateTime.Schema()),
3232
"created_at": DateTime.Schema(),
3333
"updated_at": DateTime.Schema(),
3434
},

model/incident_role_v1.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func (incidentRoleV1) Schema() Property {
2828
"role_type": {
2929
Types: []string{"string"},
3030
},
31-
"short_form": {
31+
"shortform": {
3232
Types: []string{"string"},
3333
},
3434
"created_at": DateTime.Schema(),

model/incident_role_v2.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func (incidentRoleV2) Schema() Property {
2929
"role_type": {
3030
Types: []string{"string"},
3131
},
32-
"short_form": {
32+
"shortform": {
3333
Types: []string{"string"},
3434
},
3535
"created_at": DateTime.Schema(),

tap/tap.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func Sync(ctx context.Context, logger kitlog.Logger, ol *OutputLogger, cl *clien
3131
return err
3232
}
3333

34-
timeExtracted := time.Now().Format(time.RFC3339)
34+
timeExtracted := time.Now().UTC().Format(time.RFC3339)
3535
logger.Log("msg", "loading records", "time_extracted", timeExtracted)
3636

3737
records, err := stream.GetRecords(ctx, logger, cl)

0 commit comments

Comments
 (0)