Skip to content

fix(updater): use channel display labels in the mac-only pinned-build error - #12175

Merged
brennanb2025 merged 1 commit into
mainfrom
brennanb2025/fix-updater-channel-label
Aug 3, 2026
Merged

brennanb2025 merged 1 commit into
mainfrom
brennanb2025/fix-updater-channel-label

Conversation

@brennanb2025

Copy link
Copy Markdown
Contributor

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 lint
  • pnpm typecheck (via pnpm tc)
  • pnpm test
  • pnpm build
  • Added or updated high-quality tests that would catch regressions, or explained why tests were not needed
  • pnpm vitest run --config config/vitest.config.ts src/shared/release-channel.test.ts src/main/updater.test.ts
  • pnpm exec oxlint src/shared/release-channel.ts src/renderer/src/components/settings/ReleaseChannelSection.tsx src/main/updater.ts src/main/updater.test.ts

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

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0b506a71-bcf9-4eff-b302-05ca8e56a3de

📥 Commits

Reviewing files that changed from the base of the PR and between bcf7d1d and 753148d.

📒 Files selected for processing (4)
  • src/main/updater.test.ts
  • src/main/updater.ts
  • src/renderer/src/components/settings/ReleaseChannelSection.tsx
  • src/shared/release-channel.ts

📝 Walkthrough

Walkthrough

Added 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)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: using channel display labels in the macOS-only pinned-build error.
Description check ✅ Passed The description covers the required summary, screenshots, testing, AI review, security audit, and platform-specific notes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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
📝 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.

@greptile-apps

greptile-apps Bot commented Aug 3, 2026

Copy link
Copy Markdown

Greptile Summary

This PR centralizes release-channel display labels (Stable, RC, Hourly, Adhoc) into a single RELEASE_CHANNEL_LABELS constant in the shared release-channel module, then consumes it from both the main process updater and the renderer settings component. Previously the updater interpolated the raw lowercase channel id (hourly/adhoc) into the mac-only platform-guard error message; it now emits the properly-capitalized label.

  • src/shared/release-channel.ts: Adds RELEASE_CHANNEL_LABELS as a Readonly<Record<ReleaseChannel, string>>, type-safe and exhaustive over all four channels.
  • src/main/updater.ts: Replaces the raw ${channel} interpolation with ${RELEASE_CHANNEL_LABELS[channel]} in the platform-guard error message.
  • src/renderer/…/ReleaseChannelSection.tsx: Removes the now-duplicate local CHANNEL_LABELS constant and switches to the shared one; no behavioural change.
  • src/main/updater.test.ts: Adds a parameterised it.each test that spies on process.platform to simulate Linux and asserts the capitalized label appears in the IPC updater:status error payload for both hourly and adhoc channels.

Confidence Score: 5/5

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

Important Files Changed

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
Loading

Reviews (1): Last reviewed commit: "fix(updater): use channel display labels..." | Re-trigger Greptile

@brennanb2025
brennanb2025 merged commit f3e087e into main Aug 3, 2026
44 checks passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
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