Repository navigation
dexcli visualize: write generatedAt into Flow Definition Graph 2.0 JSON - #1586
Merged
Merged
Conversation
Each Flow Definition Graph 2.0 that dexcli visualize emits now has a top-level generatedAt field, an RFC 3339 UTC timestamp with second precision. SOURCE_DATE_EPOCH overrides the current time for reproducible output; an invalid value is a usage error. Schema 1.0 output is unchanged. Dex Web and the v2 JSON Schema accept the optional field and require an RFC 3339 value when present. The docs generator stamps each committed definition with its source file's last commit time, so regeneration is stable.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Summary
dexcli visualize --schema-version 2.0writes a top-levelgeneratedAt(RFC 3339 UTC, seconds) into each Flow Definition Graph. It honorsSOURCE_DATE_EPOCH; an invalid value is a usage error. Schema 1.0 output is unchanged.generatedAt?.docs/scripts/generate-flow-definitions.shsetsSOURCE_DATE_EPOCHper source to its last commit time, so regenerating the committed docs JSON is stable; the 34 docs JSON files gain only the new field.Why
Workers will upload Flow Definition Graphs to the Dex Server, which keeps, per Flow type, the upload with the newest generation time. File modification times are unreliable (checkouts, image builds, and caches rewrite them), so the generator records the time in the graph itself, reproducibly via the standard
SOURCE_DATE_EPOCH.Compatibility
Breaking for mixed versions (needs owner authorization before merge): Dex Web before 1.45 rejects unknown top-level fields, so it fails to load graphs produced by this
dexcli visualize. Upgrade Dex Web together with or before dexcli when graphs are loaded from a directory. Graphs withoutgeneratedAtstay valid. A follow-up in the same 1.45 release makes Dex Web ignore unknown top-level fields, so later field additions do not need lockstep upgrades.SOURCE_DATE_EPOCHmust be 0 to 253402300799 (9999-12-31T23:59:59Z); larger values are a usage error.Testing
go test -tags=integration ./internal/command -run 'TestVisualize|TestWeb'in cli (newvisualize_generated_at_integ_test.go: presence and format,SOURCE_DATE_EPOCH, invalid values, v1 unchanged, Dex Web accepts the graph).go test ./...in cli and web;npm run checkin web (node 24);cd docs && npm run check;make copyright-check.