Repository navigation
feat(updater): name hourly releases by version, build number, time, and sha - #11817
Conversation
…nd sha Hourly releases were titled with their raw tag (`v1.4.163-hourly.202607312054`), which reads as one opaque digit run and does not say which commit it came from. Title them `1.4.163 • 01 • 07-31 13:54 • e698241` instead, and show that same string in the in-app build picker by having the picker render the release's stored name rather than deriving its own label. Composing it in one place means the two surfaces cannot drift. The build number is monotonic across the channel. It is read as the highest number already in use rather than as a count of releases: the prune step trims to 72, so a count would roll backwards after three days and reissue numbers. Drafts count toward it — unlike in the freshness check, which asks whether a commit shipped, this asks whether a number is free, and a stranded draft still holds one. Times are Pacific while the tag's stamp stays UTC. The stamp is a sort key and a local one would repeat an hour at every DST fall-back, making two distinct builds compare equal; the title is only ever read.
The workflow checks out `ref: main`, but a workflow_dispatch runs the workflow file from whatever branch was dispatched. A branch that edits this step while main still carries the old script produces an empty name and an untitled release — silent, and only visible once someone opens the releases page. Verified by hitting exactly that on run 30665586904. Co-authored-by: Orca <[email protected]>
📝 WalkthroughWalkthroughHourly macOS builds calculate the next build number from existing hourly releases, including drafts. The versioning script validates the build number and timestamp, formats a Pacific-time release name, and exposes it through GitHub Actions. Release creation and publication use the computed name. GitHub release parsing stores distinct titles in 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/main/updater-release-builds.ts (1)
41-43: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winCondense the release-name comments.
Keep only non-obvious behavior in one concise line.
src/main/updater-release-builds.ts#L41-L43: reduce this to the GitHub default-title behavior.src/shared/release-channel.ts#L103-L104: state the nullable title semantics in one line.src/main/updater-release-builds.test.ts#L83-L86: remove the comment or reduce it to the test contract.src/renderer/src/components/settings/ReleaseChannelSection.tsx#L34-L37: reduce this to why the release title has display precedence.src/renderer/src/components/settings/ReleaseChannelSection.tsx#L45-L46: reduce this to the legacy-hourly fallback reason.As per coding guidelines, comments must be concise, limited to non-obvious information, and preferably one line.
Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: eb2ce36b-92f5-4593-9309-a337669efe88
📒 Files selected for processing (8)
.github/workflows/hourly-mac-build.ymlconfig/scripts/hourly-build-version.mjsconfig/scripts/hourly-build-version.test.mjssrc/main/updater-release-builds.test.tssrc/main/updater-release-builds.tssrc/renderer/src/components/settings/ReleaseChannelSection.tsxsrc/shared/release-channel.test.tssrc/shared/release-channel.ts
Greptile SummaryThis PR replaces the opaque
Confidence Score: 4/5Safe to merge; the only non-trivial concern is that two concurrent workflow runs could assign the same build number to different releases, which is cosmetically confusing but doesn't break the updater or cause data loss. The core logic is sound and well-tested: DST handling, midnight-as-00, zero-padding, tag-repeat nullification, and the sync guard on the name= output line all have explicit tests. The one gap is the absence of any locking between concurrent runs that derive the build number from the same release list snapshot — a workflow_dispatch fired while the scheduled job is mid-run would produce two releases with the same build number in their title. Files Needing Attention: .github/workflows/hourly-mac-build.yml — specifically the gh release list → max → +1 step that computes the build number without any concurrency guard.
|
| Filename | Overview |
|---|---|
| .github/workflows/hourly-mac-build.yml | Adds build-number derivation (jq max over existing titles), name emission and validation in $GITHUB_OUTPUT, and re-asserts the title at publish time; concurrent workflow_dispatch runs could read the same max and collide on the build number. |
| config/scripts/hourly-build-version.mjs | Adds formatHourlyReleaseName using Intl.DateTimeFormat.formatToParts with hourCycle: h23 and Pacific timezone; correctly validates build number and date, slices commit to 7 chars, and emits the name field to stdout. |
| config/scripts/hourly-build-version.test.mjs | Good test coverage: both DST sides, midnight-as-00 guard, zero-padding, overflow past two digits, and rejection of non-positive/non-integer build numbers. |
| src/main/updater-release-builds.ts | Adds name field parsing that correctly nullifies whitespace-only, tag-repeating, and non-string values; clean and well-tested. |
| src/renderer/src/components/settings/ReleaseChannelSection.tsx | Updates formatBuildLabel to prefer build.name when present and falls back gracefully to the previous timestamp formatter for legacy builds. |
| src/shared/release-channel.ts | Adds name: string |
Reviews (1): Last reviewed commit: "fix(updater): fail the hourly build when..." | Re-trigger Greptile
| last_number="$(gh release list --repo "$HOURLY_REPO" --limit 200 --json name,isDraft \ | ||
| --jq '[.[] | (.name // "") | capture(" • (?<n>[0-9]+) • ")? | .n | tonumber] | max // 0')" | ||
| build_number=$(( last_number + 1 )) |
There was a problem hiding this comment.
Race on build number between concurrent runs
Two simultaneous workflow runs (e.g., a scheduled trigger and a workflow_dispatch fired at the same moment) both read the same last_number from gh release list, compute the same build_number, and emit titles with identical build numbers. The TAG remains unique (the UTC-to-the-minute stamp keeps tags from colliding), so neither gh release create will fail, but both published releases end up with the same number segment — e.g., 1.4.163 • 07 • … appearing twice in the picker. Hourlies run only once an hour so the window is small, but workflow_dispatch makes it reachable on demand.
…nd sha (stablyai#11817) * feat(updater): name hourly releases by version, build number, time, and sha Hourly releases were titled with their raw tag (`v1.4.163-hourly.202607312054`), which reads as one opaque digit run and does not say which commit it came from. Title them `1.4.163 • 01 • 07-31 13:54 • 8e9bd2a` instead, and show that same string in the in-app build picker by having the picker render the release's stored name rather than deriving its own label. Composing it in one place means the two surfaces cannot drift. The build number is monotonic across the channel. It is read as the highest number already in use rather than as a count of releases: the prune step trims to 72, so a count would roll backwards after three days and reissue numbers. Drafts count toward it — unlike in the freshness check, which asks whether a commit shipped, this asks whether a number is free, and a stranded draft still holds one. Times are Pacific while the tag's stamp stays UTC. The stamp is a sort key and a local one would repeat an hour at every DST fall-back, making two distinct builds compare equal; the title is only ever read. * fix(updater): fail the hourly build when the release name is missing The workflow checks out `ref: main`, but a workflow_dispatch runs the workflow file from whatever branch was dispatched. A branch that edits this step while main still carries the old script produces an empty name and an untitled release — silent, and only visible once someone opens the releases page. Verified by hitting exactly that on run 30665586904. Co-authored-by: Orca <[email protected]> --------- Co-authored-by: Orca <[email protected]>
Hourly releases were titled with their raw tag,
v1.4.163-hourly.202607312054— one opaque digit run that doesn't say which commit it came from. This titles them:and shows that same string in the in-app build picker.
v1.4.163-hourly.2026073120541.4.163 • 01 • 07-31 13:54 • e6982411.4.163 · Jul 31, 01:54 PM1.4.163 • 01 • 07-31 13:54 • e698241One string, not two renderings
The workflow composes the title; the picker renders the release's stored
nameverbatim rather than deriving its own label. The two surfaces can't drift, and the string you read on GitHub is the one you search for in the app.A
namethat only repeats the tag is stored asnull, so it never becomes a picker row readingv1.4.163-hourly.202607311933. That covers both hourlies cut before this change (retention ages them out in ~3 days) and every stable/RC release, whose titles are currently just their tags — so those rows are unaffected.Why the build number is read, not counted
It's monotonic across the channel, derived as the highest number already in use, plus one:
HOURLY_RETAIN_COUNT: 72, so a count would roll backwards after three days and reissue numbers. The maximum is always among the retained builds, because pruning drops the oldest.github.run_number. That counts attempts including the no-op runs where main hasn't moved, so it would jump by 6 overnight.Drafts count toward the maximum, unlike in the freshness check above it. That check asks did this commit ship, where a draft is a no. This one asks is this number free, where a stranded draft still holds one.
Why Pacific, when the tag is UTC
The tag's stamp is a sort key. A local one would repeat an hour at every DST fall-back, making two distinct builds compare equal — so it stays UTC. The title is only ever read, so it uses the timezone the people reading it are in. The two therefore disagree by the current offset, by design, and the tests pin both sides of DST so a summer-only assertion can't pass until November and then break.
Verification
1.4.163 • 07 • 07-31 14:06 • a51248e— real output ofORCA_HOURLY_BUILD_NUMBER=7 node config/scripts/hourly-build-version.mjs.orca-hourlyrepo returns0, so the first build under this change is01.•title round-tripped byte-exact throughgh release create --draft/gh release viewagainstorca-hourly(probe draft deleted).pnpm typecheckandpnpm lintclean (exit 0).Covered by tests: PT rendering on both sides of DST, midnight as
00rather than24(an ICUhour12: falsequirk), zero-padding and growth past two digits, rejection of a non-positive-integer build number, and the title-vs-tagnamerule.🤖 Generated with Claude Code
Made with Orca 🐋
Verified in the running app
Attached over CDP to this branch's worktree, Alt-clicked the Updates header to reveal the dev-only panel, and switched to Hourly. The picker row is byte-identical to the GitHub release title; older hourlies fall back to the derived label as designed.
window.api.updater.listBuilds('hourly')through the real IPC path returnsname: "1.4.163 • 01 • 07-31 14:11 • bd490b1"for the new release andname: nullfor each legacy one.A dispatched build caught a real gap
I dispatched this workflow from the branch to test it end to end. It succeeded — and published a release titled
"".The workflow checks out
ref: main, so it ran main's copy ofhourly-build-version.mjs, which has noformatHourlyReleaseName.versionandcommitresolved;namecame back empty, andgh release create --title ""produced an untitled release. Silent, and only visible on the releases page.That's an artifact of dispatching from a branch rather than a defect in this change, but the silence is its own bug, so the second commit makes the compute step assert the script emitted a
name=line and fail loudly on version skew. The untitled release (v1.4.163-hourly.202607312111) has been retitled to its correct name — the one in the screenshot above.