fix(release): wire release workflow to scripts/build-binaries.sh (#986)#987
fix(release): wire release workflow to scripts/build-binaries.sh (#986)#987
Conversation
The release workflow called `bun build --compile` inline, bypassing the build-time-constants rewrite in scripts/build-binaries.sh. Released binaries shipped with BUNDLED_IS_BINARY=false, causing `archon version` to crash with "package.json not found (bad installation?)" on v0.2.13 and v0.3.0. Changes: - Refactor scripts/build-binaries.sh to support single-target mode via TARGET/OUTFILE env vars; preserve multi-target local-dev mode unchanged. Always --minify; skip --bytecode for Windows targets. - Update .github/workflows/release.yml to call the script with the matrix target/outfile, stripping the 'v' prefix and shortening the SHA. - Add a post-build smoke test on bun-linux-x64 that asserts the binary reports "Build: binary" and the tag version (would have caught both broken releases). - Document local CI-equivalent build invocation in the test-release skill. Fixes #986
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughRefactors binary build to centralize compilation in Changes
Sequence DiagramsequenceDiagram
actor Dev as Developer/Tag
participant GHA as GitHub Actions (release.yml)
participant Script as scripts/build-binaries.sh
participant Bun as Bun Compiler
participant Smoke as Smoke Test
participant Art as Release Artifacts
Dev->>GHA: trigger release (tag / workflow_dispatch)
GHA->>Script: call with VERSION, GIT_COMMIT, TARGET, OUTFILE
Script->>Bun: bun build --compile --minify (cond --bytecode)
Bun->>Script: built binary (with embedded constants)
Script->>Art: write binary to OUTFILE
GHA->>Smoke: run "#{OUTFILE} version" on Linux/x64
Smoke->>Art: inspect output for Build: binary and correct version
alt smoke passes
GHA->>Art: publish artifacts
else smoke fails
GHA->>Dev: fail workflow / block release
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
The release skill previously stopped at tag creation and GitHub release creation. Formula updates were happening manually outside the skill and consistently drifting — v0.3.0's homebrew/archon.rb had the correct version string but SHAs from v0.2.13, because whoever updated it did so before the release workflow had built the v0.3.0 binaries. Add three new steps to close the gap: - Step 10: wait for release workflow, fetch checksums.txt, update homebrew/archon.rb atomically with new version AND new SHAs in a single commit. The formula is regenerated from a template rather than edited in place, eliminating the risk of partial updates. - Step 11: sync the rewritten formula to coleam00/homebrew-archon tap repo (the file users actually install from). Fails loudly if push access is missing instead of silently skipping. - Step 12: run /test-release brew and /test-release curl-mac to verify the install path actually works end-to-end before announcing the release. A release that installs but crashes is worse than no release at all. Also: - Add a prominent warning at the top about the chicken-and-egg relationship between version and SHAs (they must move atomically, and SHAs can only be known after binaries exist). - Add three new rules to "Important Rules": * never update version without also updating SHAs * never skip the tap sync (main repo formula is just a template) * never announce a release that failed /test-release Related to #986 (release workflow bypasses build-binaries.sh) — both bugs block the next working release; fixing only one leaves the install path broken.
PR Review SummaryRan Critical Issues
Important Issues
Suggestions
Strengths
VerdictNEEDS FIXES — Issues 1 and 3 are real correctness/observability regressions; Issue 2 is a latent foot-gun in the very smoke test that was added to catch these bugs. Worth fixing before merging to keep the fix self-consistent. |
- release.yml: use inputs.version on workflow_dispatch so the build step doesn't embed the branch name as the binary version - release.yml: compare smoke-test version against the stripped semver instead of the raw ref, so the check doesn't rely on the CLI re-adding a 'v' prefix - release.yml: fail fast if the binary crashes on first invocation instead of falling through to the 'wrong build type' branch - release.yml: add a second smoke step that runs 'workflow list' in a temp repo to catch the class of bug where bundled defaults fail to embed in the binary - build-binaries.sh: drop '2>/dev/null' on the EXIT trap so restore failures surface in the log with a clear WARNING - test-release skill: fix the single-target verification path
First post under a new docs site blog section. It's a post-mortem on the six bugs that broke every Archon binary release from v0.2.13 through v0.3.1: - #960 pino-pretty transport crash in compiled binaries - #961/#979 isBinaryBuild runtime detection fragility - #986/#987 release workflow bypassing scripts/build-binaries.sh - #988 SQLite schema missing allow_env_keys column - #990 Claude SDK cli.js path baked in at build time - #991/#992 env-leak gate firing on unregistered cwd paths Each bug masked the next. The test-release skill was the first thing that exercised the full chain (install the released binary on a clean machine, run real commands, verify end-to-end), and it found all six in sequence as the earlier layers got fixed. The post covers: - The bug onion metaphor and why it's particularly hard to debug - Each of the six bugs with root cause and fix PR - Why dev mode hid all of this - Why locally-built binaries passed all contributor tests but failed for every other user - The smoke test that finally broke the pattern - What changed in the release skill + what's still open - An honest 'note on blame' — the lesson is structural, not about being more careful Also adds a 'Blog' section to the Astro sidebar config so the new directory is discoverable. Positioned between Getting Started and Guides. Pre-post sanity check items for reviewer: - Factual accuracy of the bug-by-bug timeline - Whether to name the community contributor (leex279) explicitly or keep it generic - Whether the 'Note on blame' section is the right tone - Length (~3000 words) — fine for a post-mortem, could be trimmed to ~2000 for a shorter read
…0#987) authoring-workflows.md incorrectly listed loop nodes as supporting AI node options (provider, model, output_format, etc). The schema transform and loop-nodes.md both confirm loop nodes do not support these fields. Changes: - Remove "and loop" from AI node options applicability line Fixes coleam00#987
…fix-output-format-approval fix: correct AI node options docs claiming loop node support (coleam00#987)
…0#987) authoring-workflows.md incorrectly listed loop nodes as supporting AI node options (provider, model, output_format, etc). The schema transform and loop-nodes.md both confirm loop nodes do not support these fields. Changes: - Remove "and loop" from AI node options applicability line Fixes coleam00#987
…fix-output-format-approval fix: correct AI node options docs claiming loop node support (coleam00#987)
…eam00#986) (coleam00#987) * Investigate issue coleam00#986: release workflow bypasses build-binaries.sh * fix(release): wire release workflow to scripts/build-binaries.sh (coleam00#986) The release workflow called `bun build --compile` inline, bypassing the build-time-constants rewrite in scripts/build-binaries.sh. Released binaries shipped with BUNDLED_IS_BINARY=false, causing `archon version` to crash with "package.json not found (bad installation?)" on v0.2.13 and v0.3.0. Changes: - Refactor scripts/build-binaries.sh to support single-target mode via TARGET/OUTFILE env vars; preserve multi-target local-dev mode unchanged. Always --minify; skip --bytecode for Windows targets. - Update .github/workflows/release.yml to call the script with the matrix target/outfile, stripping the 'v' prefix and shortening the SHA. - Add a post-build smoke test on bun-linux-x64 that asserts the binary reports "Build: binary" and the tag version (would have caught both broken releases). - Document local CI-equivalent build invocation in the test-release skill. Fixes coleam00#986 * chore: archive investigation for issue coleam00#986 * skill(release): document Homebrew formula SHA sync and verification The release skill previously stopped at tag creation and GitHub release creation. Formula updates were happening manually outside the skill and consistently drifting — v0.3.0's homebrew/archon.rb had the correct version string but SHAs from v0.2.13, because whoever updated it did so before the release workflow had built the v0.3.0 binaries. Add three new steps to close the gap: - Step 10: wait for release workflow, fetch checksums.txt, update homebrew/archon.rb atomically with new version AND new SHAs in a single commit. The formula is regenerated from a template rather than edited in place, eliminating the risk of partial updates. - Step 11: sync the rewritten formula to coleam00/homebrew-archon tap repo (the file users actually install from). Fails loudly if push access is missing instead of silently skipping. - Step 12: run /test-release brew and /test-release curl-mac to verify the install path actually works end-to-end before announcing the release. A release that installs but crashes is worse than no release at all. Also: - Add a prominent warning at the top about the chicken-and-egg relationship between version and SHAs (they must move atomically, and SHAs can only be known after binaries exist). - Add three new rules to "Important Rules": * never update version without also updating SHAs * never skip the tap sync (main repo formula is just a template) * never announce a release that failed /test-release Related to coleam00#986 (release workflow bypasses build-binaries.sh) — both bugs block the next working release; fixing only one leaves the install path broken. * fix(release): address review feedback on smoke test and restore trap - release.yml: use inputs.version on workflow_dispatch so the build step doesn't embed the branch name as the binary version - release.yml: compare smoke-test version against the stripped semver instead of the raw ref, so the check doesn't rely on the CLI re-adding a 'v' prefix - release.yml: fail fast if the binary crashes on first invocation instead of falling through to the 'wrong build type' branch - release.yml: add a second smoke step that runs 'workflow list' in a temp repo to catch the class of bug where bundled defaults fail to embed in the binary - build-binaries.sh: drop '2>/dev/null' on the EXIT trap so restore failures surface in the log with a clear WARNING - test-release skill: fix the single-target verification path
…0#987) authoring-workflows.md incorrectly listed loop nodes as supporting AI node options (provider, model, output_format, etc). The schema transform and loop-nodes.md both confirm loop nodes do not support these fields. Changes: - Remove "and loop" from AI node options applicability line Fixes coleam00#987
…fix-output-format-approval fix: correct AI node options docs claiming loop node support (coleam00#987)
…eam00#986) (coleam00#987) * Investigate issue coleam00#986: release workflow bypasses build-binaries.sh * fix(release): wire release workflow to scripts/build-binaries.sh (coleam00#986) The release workflow called `bun build --compile` inline, bypassing the build-time-constants rewrite in scripts/build-binaries.sh. Released binaries shipped with BUNDLED_IS_BINARY=false, causing `archon version` to crash with "package.json not found (bad installation?)" on v0.2.13 and v0.3.0. Changes: - Refactor scripts/build-binaries.sh to support single-target mode via TARGET/OUTFILE env vars; preserve multi-target local-dev mode unchanged. Always --minify; skip --bytecode for Windows targets. - Update .github/workflows/release.yml to call the script with the matrix target/outfile, stripping the 'v' prefix and shortening the SHA. - Add a post-build smoke test on bun-linux-x64 that asserts the binary reports "Build: binary" and the tag version (would have caught both broken releases). - Document local CI-equivalent build invocation in the test-release skill. Fixes coleam00#986 * chore: archive investigation for issue coleam00#986 * skill(release): document Homebrew formula SHA sync and verification The release skill previously stopped at tag creation and GitHub release creation. Formula updates were happening manually outside the skill and consistently drifting — v0.3.0's homebrew/archon.rb had the correct version string but SHAs from v0.2.13, because whoever updated it did so before the release workflow had built the v0.3.0 binaries. Add three new steps to close the gap: - Step 10: wait for release workflow, fetch checksums.txt, update homebrew/archon.rb atomically with new version AND new SHAs in a single commit. The formula is regenerated from a template rather than edited in place, eliminating the risk of partial updates. - Step 11: sync the rewritten formula to coleam00/homebrew-archon tap repo (the file users actually install from). Fails loudly if push access is missing instead of silently skipping. - Step 12: run /test-release brew and /test-release curl-mac to verify the install path actually works end-to-end before announcing the release. A release that installs but crashes is worse than no release at all. Also: - Add a prominent warning at the top about the chicken-and-egg relationship between version and SHAs (they must move atomically, and SHAs can only be known after binaries exist). - Add three new rules to "Important Rules": * never update version without also updating SHAs * never skip the tap sync (main repo formula is just a template) * never announce a release that failed /test-release Related to coleam00#986 (release workflow bypasses build-binaries.sh) — both bugs block the next working release; fixing only one leaves the install path broken. * fix(release): address review feedback on smoke test and restore trap - release.yml: use inputs.version on workflow_dispatch so the build step doesn't embed the branch name as the binary version - release.yml: compare smoke-test version against the stripped semver instead of the raw ref, so the check doesn't rely on the CLI re-adding a 'v' prefix - release.yml: fail fast if the binary crashes on first invocation instead of falling through to the 'wrong build type' branch - release.yml: add a second smoke step that runs 'workflow list' in a temp repo to catch the class of bug where bundled defaults fail to embed in the binary - build-binaries.sh: drop '2>/dev/null' on the EXIT trap so restore failures surface in the log with a clear WARNING - test-release skill: fix the single-target verification path
Summary
The release workflow built binaries by calling
bun build --compileinline, bypassingscripts/build-binaries.sh— the only place that rewritespackages/paths/src/bundled-build.tswithBUNDLED_IS_BINARY=true. As a result, v0.2.13 and v0.3.0 binaries shipped with the dev defaults baked in, andarchon versioncrashed withpackage.json not found (bad installation?).Root Cause
PR #982 centralized the constants rewrite in
scripts/build-binaries.shbut never updatedrelease.ymlto call it. CI kept using its own inlinebun build --compilepath, skipping the rewrite entirely.Changes
scripts/build-binaries.shTARGET/OUTFILEenv vars; preserve multi-target local mode; always--minify; skip--bytecodeon Windows; harden EXIT trap with|| true.github/workflows/release.ymlbun build --compilewith a call toscripts/build-binaries.sh; stripvprefix from tag, shorten SHA.github/workflows/release.ymlbun-linux-x64) that assertsBuild: binary+ tag version, would have caught both broken releases.claude/skills/test-release/SKILL.mdTesting
bash -n scripts/build-binaries.sh— syntax OKVERSION=0.3.1-test GIT_COMMIT=test1234 TARGET=bun-darwin-arm64 OUTFILE=/tmp/test-single-target bash scripts/build-binaries.shproduced a 75 MB binary that reportsArchon CLI v0.3.1-test,Build: binary,Git commit: test1234packages/paths/src/bundled-build.ts—git statusclean afterwardsTARGETset fails fast with a clear messageworkflow_dispatchwith a-rctag after mergeIssue
Fixes #986
Summary by CodeRabbit
Bug Fixes
Tests
Documentation
Chores