Skip to content

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

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

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

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.37 use the current publish guard and signing flow:

Each commit is a git cherry-pick -x of the original commit on main.

Conflicts: none. All three commits applied cleanly; each cherry-picked patch is content-identical to the original (hunk offsets only), including the full ci.yaml dry-run signing coverage. The only go.mod change is removing // indirect from github.com/ProtonMail/go-crypto v1.4.1.

Validation: go build ./scripts/gpgkms/ and go test ./scripts/gpgkms/ pass; bash -n passes on scripts/sign_with_gpg.sh, scripts/sign_darwin.sh, scripts/build_go.sh; release.yaml, ci.yaml, and the new install-rcodesign/action.yml parse as valid YAML (actionlint not available locally). Residual release.yaml diff vs main is fully attributed to non-backported dependabot action bumps (#28862, #30776, #31052, #31341) and the non-backported retry.sh --timeout change (#30889); nothing unexplained.

Requested by @sreya.

garrettatcoder and others added 3 commits November 16, 2026 02:48
…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.

## Fix

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.

## Verification

- `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.37 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:51
@sreya
sreya requested a review from a team November 16, 2026 02:51
@sreya
sreya merged commit 962bf7b into release/2.37 Nov 16, 2026
58 of 60 checks passed
@sreya
sreya deleted the backport/29793-32209-32211-to-2.37 branch November 16, 2026 02:58
@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 — a54981f0 Deployed Nov 16, 2026 by sreya via cleanup #83
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.

3 participants