Skip to content

fix: align OCI smoke-test counters assertions with generation-ordinal schema#26

Merged
monsieurleberre merged 2 commits into
mainfrom
fix/oci-smoke-counters-schema
Jul 2, 2026
Merged

fix: align OCI smoke-test counters assertions with generation-ordinal schema#26
monsieurleberre merged 2 commits into
mainfrom
fix/oci-smoke-counters-schema

Conversation

@monsieurleberre

@monsieurleberre monsieurleberre commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

What

Updates the bundle smoke-test's release-counters assertions in build-oci-codegen-cs.yaml to 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 } }

0fbd7d7 aligns the assertions with the new schema: store_version == 1, exactly one codegen_generations entry, first-emission ordinal 0. The generated-project <Version> check ending in .0 remains valid since a fresh counters file yields ordinal 0.

b1ce390 hardens the block so every failure path is loud and annotated: the counters file must be non-empty valid JSON, codegen_generations must be an object (an array [0] previously passed the count + ordinal checks vacuously), store_version/ordinal comparisons are numeric-exact via jq -e (string "1"/"0" no longer pass), and every jq extraction runs inside a guarded condition so set -e can 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.2 tag on the public repo failed all four per-RID bundle builds at "Smoke test bundle" with expected 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 dev was run with --release-counters --generate-project on the splice-api-token-holding-v1 fixture intermediate, and this branch's smoke-verification block (extracted verbatim at b1ce390) passed against the output. Negative matrix (all fail with exit 1 and the intended ::error:: message): old flat schema, ordinal 1, two entries, codegen_generations as array [0] / string / missing, malformed JSON, empty file, string-typed store_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) from main, then attach the bundle tarballs from that run to the existing draft release v0.2.0-preview.2 (the attach job only auto-runs on tag pushes). The release stays draft until Splice/Daml.Finance artifacts are attached.

… 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).
Copilot AI review requested due to automatic review settings July 2, 2026 17:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Scala coverage

Code Coverage

Package Line Rate Branch Rate Health
studio.peaceful.daml.codegen.helper 92% 91%
Summary 92% (503 / 549) 91% (106 / 116)

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

C# coverage

Code Coverage

Package Line Rate Branch Rate Complexity Health
Daml.Codegen.CSharp 98% 97% 1091
Daml.Codegen.CSharp.Cli 100% 100% 3
Daml.Codegen.Testing.Conformance 82% 98% 74
Daml.Ledger.Abstractions 95% 90% 12
Daml.Runtime 95% 82% 442
Summary 96% (3791 / 3932) 93% (1422 / 1525) 1622

Copilot AI review requested due to automatic review settings July 2, 2026 21:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@monsieurleberre monsieurleberre merged commit 2ecc127 into main Jul 2, 2026
22 checks passed
@monsieurleberre monsieurleberre deleted the fix/oci-smoke-counters-schema branch July 2, 2026 21:13
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.

2 participants