Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -341,18 +341,23 @@ tree, its lock and the generated attribution on every pull request.
[![conformance](https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fbe-thomas%2FOpenIaC%2Fmain%2Fconformance%2Fbadge.json&style=flat-square)](conformance/status.json)

<!-- conformance:summary:start -->
```mermaid
xychart-beta
title "Fixtures by minimum Terraform version"
x-axis ["1.0", "1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "1.9", "1.10", "1.11"]
y-axis "Fixtures" 0 --> 500
bar [477, 34, 4, 168, 1, 117, 15, 3, 6, 9, 6, 13]
```
**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% |
<!-- conformance:summary:end -->

Every one of the 853 modules parses into schema `0.2` IR. The chart groups each
module by the oldest Terraform release its configuration needs; the exact
distribution is in [`conformance/status.json`](conformance/status.json), which
Every one of the 853 modules parses into schema `0.2` IR and produces non-empty
AWS CDK and Pulumi TypeScript. The last two rows are the honest part: only 27
and 31 of them convert with no warnings at all, because an unmapped resource or
an unsupported block is reported rather than dropped. Exact counts, including
the distribution of each module's minimum Terraform version, are in
[`conformance/status.json`](conformance/status.json), which
`make conformance-status` regenerates and CI checks.

```bash
Expand Down
6 changes: 4 additions & 2 deletions cmd/openiac-conformance/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@ func runStatus(args []string) error {
if len(stale) > 0 {
return fmt.Errorf("%s is stale: run `make conformance-status` and commit the result", strings.Join(stale, ", "))
}
fmt.Printf("status: %d/%d modules parse, summary current\n", report.Parse.Parsed, report.Parse.Modules)
fmt.Printf("status: %d/%d modules parse, %d/%d emit CDK, %d/%d emit Pulumi, summary current\n",
report.Parse.Parsed, report.Parse.Modules, report.Emit.CDK.Emitted, report.Emit.CDK.Modules, report.Emit.Pulumi.Emitted, report.Emit.Pulumi.Modules)
return nil
}

Expand All @@ -263,7 +264,8 @@ func runStatus(args []string) error {
if err := os.WriteFile(*readmePath, []byte(updated), 0o644); err != nil {
return err
}
fmt.Printf("status: %d/%d modules parse\n", report.Parse.Parsed, report.Parse.Modules)
fmt.Printf("status: %d/%d modules parse, %d/%d emit CDK, %d/%d emit Pulumi\n",
report.Parse.Parsed, report.Parse.Modules, report.Emit.CDK.Emitted, report.Emit.CDK.Modules, report.Emit.Pulumi.Emitted, report.Emit.Pulumi.Modules)
fmt.Println(report.Markdown())
return nil
}
Expand Down
18 changes: 17 additions & 1 deletion conformance/status.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"schema": 1,
"schema": 2,
"corpus": {
"fixtures": 853,
"files": 6471,
Expand All @@ -11,6 +11,22 @@
"parsed": 853,
"failed": 0
},
"emit": {
"cdk": {
"modules": 853,
"emitted": 853,
"failed": 0,
"clean": 27,
"warnings": 10669
},
"pulumi": {
"modules": 853,
"emitted": 853,
"failed": 0,
"clean": 31,
"warnings": 11774
}
},
"min_versions": {
"1.0.0": 468,
"1.0.11": 3,
Expand Down
36 changes: 27 additions & 9 deletions docs/CONFORMANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,25 +150,43 @@ therefore fails verification instead of silently drifting.
Provider, CloudFormation and Pulumi schemas are dependencies rather than source:
they are pinned by lockfile and cached outside the tree.

### Parse summary
### Outcome summary

`openiac-conformance status` parses every fixture and writes three committed
files: [`status.json`](../conformance/status.json) holds the corpus size, the
parse counts and the minimum-version distribution,
`openiac-conformance status` parses every fixture, runs both emitters over every
graph that parsed, and writes three committed files:
[`status.json`](../conformance/status.json) holds the corpus size, the parse
counts, each emitter's results and the minimum-version distribution,
[`badge.json`](../conformance/badge.json) is the shields.io endpoint the README
renders as a badge, and the chart between the `conformance:summary` markers in
the [`README`](../README.md) is regenerated in place. CI runs `status -check`,
so the summary cannot drift from the corpus without failing a pull request.
renders as a badge, and the outcome table between the `conformance:summary`
markers in the [`README`](../README.md) is regenerated in place. CI runs
`status -check`, so the summary cannot drift from the corpus without failing a
pull request.

```bash
make conformance-status # re-parse the corpus and rewrite all three
make conformance-status # re-parse, re-emit and rewrite all three
make conformance-status-check # fail when the committed summary is stale
```

The report separates three questions the corpus answers, because they fail
differently:

| Field | Question | A regression means |
|:--|:--|:--|
| `parse.parsed` | Did the parser turn this module into IR? | The parser rejects valid Terraform |
| `emit.<target>.emitted` | Did the emitter produce non-empty TypeScript? | The emitter crashes or emits nothing |
| `emit.<target>.clean` | Did it do so without a warning? | Nothing broken — the module needs a human, which is the documented behaviour for unmapped constructs |

`emitted + failed` partitions the modules each emitter was run on, and `clean`
is a subset of `emitted`. A module that fails to parse is never handed to an
emitter, so the two denominators differ when parsing regresses. Every emitted
module is expected to be non-empty: an emitter that succeeds with no file is
counted as a failure.

The minimum version is the oldest Terraform release a fixture needs, derived
from its `required_version` constraint and the language features it uses (see
[TERRAFORM-VERSIONS.md](TERRAFORM-VERSIONS.md)); it measures parse coverage, not
conversion completeness.
conversion completeness, and is kept in `status.json` rather than rendered in
the README.

### Sources

Expand Down
Loading
Loading