feat: adopt typed timestamps from flashduty-sdk (RFC3339 output)#23
Merged
Conversation
Bump flashduty-sdk to the Timestamp/TimestampMilli release: response time fields are now self-describing types that render RFC3339, so structured (JSON/TOON) output shows readable timestamps for free. - FormatTime takes a small local `instant` interface (satisfied by both flashduty.Timestamp and flashduty.TimestampMilli) instead of int64. - Remove formatWarRoomCreatedAt: its magnitude-based ms/sec guess is obsolete now that war-room created_at is a typed (seconds) Timestamp. - CreateIncident/CreateStatusIncident now return typed structs; read the typed IncidentID/ChangeID instead of map[string]any asserts.
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adopt the new self-describing timestamp types from
flashduty-sdkso structured (JSON/TOON) output renders RFC3339 strings instead of opaque Unix integers.Depends on flashduty-sdk PR #20 (
flashcatcloud/flashduty-sdk#20). go.mod pins the SDK at the PR branch commit via pseudo-version; will re-pin to the tagged/merged SHA once #20 lands.Changes
internal/output/table.go—FormatTimenow takes a tiny localinstantinterface (Time() time.Time; IsZero() bool), satisfied by bothflashduty.Timestampandflashduty.TimestampMilli. No moreint64plumbing.internal/cli/incident.go— removedformatWarRoomCreatedAt: its magnitude-based ms/sec guess is obsolete now that war-roomcreated_atis a typed (seconds)Timestamp. War-room CREATED column usesoutput.FormatTimedirectly.CreateIncidentreads the typedresult.IncidentIDinstead of amap[string]anyassert.internal/cli/root.go,status_page.go— client-interface signatures + call sites updated for the typed SDK returns.internal/output/structured_time_test.go.Verification
go build ./... && go vet ./... && go test -race ./...— all greengofmt -lon changed files — cleangolangci-lint run ./...(v2.11.4) — 0 issuesNote (out of scope)
The Makefile's
golangci-lintpin (v2.2.1) can't lint a go1.25 module locally; CI usesgolangci-lint-actionand is unaffected. Left untouched to keep this PR scoped to SDK adoption — flagging as a separate pre-existing fix.