Skip to content

Add golden output snapshots and one version source - #3

Merged
be-thomas merged 2 commits into
mainfrom
feat/release-hardening
Oct 26, 2026
Merged

be-thomas merged 2 commits into
mainfrom
feat/release-hardening

Conversation

@be-thomas

Copy link
Copy Markdown
Owner

What

Closes the remaining v0.1.1 release-hardening items.

  • Golden output — pkg/engine/golden_test.go snapshots examples/aws-web-app for CDK and Pulumi under pkg/engine/testdata/golden/, including each target's warnings. The test runs from the repository root so the // Source: path in generated code stays portable across machines; -update rewrites the snapshots.
  • One version source — the release version lives in internal/buildinfo/VERSION and is embedded at build time, so go build, go run and make build all report the same value through openiac version. A CLI test pins the output.
  • Docs — CONTRIBUTING documents refreshing snapshots and bumping the version; ROADMAP marks v0.1.1 complete.

Why

The last two commits changed emitter output (JSON nested-block recovery, single interpolations). Without snapshots that drift is invisible in review.

Verification

  • gofmt -l . clean, go vet ./... clean
  • go test ./... and go test -race ./pkg/... ./internal/... ./cmd/... pass
  • OPENIAC_CORPUS=1 go test ./pkg/parsers/hcl -run TestParseConformanceCorpus parses 853 modules
  • make build, make wasm, ./bin/openiac version → openiac 0.1.0-dev
  • make conformance-verify → 853 fixtures, 6,471 files, 24,314,566 bytes

Snapshot examples/aws-web-app for both targets under pkg/engine/testdata,
including each target's warnings, so an emitter change cannot alter
generated TypeScript without showing up in review. The test runs from the
repository root so the embedded source path stays portable; -update
rewrites the snapshots.

The release version now lives in internal/buildinfo/VERSION and is
embedded at build time, so go build, go run and make build all report
the same value through `openiac version`. A CLI test pins the output and
the golden tests close the v0.1.1 exit criteria.

@be-thomas be-thomas left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Reviewed at 0d8885a. Verified locally: gofmt clean, go vet clean, go test ./... passes, the golden test is deterministic across 25 runs, the snapshots contain no absolute paths or timestamps and map-derived output is sorted, and go run ./cmd/openiac version and go build both report openiac 0.1.0-dev (the Makefile build target adds no ldflags). The findings below are low severity; none blocks the change.

Comment thread pkg/engine/golden_test.go Resolved
Comment thread pkg/engine/golden_test.go Resolved
Comment thread docs/ROADMAP.md Resolved
Address review findings on the golden test:

- Find the module root from the test file instead of assuming the
  binary starts in pkg/engine, so a prebuilt test binary run from any
  directory still finds the example.
- Snapshot a second fixture that cannot be fully converted, so the
  warning section of a golden file is actually populated and changes to
  warning collection are visible. The test fails if that fixture stops
  reporting warnings.
- Keep v0.1.1 marked in progress: VERSION still carries a -dev suffix
  and no tag exists.
@be-thomas
be-thomas merged commit 86f73fd into main Oct 26, 2026
1 check passed
@be-thomas
be-thomas deleted the feat/release-hardening 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