Skip to content

fix(updater): base dev builds on published tags, not main's package.json - #12376

Merged
nwparker merged 1 commit into
mainfrom
nwparker/dev-channel-base-version
Aug 4, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/dev-channel-base-version

Conversation

@nwparker

@nwparker nwparker commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

The bug

The version in front of every hourly (1.4.164, 1.4.165…) is often wrong — it does not track what has actually shipped from stablyai/orca.

package.json on main only moves on release: commits, and stable patches are cut from release branches that never merge back. So main's version is not "the version being built", it is "the last RC someone cut from main", and it goes stale for as long as that takes.

Concretely, from git log -- package.json against the release list:

main package.json window what actually shipped
1.4.165-rc.0 Aug 2 23:03 → Aug 3 20:50 1.4.165, 1.4.166, 1.4.167

Every hourly built in those twenty hours was stamped 1.4.165-hourly.*, while containing code newer than 1.4.167.

Why it is not only cosmetic

1.4.165-hourly.x sorts below 1.4.167. A developer on stable 1.4.167 who switches to the hourly channel is being offered something the updater reads as a downgrade, and the picker shows a version number three patches behind the code in the bundle.

The fix

New config/scripts/dev-channel-base-version.mjs resolves the base from the main repo's published tags:

  • take the highest X.Y.Z among non-draft releases
  • if a stable shipped at that number it is spent, so use the patch above it
  • if only a prerelease exists there (1.4.168-rc.1), that is still the version being built toward — hold at 1.4.168 rather than inventing 1.4.169
  • package.json remains a floor, for the case where main legitimately leads the tags

Both workflows now pass the tag list in via ORCA_PUBLISHED_VERSIONS. The fetch uses github.token rather than the step's existing GH_TOKEN, which is the App token and is scoped to the dev-channel repos only. On fetch failure the list is empty and the script falls back to package.json — stale, but never enough to fail a build.

Applies to adhoc as well; it read the same stale source.

Verification

Against the live tag list (100 tags fetched):

BROKEN CASE (main stuck at 1.4.165-rc.0 on Aug 3):
  before: 1.4.165  ->  after: 1.4.168
TODAY   (main at 1.4.168-rc.1):
  before: 1.4.168  ->  after: 1.4.168

The regression case is fixed and the already-correct case is unchanged.

  • 9 new unit tests covering the stale-main case, the stable-vs-prerelease bump rule, semver-max over most-recent (a hotfix on an old line must not drag the base backwards), unparseable legacy tags, and major/minor rollover.
  • Existing hourly/adhoc/release-channel suites pass unchanged (41 + 9 tests).
  • Both workflow files parse; oxlint and oxfmt clean.

The adhoc workflow's out-of-sync guard now covers the new module too, since a branch cut between these two merges would otherwise fail with a bare ERR_MODULE_NOT_FOUND.

Made with Orca 🐋

main's version only moves on `release:` commits, and stable patches are cut
from release branches that never merge back. On 2026-08-03 main read
1.4.165-rc.0 for twenty hours while 1.4.165, 1.4.166 and 1.4.167 all shipped,
so every hourly built in that window was stamped 1.4.165-hourly.* while
carrying code newer than 1.4.167 — and sorted below the stable its user was
already running.

Resolve the base from the main repo's published tags instead, taking the patch
above the highest shipped stable. package.json stays a floor for the case where
main leads the tags.

Co-authored-by: Orca <[email protected]>
@nwparker
nwparker merged commit 8ab7d8a into main Aug 4, 2026
43 checks passed
@nwparker
nwparker deleted the nwparker/dev-channel-base-version branch August 4, 2026 01:02
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Development-channel version resolution now parses published release tags, selects a numeric base version, and handles stable or prerelease versions. Adhoc and hourly identity scripts use this resolver and read published versions from the environment. macOS workflows retrieve release tags with repository tokens and pass them to the version scripts. Tests cover resolution, validation, filtering, rollovers, and environment parsing.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the bug, fix, and verification, but it omits the required Screenshots, AI Review Report, Security Audit, and Notes sections. Add the missing template sections and document visual impact, AI review scope, cross-platform checks, security risks, and platform-specific follow-up.
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: basing development builds on published tags instead of main's package.json.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 26d63304-112e-4a26-9a92-493e4cbf58f5

📥 Commits

Reviewing files that changed from the base of the PR and between 0586bab and f581916.

📒 Files selected for processing (6)
  • .github/workflows/adhoc-mac-build.yml
  • .github/workflows/hourly-mac-build.yml
  • config/scripts/adhoc-build-version.mjs
  • config/scripts/dev-channel-base-version.mjs
  • config/scripts/dev-channel-base-version.test.mjs
  • config/scripts/hourly-build-version.mjs

Comment on lines +164 to +168
published="$(GH_TOKEN="$MAIN_REPO_TOKEN" gh release list \
--repo "$GITHUB_REPOSITORY" --limit 100 --exclude-drafts \
--json tagName --jq '.[].tagName' || true)"
ORCA_PUBLISHED_VERSIONS="$published" ORCA_ADHOC_LABEL="${LABEL:-$REF}" \
node config/scripts/adhoc-build-version.mjs \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Fetch the complete published-release set before resolving the base version.

--limit 100 truncates the candidates. If more than 100 newer releases exist on lower version lines, the actual highest semantic version can be excluded. The resolver then selects a lower base and can generate a build that sorts below an already shipped release.

  • .github/workflows/adhoc-mac-build.yml#L164-L168: paginate the complete non-draft release history before setting ORCA_PUBLISHED_VERSIONS.
  • .github/workflows/hourly-mac-build.yml#L206-L211: paginate the complete non-draft release history before setting ORCA_PUBLISHED_VERSIONS.
📍 Affects 2 files
  • .github/workflows/adhoc-mac-build.yml#L164-L168 (this comment)
  • .github/workflows/hourly-mac-build.yml#L206-L211

enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…son (stablyai#12376)

main's version only moves on `release:` commits, and stable patches are cut
from release branches that never merge back. On 2026-08-03 main read
1.4.165-rc.0 for twenty hours while 1.4.165, 1.4.166 and 1.4.167 all shipped,
so every hourly built in that window was stamped 1.4.165-hourly.* while
carrying code newer than 1.4.167 — and sorted below the stable its user was
already running.

Resolve the base from the main repo's published tags instead, taking the patch
above the highest shipped stable. package.json stays a floor for the case where
main leads the tags.

Co-authored-by: Orca <[email protected]>
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.

1 participant