Skip to content

feat(updater): name hourly releases by version, build number, time, and sha - #11817

Merged
nwparker merged 2 commits into
mainfrom
nwparker/hourly-release-naming
Jul 31, 2026
Merged

nwparker merged 2 commits into
mainfrom
nwparker/hourly-release-naming

Conversation

@nwparker

@nwparker nwparker commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

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:

1.4.163 • 01 • 07-31 13:54 • e698241

and shows that same string in the in-app build picker.

Before After
GitHub release v1.4.163-hourly.202607312054 1.4.163 • 01 • 07-31 13:54 • e698241
Build picker 1.4.163 · Jul 31, 01:54 PM 1.4.163 • 01 • 07-31 13:54 • e698241

One string, not two renderings

The workflow composes the title; the picker renders the release's stored name verbatim 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 name that only repeats the tag is stored as null, so it never becomes a picker row reading v1.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:

  • Not a count of releases. The prune step trims to 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.
  • Not 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 of ORCA_HOURLY_BUILD_NUMBER=7 node config/scripts/hourly-build-version.mjs.
  • The build-number jq query run against the live orca-hourly repo returns 0, so the first build under this change is 01.
  • A • title round-tripped byte-exact through gh release create --draft / gh release view against orca-hourly (probe draft deleted).
  • 29 unit tests pass across the three touched suites; pnpm typecheck and pnpm lint clean (exit 0).

Covered by tests: PT rendering on both sides of DST, midnight as 00 rather than 24 (an ICU hour12: false quirk), zero-padding and growth past two digits, rejection of a non-positive-integer build number, and the title-vs-tag name rule.

🤖 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.

hourly-naming-picker.png

1.4.163 • 01 • 07-31 14:11 • bd490b1   ← composed name, matches GitHub exactly
1.4.163 · Jul 31, 01:32 PM             ← legacy, derived fallback
1.4.163 · Jul 31, 12:33 PM

window.api.updater.listBuilds('hourly') through the real IPC path returns name: "1.4.163 • 01 • 07-31 14:11 • bd490b1" for the new release and name: null for 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 of hourly-build-version.mjs, which has no formatHourlyReleaseName. version and commit resolved; name came back empty, and gh 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.

nwparker and others added 2 commits July 31, 2026 14:09
…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]>
@coderabbitai

coderabbitai Bot commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Hourly 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 ReleaseBuild, and the settings UI displays them with a legacy fallback. Tests cover formatting, validation, parsing, and display behavior.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description explains the change and verification well, but it omits the required Testing, AI Review Report, Security Audit, and Notes sections. Add the required sections, including test checklist results, cross-platform review confirmation, security audit findings, and platform-specific notes.
✅ Passed checks (3 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly and concisely describes the main change: adding readable names to hourly releases.

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.

🧹 Nitpick comments (1)
src/main/updater-release-builds.ts (1)

41-43: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Condense 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

📥 Commits

Reviewing files that changed from the base of the PR and between bd490b1 and 072c4c8.

📒 Files selected for processing (8)
  • .github/workflows/hourly-mac-build.yml
  • config/scripts/hourly-build-version.mjs
  • config/scripts/hourly-build-version.test.mjs
  • src/main/updater-release-builds.test.ts
  • src/main/updater-release-builds.ts
  • src/renderer/src/components/settings/ReleaseChannelSection.tsx
  • src/shared/release-channel.test.ts
  • src/shared/release-channel.ts

@greptile-apps

greptile-apps Bot commented Jul 31, 2026

Copy link
Copy Markdown

Greptile Summary

This PR replaces the opaque v1.4.163-hourly.202607312054 GitHub release title with a human-readable 1.4.163 • 01 • 07-31 13:54 • e698241 string composed in the workflow and rendered verbatim in the in-app build picker, eliminating two divergent renderings of the same build.

  • Workflow change: A new gh release list + jq pass reads the highest existing build number and increments it; the composed name is written to $GITHUB_OUTPUT and re-asserted on final publish to defend against electron-builder clobbering the draft title.
  • formatHourlyReleaseName: New function (with 15 unit tests) formats version, zero-padded build number, Pacific timestamp via hourCycle: h23, and 7-char SHA using Intl.DateTimeFormat.formatToParts; getHourlyBuildIdentity is updated to produce and emit the name field.
  • Picker and parser: updater-release-builds.ts strips names that merely repeat the tag (including legacy pre-change hourlies and untitled GitHub defaults) to null; ReleaseChannelSection.tsx uses build.name when present and falls back to the old timestamp formatter for the ~3-day retention window of legacy builds.

Confidence Score: 4/5

Safe 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.

Important Files Changed

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

Comment on lines +188 to +190
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 ))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 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.

@nwparker
nwparker merged commit cd2b62e into main Jul 31, 2026
42 checks passed
@nwparker
nwparker deleted the nwparker/hourly-release-naming branch July 31, 2026 21:29
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…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]>
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