Skip to content

[TFgen] Added a report structure#3860

Open
Supam wants to merge 4 commits into
generator-v2from
thibault.viennot/generator-v2/report
Open

[TFgen] Added a report structure#3860
Supam wants to merge 4 commits into
generator-v2from
thibault.viennot/generator-v2/report

Conversation

@Supam
Copy link
Copy Markdown
Member

@Supam Supam commented Jun 3, 2026

Summary

Adds the run-report layer for the tfgen generator (FR-014). report.WriteJSON serializes a model.RunReport to JSON matching contracts/run-report.schema.json, deriving the per-status summary from the artifacts so the counts CI gates on can't drift from the artifact list. The report types (RunReport, ArtifactReportEntry, Diagnostic, SkippedOperation, RunSummary + status/severity/reason enums) live in internal/model.

The generate command now initializes a report with the fields it can populate up front — a fresh v4 run ID (google/uuid), the build-stamped generator version (main.Version), the spec SHA-256 (specHash in the parser), and start/finish timestamps. Per-artifact entries are filled in by the generation pipeline in a later change.

Test Plan

New report_test.go covers required fields, derived summary counts, nested artifact/skipped/diagnostic shape, omitempty behavior, determinism, and the nil/writer-error paths.

Copy link
Copy Markdown
Member Author

Supam commented Jun 3, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@Supam Supam marked this pull request as ready for review June 3, 2026 14:10
@Supam Supam requested a review from a team as a code owner June 3, 2026 14:10
@datadog-prod-us1-5

This comment has been minimized.

@Supam Supam force-pushed the jason.tenczar/generator-v2/tracking-field-decode branch from 87082c5 to 5c7c167 Compare June 3, 2026 14:41
@Supam Supam force-pushed the thibault.viennot/generator-v2/report branch from 2d270cd to 46b6a91 Compare June 3, 2026 14:41
@j10czar j10czar changed the base branch from jason.tenczar/generator-v2/tracking-field-decode to graphite-base/3860 June 3, 2026 18:23
Copy link
Copy Markdown

@j10czar j10czar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm 👍

@Supam Supam force-pushed the thibault.viennot/generator-v2/report branch from 46b6a91 to f304be8 Compare June 4, 2026 15:30
@Supam Supam force-pushed the graphite-base/3860 branch from 5c7c167 to c4630e5 Compare June 4, 2026 15:30
@Supam Supam changed the base branch from graphite-base/3860 to jason.tenczar/generator-v2/tracking-field-decode June 4, 2026 15:30
Base automatically changed from jason.tenczar/generator-v2/tracking-field-decode to generator-v2 June 4, 2026 15:32
@Supam Supam force-pushed the thibault.viennot/generator-v2/report branch from f304be8 to ea900d3 Compare June 4, 2026 15:37
Supam added 4 commits June 4, 2026 13:35
Added a report structure for after run reports.
This will be used by CI and may be used by other tools downstream.
Set initial values for the run report in the generate command.
The rest of the content should be filled by the actual generation.
cmd.Version is empty on the generate subcommand: cobra does not propagate
Version from the root command, so the report's generator_version field was
always "". Read it from cmd.Root().Version, where main.go stamps it.

Also gofmt the RunReport and Spec struct literals (value alignment, stray
blank lines) and fix a doc-comment typo in report.go.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants