Skip to content

ci: backport release workflow changes to release/2.29 (#29793, #32209, #32211) - #32227

Merged
sreya merged 3 commits into
release/2.29from
backport/29793-32209-32211-to-2.29
Nov 16, 2026
Merged

sreya merged 3 commits into
release/2.29from
backport/29793-32209-32211-to-2.29

Conversation

@sreya

@sreya sreya commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

Backports release workflow changes from main so releases cut from release/2.29 (ESR) use the current publish guard and signing flow:

Each commit is a git cherry-pick -x of the original commit on main. Conflicts were resolved to preserve 2.29-specific divergence (dylib pipeline, macOS 15 runner pins, older action SHAs).

Conflicts:

  • ci: guard helm index.yaml publish with a GCS generation precondition #29793 (release.yaml): main's Publish Helm Chart step also handles the ai-gateway chart, which does not exist on 2.29. Applied the generation-precondition guard (move index merge after tarball uploads, gsutil stat generation read, x-goog-if-generation-match upload with ::error:: + exit 1 on mismatch) into the branch's coder+provisioner-only step; the ai-gateway lines were not imported.
  • chore: add optional Cloud KMS dual signing for release GPG signatures #32209 (ci.yaml): main removed the dylib download/insert steps that 2.29 still has in the cross-build job; the new "Print GPG KMS public key" step landed next to them in the conflict. Kept both: the new step is inserted after "Setup GCloud SDK" and the dylib steps remain before "Build". release.yaml, Makefile, go.mod, and sign_with_gpg.sh auto-merged identically to main (go.mod change is only dropping // indirect from github.com/ProtonMail/go-crypto v1.4.1).
  • ci: sign darwin binaries with an Apple signing key in Google Cloud KMS #32211 (release.yaml + ci.yaml): both conflicts were the inline "Install rcodesign" run step (2.29's variant lacks main's retry.sh wrapper) vs the new ./.github/actions/install-rcodesign composite action; took the composite action in both files. Adaptation: the new composite action and the new "Setup Google Cloud KMS PKCS11 library" steps invoke ./.github/scripts/retry.sh, which did not exist on 2.29, so .github/scripts/retry.sh was copied verbatim from main as part of the conflict resolution (it only depends on scripts/lib.sh, which is present on 2.29).

sign_darwin.sh caller compatibility: the script's CLI (sign_darwin.sh <path> <identifier>) is unchanged; KMS mode is selected only when AC_PKCS11_LIBRARY is set, otherwise it falls back to the pre-existing P12 mode. The 2.29-only dylib pipeline (build-dylib jobs in release.yaml/ci.yaml → make build/coder-dylib → scripts/build_go.sh --dylib → sign_darwin.sh) sets only AC_CERTIFICATE_FILE/AC_CERTIFICATE_PASSWORD_FILE, so it keeps using P12 signing with its pinned macOS rcodesign 0.22.0 install; no caller changes were needed. build_go.sh's requiredenvs check mirrors the same mode selection.

No ci.yaml hunks were dropped: 2.29's cross-build/signing job (environment: ci-signing) still exists and all hunks from both commits applied to it (the "Print GPG KMS public key" step keeps its github.ref == 'refs/heads/main' guard, so it is inert on release branches, same as any release branch on main's workflow).

Validation: go build ./scripts/gpgkms/ and go test ./scripts/gpgkms/ pass (ok, 0.185s); bash -n passes on scripts/sign_with_gpg.sh, scripts/sign_darwin.sh, scripts/build_go.sh, scripts/archive.sh, scripts/notarize_darwin.sh, and .github/scripts/retry.sh; actionlint was unavailable in the environment, so release.yaml, ci.yaml, and the new action.yml were parsed with Python yaml.safe_load (all parse cleanly). Verified via line-level audit that every + line of the three commits' diffs is present on the branch (the only absences are the four #32209 lines that #32211 itself rewrote, which are equally absent on main), and git diff origin/main -- .github/workflows/release.yaml contains no - lines mentioning gpg_kms/pkcs11/rcodesign/if-generation/v2.asc/kmsp11 — i.e. none of the backported logic is missing relative to main, while the dylib pipeline and other 2.29 divergence remain.

Requested by @sreya.

garrettatcoder and others added 3 commits November 16, 2026 02:49
…29793)

The `Publish Helm Chart` step does an unguarded read-modify-write of
`gs://helm.coder.com/v2/index.yaml`: download, `helm repo index --merge`
with only this run's three charts, upload. The workflow `concurrency`
group is keyed on `github.ref`, so releases for different tags run in
parallel. When two of them reach this step at about the same time, both
merge into the same old index and the second upload silently drops the
first release's entries. This is how 2.36.6 (and, going by the current
index, probably 2.36.2) went missing from the `coder-v2` chart repo
after back-to-back manual re-runs.

Treat the index like a compare-and-swap:

- Read the object's GCS `generation` before and after downloading
`index.yaml`, and fail if it changed underneath us.
- Upload with `x-goog-if-generation-match:<generation>` so a concurrent
writer causes a `412` instead of a clobber.
- On either failure, exit with a `::error::` telling the operator to
re-run the job. No automatic retry; a re-run merges against the fresh
index.

Chart tarballs are still uploaded before the index, so an index entry is
never published ahead of its tarball. The OCI pushes to
`ghcr.io/coder/chart` are unchanged; they have no shared index and were
never affected.

Serializing all release runs through a single `concurrency` group was
considered and rejected: GitHub keeps only the newest pending run per
group, so a third dispatch would silently cancel a queued release.

- `actionlint` and `shellcheck` on the step script pass.
- Exercised the step locally with a fake `gsutil`: the happy path
uploads and bumps the generation; bumping the generation between read
and upload makes the precondition fail and the step exit 1 with the
re-run message.
- Not exercised against the real bucket. The
`x-goog-if-generation-match` header and `gsutil stat` `Generation:`
field are standard GCS behaviour, but a dry-run cannot cover this
because the step is skipped when `dry_run` is set.

This does not repair the already-missing entries; #29794 adds a one-off
workflow for that.

---
_Generated by Coder Agents on behalf of @f0ssel._

---------

Co-authored-by: McKayla はな <kayla@tree.camp>
(cherry picked from commit 54bd34d)
@github-actions

Copy link
Copy Markdown
Contributor

👋 Hey @sreya!

This PR is targeting the release/2.29 release branch, but its title does not start with fix: or fix(scope):.

Only bug fixes should be cherry-picked to release branches. If this is a bug fix, please update the PR title to match the conventional commit format:

fix: description of the bug fix
fix(scope): description of the bug fix

If this is not a bug fix, it likely should not target a release branch.

@sreya
sreya marked this pull request as ready for review November 16, 2026 02:55
@sreya
sreya requested a review from a team November 16, 2026 02:55
@sreya
sreya merged commit 3b74656 into release/2.29 Nov 16, 2026
36 checks passed
@sreya
sreya deleted the backport/29793-32209-32211-to-2.29 branch November 16, 2026 03:49
@linear-code

linear-code Bot commented Nov 16, 2026

Copy link
Copy Markdown

SEC-1432

This branch had an error being deployed

1 failed deployment
docs-preview — 07fe9177 Deployed Nov 16, 2026 by sreya via cleanup #85
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.

4 participants