Skip to content

Report conformance outcomes instead of Terraform version counts - #6

Merged
be-thomas merged 2 commits into
mainfrom
feat/conformance-outcomes
Oct 26, 2026
Merged

be-thomas merged 2 commits into
mainfrom
feat/conformance-outcomes

Conversation

@be-thomas

Copy link
Copy Markdown
Owner

Summary

The README conformance block answered a question nobody was asking: how the 853 vendored modules split across minimum Terraform versions. It could not tell a reader how much of the corpus actually makes it through the pipeline. This replaces it with an outcome table, generated from the same status command as before.

**853 / 853 modules — 100% — reach the IR and emit both AWS CDK and Pulumi TypeScript.**

| Outcome | Modules | Share |
|:--|--:|:--|
| Parsed to the universal IR | 853 | ████████████████████ 100% |
| IR → AWS CDK TypeScript | 853 | ████████████████████ 100% |
| IR → Pulumi TypeScript | 853 | ████████████████████ 100% |
| IR → AWS CDK, no warnings | 27 | ▏ 3% |
| IR → Pulumi, no warnings | 31 | ▏ 4% |

The last two rows are the honest part: reaching an emitter is not the same as converting cleanly. An unmapped resource or an unsupported block is reported as a warning rather than dropped, so only 27 CDK and 31 Pulumi modules need no human review.

What changed

  • status.Report gains Emit (cdk and pulumi, each with modules, emitted, failed, clean, warnings, failures). Compute runs engine.Convert for both targets after parsing and treats a missing result or an empty file list as a failure. Schema bumps to 2.
  • Outcomes() and Markdown() render the five pipeline rows in order with a bar scaled to the corpus; headline() produces the 100% sentence or a partial one when a stage falls short.
  • Badge() turns red when parsing or either emitter fails, so the badge still gates on the whole pipeline rather than parsing alone.
  • min_versions stays in conformance/status.json but is no longer rendered in the README; docs/CONFORMANCE.md documents the three questions the outcome summary answers.
  • CLI status line now reports parse and both emit counts.

Verification

  • go test ./internal/conformance/... ./cmd/... — new tests cover the emitted-vs-clean split, the emitted-vs-failed partition, the red badge on emitter failure, exact table rows, both headline forms and the marked-section round trip.
  • go vet ./... and gofmt -l . are clean.
  • make conformance-status regenerated the committed status.json and README block from the full corpus.

The README summary charted fixtures by their minimum Terraform version,
which says nothing about whether anything converts. Measure the pipeline
instead: parse every fixture, run both emitters over every graph that
parsed, and report how many reach the IR, how many produce AWS CDK and
Pulumi TypeScript, and how many of those need no warnings at all.

status.json gains an emit section (schema 2) holding per-target module,
emitted, failed, clean and warning counts. The README block becomes an
outcome table with percentage bars, and the version distribution stays in
the JSON without a chart. An emitter that succeeds with no files counts
as a failure, and the badge turns red when either emitter fails.
Comment thread internal/conformance/status/status.go Resolved
Comment thread README.md Resolved
Comment thread internal/conformance/status/status.go Resolved
A stage that converted 852 of 853 modules rounded up to 100% and drew a
full bar beside the failed module; one module of 853 rounded down to
nothing. Percentages now clamp to 1-99 for a partial result.

Failure messages quoted the path they were given, so an absolute -out
put a checkout-specific path in the committed report and made the
staleness check depend on where the tree lives. The fixtures root is
now trimmed from the message as well as from the location.

The emitter-failure branch of Compute had no test. A dependency cycle
parses but fails in both emitters, which now covers the partitioning,
the recorded failure and the red badge; the badge test also covers a
Pulumi-only failure.
@be-thomas
be-thomas merged commit 15626b7 into main Oct 26, 2026
1 check passed
@be-thomas
be-thomas deleted the feat/conformance-outcomes branch October 26, 2026 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant