Skip to content

dexcli visualize: write generatedAt into Flow Definition Graph 2.0 JSON - #1586

Merged
longquanzheng merged 5 commits into
mainfrom
feat/fdg-generated-at
Nov 11, 2026
Merged

longquanzheng merged 5 commits into
mainfrom
feat/fdg-generated-at

Conversation

@longquanzheng

@longquanzheng longquanzheng commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • dexcli visualize --schema-version 2.0 writes a top-level generatedAt (RFC 3339 UTC, seconds) into each Flow Definition Graph. It honors SOURCE_DATE_EPOCH; an invalid value is a usage error. Schema 1.0 output is unchanged.
  • The v2 JSON Schema and Dex Web's v2 validator accept the optional field and reject a malformed value; TS types gain generatedAt?.
  • docs/scripts/generate-flow-definitions.sh sets SOURCE_DATE_EPOCH per source to its last commit time, so regenerating the committed docs JSON is stable; the 34 docs JSON files gain only the new field.
  • Reference (web flow visualization page) and cli/web change log entries for 1.45.

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 without generatedAt stay 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_EPOCH must 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 (new visualize_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 check in web (node 24); cd docs && npm run check; make copyright-check.

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.
@longquanzheng longquanzheng added the type:feature New capability or API label Nov 11, 2026
@codecov

codecov Bot commented Nov 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@longquanzheng
longquanzheng merged commit d92cd5c into main Nov 11, 2026
33 checks passed
@longquanzheng
longquanzheng deleted the feat/fdg-generated-at branch November 11, 2026 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:feature New capability or API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant