Skip to content

plan: collapse release to a single human action#373

Open
brianmhunt wants to merge 1 commit intomainfrom
plans/single-action-release
Open

plan: collapse release to a single human action#373
brianmhunt wants to merge 1 commit intomainfrom
plans/single-action-release

Conversation

@brianmhunt
Copy link
Copy Markdown
Member

Summary

Captures the cost of TKO's current tag-driven release flow — which we just lived through on the 4.1.0 cut — and proposes collapsing it to a single human action: merge the version PR.

Why now

The 4.1.0 cut required:

  1. Push initial tag v4.1.0
  2. Wait for changesets/action (which silently skipped PR creation under the tag-push trigger — known wrinkle, branch name changeset-release/refs/tags/v4.1.0 is the symptom)
  3. Hand-open the version PR (chore: version packages (v4.1.0) #372) wrapping the bot-generated branch
  4. Review + merge the PR
  5. Force-move the tag to the merged commit and re-push
  6. Wait for second workflow run

Five out of six steps are admin or latency. The two with maintainer judgment (review and merge) are buried in the noise. That cuts directly against the Dark Factory thesis — a single time-constrained maintainer with AI agents shouldn't be pushing tags twice and worrying about whether they're on the right commit.

Proposed shape

  • Trigger release.yml on push: branches: [main] (the canonical changesets pattern).
  • Single job replaces three (prepare-release / publish / github-release).
  • changesets/action's built-in publish input runs npx changeset publish automatically when there are no pending changesets and sets outputs.published.
  • A post-publish step generates vX.Y.Z from tools/release-version.cjs, creates the tag and GitHub Release. No more force-push tag dance, no more tag-vs-version validation.

Tradeoffs

  • Lose the "tag when I want to release" entry point. Maintainer instead decides timing by when they merge the version PR.
  • Releases batch by version-PR cadence — every changeset-bearing feature PR rebumps the open version PR; merge whenever the batch feels release-worthy.
  • GitHub release notes lose the "tag pre-existed" guarantee. Mitigation: github-release.yml already exists as a manual backfill workflow.

Out of scope

  • Changelog reform (separate plan — about artifact shape, not pipeline).
  • Pre-release / canary channels (separate plan — would auto-publish every main commit to next).

Test plan

  • Plan reviewed for accuracy against current release.yml and the 4.1.0-cut experience
  • Phasing approved (land plan + workflow rewrite together; test with a no-op patch release)

https://claude.ai/code/session_01Jnv99bwWtFWFmsyL7A2cJv


Generated by Claude Code

Captures the cost of the current tag-driven release dance (which we just
lived through on the 4.1.0 cut: tag push that didn't open a PR, manually
opened version PR #372, force-tag re-push pending) and proposes a
single-job push-to-main workflow where the only human action is
"merge the version PR."

Documents the shape of the rewritten release.yml, what gets removed
(force-push tag, separate prepare/publish/github-release jobs, tag-vs-version
validation), what stays (OIDC trusted publishing, github-release.yml fallback,
publish-check.yml on PRs), and the tradeoffs (lose tag-driven entry; gain
control via version-PR cadence).

Out of scope: changelog reform (separate plan), prerelease/canary channels.

https://claude.ai/code/session_01Jnv99bwWtFWFmsyL7A2cJv
Copilot AI review requested due to automatic review settings April 27, 2026 16:40
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 27, 2026

Warning

Rate limit exceeded

@brianmhunt has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 19 minutes and 35 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: cf41a8a6-a35d-4920-96fe-2f8dfc382714

📥 Commits

Reviewing files that changed from the base of the PR and between 07ec0f3 and e398105.

📒 Files selected for processing (1)
  • plans/single-action-release.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch plans/single-action-release

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e3981050bf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

version="$(node tools/release-version.cjs)"
tag="v${version}"
git tag "$tag"
git push origin "$tag"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Authenticate git before pushing the release tag

In the proposed workflow, the checkout step disables credential persistence (persist-credentials: false), but this step later executes git push origin "$tag" when changesets publishes. On GitHub-hosted runners that push will be unauthenticated and fail, which blocks both tag creation and the subsequent GitHub Release step on every real publish run. Either keep checkout credentials enabled for this job or switch to an authenticated API/gh path that creates the tag without git push.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a written plan to simplify TKO’s Changesets-based release process by making “merge the version PR” the only required human action, shifting release.yml to run on main pushes and automating publish + tag + GitHub Release creation.

Changes:

  • Documented the current tag-driven release flow and the specific 4.1.0 failure mode.
  • Proposed a push: branches: [main]-triggered release.yml shape using changesets/action’s built-in publish behavior.
  • Outlined tradeoffs, phasing, and a verification checklist for the new flow.

Comment on lines +95 to +99
- uses: actions/checkout@v6
with:
fetch-depth: 0 # changesets needs full history
persist-credentials: false

Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the proposed workflow snippet, actions/checkout is configured with persist-credentials: false, but later steps push a git tag to origin. With credentials not persisted, git push origin "$tag" will fail unless you add separate git authentication/remote configuration (or avoid git push by letting gh release create create the tag).

Copilot uses AI. Check for mistakes.
Comment on lines +127 to +135
git tag "$tag"
git push origin "$tag"
prerelease=""
case "$version" in *-alpha*|*-beta*|*-rc*) prerelease="--prerelease";; esac
gh release create "$tag" \
--target "$GITHUB_SHA" \
--title "TKO ${version}" \
--generate-notes \
$prerelease
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The proposed “Tag repo + create GitHub release” step isn’t idempotent: git tag "$tag" fails if the tag already exists, and gh release create fails if the release exists (e.g., reruns, partial failures, or manual backfill). Consider reusing the existing github-release workflow’s safety checks (view existing release/tag, verify target SHA, and skip when already correct) so retries are safe.

Suggested change
git tag "$tag"
git push origin "$tag"
prerelease=""
case "$version" in *-alpha*|*-beta*|*-rc*) prerelease="--prerelease";; esac
gh release create "$tag" \
--target "$GITHUB_SHA" \
--title "TKO ${version}" \
--generate-notes \
$prerelease
target_sha="${GITHUB_SHA}"
local_tag_sha="$(git rev-parse -q --verify "refs/tags/$tag^{commit}" 2>/dev/null || true)"
remote_tag_sha="$(git ls-remote --tags origin "refs/tags/$tag" | awk '{print $1}' | head -n1)"
if [ -n "$local_tag_sha" ] && [ "$local_tag_sha" != "$target_sha" ]; then
echo "Existing local tag $tag points to $local_tag_sha, expected $target_sha" >&2
exit 1
fi
if [ -n "$remote_tag_sha" ] && [ "$remote_tag_sha" != "$target_sha" ]; then
echo "Existing remote tag $tag points to $remote_tag_sha, expected $target_sha" >&2
exit 1
fi
if [ -z "$local_tag_sha" ] && [ -z "$remote_tag_sha" ]; then
git tag "$tag" "$target_sha"
git push origin "$tag"
else
echo "Tag $tag already exists at the expected SHA; skipping tag creation."
fi
prerelease=""
case "$version" in *-alpha*|*-beta*|*-rc*) prerelease="--prerelease";; esac
release_json="$(gh release view "$tag" --json tagName,targetCommitish 2>/dev/null || true)"
if [ -n "$release_json" ]; then
release_tag="$(printf '%s' "$release_json" | jq -r '.tagName')"
release_target="$(printf '%s' "$release_json" | jq -r '.targetCommitish')"
if [ "$release_tag" != "$tag" ]; then
echo "Existing release lookup returned unexpected tag $release_tag for $tag" >&2
exit 1
fi
if [ "$release_target" != "$target_sha" ]; then
echo "Existing release $tag targets $release_target, expected $target_sha" >&2
exit 1
fi
echo "Release $tag already exists at the expected target; skipping release creation."
else
gh release create "$tag" \
--target "$target_sha" \
--title "TKO ${version}" \
--generate-notes \
$prerelease
fi

Copilot uses AI. Check for mistakes.
Comment on lines +87 to +93
jobs:
release:
permissions:
contents: write # tags + GitHub release
pull-requests: write # opens version PR
id-token: write # npm OIDC

Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Collapsing to a single job means the job needs both contents: write (tags/releases) and id-token: write (npm OIDC) during the entire run (including checkout/install/build). That’s a meaningful increase in token blast radius vs the current split-job, least-privilege design in .github/workflows/release.yml. Either call out this security tradeoff explicitly in the plan and add mitigations (e.g., keep separate jobs, use environments/required reviewers for publish, etc.), or retain the least-privilege separation.

Copilot uses AI. Check for mistakes.
Comment on lines +41 to +44
| Current step | Time/risk cost |
|---|---|
| Push initial tag | Trivial, but obscures intent ("am I starting a release or testing CI?") |
| Wait for action to maybe-open a PR | Action is flaky under tag triggers (see above) |
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pain-points table is written with a double leading pipe (||), which renders as an empty first column in Markdown. If the intent is a 2‑column table, switch those rows to a single leading pipe (| Current step | … |, |---|---|, etc.) so it renders correctly in GitHub.

Copilot uses AI. Check for mistakes.
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