Files
coder/scripts/release
Denis AfonsoandClaude 200cffcfd8 fix(scripts/release): promote stable on immutable releases (#30745)
## Problem

`./scripts/release_promote_stable.sh v2.37.4` failed today with:

```
edit release failed: PATCH https://api.github.com/repos/coder/coder/releases/403906567: 404 Not Found
```

Releases on this repo are immutable (`gh release view v2.37.4 --json
isImmutable` → `true`). `promoteVersionToStable` cloned the entire
`RepositoryRelease` into `EditRelease`, so the PATCH carried `tag_name`,
`target_commitish` and the assets. GitHub rejects that on an immutable
release even when the values are unchanged, and answers 404 rather than
422. The same edit with only `body`, `prerelease` and `make_latest`
succeeds (that's how v2.37.4 was promoted by hand).

## Change

- Build a minimal `RepositoryRelease{Body, Prerelease, MakeLatest}` for
the edit.
- Drop the `Draft: false` assignment (published releases are never
drafts, and `draft` is not an editable field on immutable releases).
- Dry-run now logs the body diff instead of a diff of the whole object.
- Remove the now-unused `cloneRelease` helper.

Verified with `go test ./scripts/release/` and a `promote --dry-run`
against v2.36.7.

Every release published since immutable releases were enabled is
affected, so without this the command cannot promote anything. Related:
the release-process review notes that this step is also missing from the
runbook and should become a workflow job on every `.0` mainline release.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-14 16:42:56 +01:00
..