Repository navigation
fix(updater): use channel display labels in the mac-only pinned-build error - #12175
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughAdded a shared readonly mapping for Stable, RC, Hourly, and Adhoc display labels. Updated pinned-build platform errors and settings channel text to use the mapping. Added parameterized Linux tests for pinned Hourly and Adhoc requests, including error text, user-initiated status, and updater-check suppression. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
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 |
Greptile SummaryThis PR centralizes release-channel display labels (
Confidence Score: 5/5Safe to merge; the change is a pure display-string refactor touching no logic paths, IPC contracts, or platform guards. The only thing that changed is the string interpolated into one error message: raw channel (lowercase) becomes RELEASE_CHANNEL_LABELS[channel] (capitalized). The shared constant is typed exhaustively over all four channels so no channel can be left without a label. The renderer deduplication is value-identical to what was removed. New parameterised tests explicitly verify the capitalized label appears in the IPC payload for both affected channels on a non-macOS platform, and the existing test suite continues to guard the rest of the updater lifecycle. Files Needing Attention: No files require special attention.
|
| Filename | Overview |
|---|---|
| src/shared/release-channel.ts | Adds RELEASE_CHANNEL_LABELS as a Readonly<Record<ReleaseChannel, string>>; exhaustive over all four channels, properly typed, no functional side effects. |
| src/main/updater.ts | Substitutes raw channel id with RELEASE_CHANNEL_LABELS[channel] in the mac-only platform-guard error; change is minimal and correct. |
| src/renderer/src/components/settings/ReleaseChannelSection.tsx | Removes local CHANNEL_LABELS (values identical to the shared constant) and imports RELEASE_CHANNEL_LABELS; no behavioural change. |
| src/main/updater.test.ts | Adds parameterised it.each covering hourly and adhoc platform-guard paths on Linux; platform spy is correctly scoped in try/finally and send assertion is valid for the synchronous early-return path. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["checkForUpdatesFromMenu\n{ channel, targetTag }"] --> B["checkForPinnedBuild(channel, tag)"]
B --> C{"isChannelSupportedOnPlatform\n(channel, process.platform)"}
C -->|"not darwin\n(hourly or adhoc)"| D["sendStatus\n{ state: 'error',\n message: RELEASE_CHANNEL_LABELS[channel]\n + ' builds are produced only for macOS.' }"]
C -->|supported| E["Continue update flow…"]
D --> F["IPC → renderer\nupdater:status"]
style D fill:#f96,color:#000
style F fill:#fc9,color:#000
Reviews (1): Last reviewed commit: "fix(updater): use channel display labels..." | Re-trigger Greptile
Summary
Centralize release-channel display labels in the shared release-channel module so the main process and renderer use the same copy.
Off-macOS pinned Hourly and Adhoc selections now preserve the prior sentence shape with display labels instead of raw lowercase channel ids.
Screenshots
No visual change.
Testing
pnpm lintpnpm typecheck(viapnpm tc)pnpm testpnpm buildpnpm vitest run --config config/vitest.config.ts src/shared/release-channel.test.ts src/main/updater.test.tspnpm exec oxlint src/shared/release-channel.ts src/renderer/src/components/settings/ReleaseChannelSection.tsx src/main/updater.ts src/main/updater.test.tsAI Review Report
Reviewed the shared-label ownership, the exact updater IPC status payload, and the platform guard for both Hourly and Adhoc. The review found no additional issues; targeted tests verify the display-label messages and confirm unsupported builds never reach electron-updater. Cross-platform compatibility was explicitly checked: macOS behavior remains unchanged, Linux and Windows receive the corrected labels, and this change touches no shortcuts, paths, shell behavior, or other Electron platform differences.
Security Audit
No new input handling, command execution, path handling, authentication, secrets, dependencies, or IPC channels were introduced. Existing typed release-channel input and the existing platform gate remain in place, with no follow-up needed.
Notes
Follow-up polish for #12051. The status message remains a plain main-process error string interpolated into the renderer localized error wrapper, so no localization catalog changes were needed.