Repository navigation
ci: backport release workflow changes to release/2.29 (#29793, #32209, #32211) - #32227
Merged
Merged
Conversation
…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)
Contributor
|
👋 Hey @sreya! This PR is targeting the 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: If this is not a bug fix, it likely should not target a release branch. |
deansheather
approved these changes
Nov 16, 2026
kylecarbs
approved these changes
Nov 16, 2026
This branch had an error being deployed
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.
Backports release workflow changes from
mainso releases cut fromrelease/2.29(ESR) use the current publish guard and signing flow:Each commit is a
git cherry-pick -xof the original commit on main. Conflicts were resolved to preserve 2.29-specific divergence (dylib pipeline, macOS 15 runner pins, older action SHAs).Conflicts:
ai-gatewaychart, which does not exist on 2.29. Applied the generation-precondition guard (move index merge after tarball uploads,gsutil statgeneration read,x-goog-if-generation-matchupload with::error::+ exit 1 on mismatch) into the branch's coder+provisioner-only step; the ai-gateway lines were not imported.// indirectfrom github.com/ProtonMail/go-crypto v1.4.1)../.github/actions/install-rcodesigncomposite 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.shwas copied verbatim from main as part of the conflict resolution (it only depends onscripts/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 whenAC_PKCS11_LIBRARYis set, otherwise it falls back to the pre-existing P12 mode. The 2.29-only dylib pipeline (build-dylibjobs in release.yaml/ci.yaml →make build/coder-dylib→scripts/build_go.sh --dylib→sign_darwin.sh) sets onlyAC_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/andgo test ./scripts/gpgkms/pass (ok, 0.185s);bash -npasses 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), andgit diff origin/main -- .github/workflows/release.yamlcontains 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.