fix: align OCI smoke-test counters assertions with generation-ordinal schema#26
Merged
Merged
Conversation
… schema
The release-counters store now writes {store_version, codegen_generations: {<version>: <ordinal>}} but the bundle smoke test still asserted the retired flat per-package revision schema, failing every RID at tag time (run 28597012818).
Require the counters file to be a non-empty valid JSON object, assert codegen_generations is an object before counting entries, compare store_version and the generation ordinal numerically, and move every jq extraction into a guarded condition so set -e cannot skip the ::error:: annotations. Mirrors daml-codegen-csharp-internal PR #496 (c1a7850), validated there and merged.
Contributor
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Updates the bundle smoke-test's release-counters assertions in
build-oci-codegen-cs.yamlto the schema the tool has written since the generation-ordinal change shipped in 0.2.0-preview.2:{ "store_version": 1, "codegen_generations": { "<codegen-version>": 0 } }0fbd7d7aligns the assertions with the new schema:store_version == 1, exactly onecodegen_generationsentry, first-emission ordinal0. The generated-project<Version>check ending in.0remains valid since a fresh counters file yields ordinal 0.b1ce390hardens the block so every failure path is loud and annotated: the counters file must be non-empty valid JSON,codegen_generationsmust be an object (an array[0]previously passed the count + ordinal checks vacuously),store_version/ordinal comparisons are numeric-exact viajq -e(string"1"/"0"no longer pass), and every jq extraction runs inside a guarded condition soset -ecan no longer abort past the::error::annotations on malformed input. Mirrors the block validated and merged on the internal source of truth (peacefulstudio/daml-codegen-csharp-internal#496,c1a7850), so the next promotion overlay produces no drift.Why
The
v0.2.0-preview.2tag on the public repo failed all four per-RID bundle builds at "Smoke test bundle" withexpected exactly one release-counter entry, got 2— the workflow asserted the retired per-package revision schema while the tool (correctly, per the 0.2.0-preview.2 changelog) wrote the new store format. Failing run: peacefulstudio/daml-codegen-csharp actions/runs/28597012818. The stale block was never exercised here because it only runs in the tag-push path.Verification
The assertions pass against the exact counters output captured in the failing run's logs (
{"store_version": 1, "codegen_generations": {"0.2.0-preview.2": 0}}).Also exercised end-to-end against real tool output (2026-07-02): the emitter built from internal
devwas run with--release-counters --generate-projecton thesplice-api-token-holding-v1fixture intermediate, and this branch's smoke-verification block (extracted verbatim atb1ce390) passed against the output. Negative matrix (all fail with exit 1 and the intended::error::message): old flat schema, ordinal 1, two entries,codegen_generationsas array[0]/ string / missing, malformed JSON, empty file, string-typedstore_version"1", string-typed ordinal"0".Post-merge plan
Re-fire the OCI build for the already-tagged release via
workflow_dispatch(version=0.2.0-preview.2,push=true) frommain, then attach the bundle tarballs from that run to the existing draft releasev0.2.0-preview.2(the attach job only auto-runs on tag pushes). The release stays draft until Splice/Daml.Finance artifacts are attached.