Skip to content

fix(ci): give OCI release-attach gh repo context and fail loudly#34

Merged
monsieurleberre merged 1 commit into
mainfrom
fix/build-oci-attach-bundles
Jul 18, 2026
Merged

fix(ci): give OCI release-attach gh repo context and fail loudly#34
monsieurleberre merged 1 commit into
mainfrom
fix/build-oci-attach-bundles

Conversation

@monsieurleberre

Copy link
Copy Markdown
Contributor

Problem

The attach-to-draft-release job in build-oci-codegen-cs.yaml has silently
never attached an OCI bundle to any release. Both v0.4.0-preview.1 and
v0.4.0-preview.2 releases have zero .tar.gz bundle assets.

Root cause: no repo context + swallowed failure

The job runs on a v* tag push with no actions/checkout step and no
GH_REPO
, so the gh CLI cannot resolve which repository it is operating on.
In evidence run
29635376980
(tag v0.4.0-preview.2), the attach step log shows:

failed to run git: fatal: not a git repository (or any of the parent directories): .git
failed to run git: fatal: not a git repository (or any of the parent directories): .git
no tarballs to attach

The trailing || echo "no tarballs to attach" turned a real gh release upload
failure into a green job with a misleading message.

The download step was already correct

The download-artifact step already sets merge-multiple: true, so the tarballs
do land flat as bundles/*.tar.gz and the glob matched all four. Proof: there
are two failed to run git lines — one from gh release create, one from
gh release upload. The upload command only runs when [ ${#files[@]} -gt 0 ] is
true, so the glob was not the problem. The failure was purely missing repo
context, hidden by || echo. The download step is therefore left unchanged.

Fix (attach step only)

  • Add GH_REPO: ${{ github.repository }} so gh works without a checkout.
  • Keep create-if-missing, but drop || true so a genuine gh release create
    failure fails the step.
  • Require exactly 4 bundle tarballs — the four build-per-rid matrix legs are
    hard needs: dependencies, so any other count means the download step or an
    upstream build broke — and ::error:: + exit 1 on mismatch instead of a
    misleading echo. (Mirrors the expected_platforms=4 guard in compose-index.)
  • Let gh release upload failures fail the step (no || echo).

Validation

  • actionlint clean on the changed step (the one remaining SC2129 style nit is
    pre-existing, at the untouched validate-inputs step).
  • YAML parses.
  • Signed via createCommitOnBranch (server-signed; verified: true).

Do not auto-merge.

Bug: the "Attach OCI bundles to draft release" job runs on a v* tag push with no
checkout and no GH_REPO, so gh cannot resolve the repository. In run 29635376980
(v0.4.0-preview.2) gh release create AND gh release upload both printed
"failed to run git: fatal: not a git repository"; the trailing `|| echo "no
tarballs to attach"` swallowed the upload failure into a green job. No release
has ever received an OCI bundle asset (v0.4.0-preview.1 and .2 both have zero).

The download step already sets merge-multiple: true, so bundles/*.tar.gz did in
fact match all four tarballs — the two "failed to run git" lines prove the upload
command ran and then failed on missing repo context, not a glob miss.

Fix:
- add GH_REPO: ${{ github.repository }} so gh works without a checkout;
- create-if-missing kept, but a create failure now fails the step (no || true);
- require exactly 4 bundle tarballs (build-per-rid legs are hard dependencies) and
  fail loudly on any mismatch instead of echoing a misleading message;
- let gh release upload failures fail the step.
@github-actions

Copy link
Copy Markdown
Contributor

Scala coverage

Code Coverage

Package Line Rate Branch Rate Health
studio.peaceful.daml.codegen.helper 97% 95%
Summary 97% (642 / 663) 95% (145 / 152)

@github-actions

Copy link
Copy Markdown
Contributor

C# coverage

Code Coverage

Package Line Rate Branch Rate Complexity Health
Daml.Codegen.CSharp 98% 97% 1185
Daml.Codegen.CSharp.Cli 100% 100% 3
Daml.Codegen.Testing.Conformance 78% 98% 73
Daml.Ledger.Abstractions 73% 89% 21
Daml.Ledger.Abstractions.Testing.Conformance 59% 50% 16
Daml.Runtime 94% 84% 538
Summary 95% (4082 / 4276) 93% (1615 / 1733) 1836

@github-actions

Copy link
Copy Markdown
Contributor

Scala build matrix

shard result duration
macos-amd64 ✅ success 2m 04s
macos-arm64 ✅ success 1m 08s
ubuntu-amd64 ✅ success 1m 07s
ubuntu-arm64 ✅ success 57s
windows-amd64 ✅ success 1m 35s

@github-actions

Copy link
Copy Markdown
Contributor

C# build matrix

shard result duration
macos-amd64 ✅ success 1m 27s
macos-arm64 ✅ success 43s
ubuntu-amd64 ✅ success 1m 08s
ubuntu-arm64 ✅ success 1m 07s
windows-amd64 ✅ success 2m 12s
windows-arm64 ✅ success 1m 58s

@monsieurleberre
monsieurleberre merged commit ff502f3 into main Jul 18, 2026
24 checks passed
@monsieurleberre
monsieurleberre deleted the fix/build-oci-attach-bundles branch July 18, 2026 08:10
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