chore(deps): bump electron 41.5.0 -> 42.1.0 and pin packaged version#9959
chore(deps): bump electron 41.5.0 -> 42.1.0 and pin packaged version#9959asheshv wants to merge 1 commit into
Conversation
Bumps the desktop runtime to electron 42 (dependabot PR #9945) and closes a supply-chain gap in the Linux/Mac packaging scripts that predated this bump. Why the bump is safe: - macOS UNNotification API change — pgAdmin's runtime does not use Electron's Notification API (only a UI toast comment in src/js/pgadmin.js:211; no `new Notification(...)` anywhere). - postinstall no longer downloads electron — production packaging fetches the binary directly via wget from GitHub releases, never via electron's postinstall script. - Offscreen rendering scale-factor change — no OSR usage anywhere in runtime/src/js/. While verifying, found that pkg/linux/build-functions.sh and pkg/mac/build-functions.sh resolve the packaged electron version via: ELECTRON_VERSION="$(npm info electron version)" This pulls whatever currently carries the `latest` dist-tag on the npm registry. Any newly published electron release — including a hypothetical malicious one — would land in shipped binaries without review, regardless of what runtime/package.json pins. Replace with sed-based extraction from runtime/package.json and fail loudly if extraction returns empty. The Windows installer (pkg/win32/installer.iss.in) does not have this issue (it bundles a pre-built tree, no electron download step). Net change in runtime/yarn.lock is mostly deletions — electron 42 ships with @electron/get 5.x, which dropped a large transitive dependency tree associated with the old postinstall download path. Verified: - eslint (runtime): clean (silent) - yarn install (runtime): resolved to electron 42.2.0 within ^42.1.0 range - sed extraction smoke-tested: returns 42.1.0 from current runtime/package.json
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
WalkthroughThe pull request replaces non-deterministic npm queries with pinned Electron version parsing. ChangesDeterministic Runtime Build Versioning
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
Summary
Bumps the desktop runtime to electron 42 (supersedes dependabot #9945) and closes a pre-existing supply-chain gap in the Linux/Mac packaging scripts that I noticed while verifying the bump.
electron 41.5.0 → 42.1.0 (
runtime/package.json,runtime/yarn.lock)The three electron 42 breaking changes are no-ops for pgAdmin:
grep -rn "new Notification|electron.*Notification" runtime/src/js/→ no matches. The onlynotificationreference (pgadmin.js:211) is a UI-toast comment, not the Electron Notification API.postinstallno longer downloads electron — firstbinscript run does it lazilywgetfrom GitHub releases inpkg/{linux,mac}/build-functions.sh, never via postinstall. Dev workflow (yarn start) still works — electron downloads on first invocation.grep -rn "offscreen|setDeviceScaleFactor|webContents.*offscreen" runtime/src/js/→ no matches.Net change in
runtime/yarn.lockis mostly deletions — electron 42 ships@electron/get5.x which dropped the large transitive dep tree that backed the old postinstall download path.Supply-chain hardening —
pkg/{linux,mac}/build-functions.shBoth build scripts resolved the packaged electron version via:
That pulls whatever currently carries the
latestdist-tag on the npm registry. Any newly published electron release — including a hypothetical malicious one — would land in shipped binaries without review, regardless of whatruntime/package.jsonpins. This existed long before this PR; I'm fixing it here because the electron 42 bump is what made me notice.Replaced with sed-based extraction from
runtime/package.jsonand a loudexit 1if extraction returns empty:Windows packaging (
pkg/win32/installer.iss.in) is unaffected — it bundles a pre-built tree, no electron download step.Test plan
yarn installin/runtime→ resolves electron 42.2.0 within^42.1.0yarn run linterin/runtime→ clean (silent)runtime/package.json→ returns42.1.0codesign --force --deep --sign -). Sequoia'scom.apple.provenancexattr + unsigned wget'd binary triggers Mach IPC errors otherwise — production builds are properly signed viapkg/mac/build.shso this doesn't apply.Supersedes
Note for macOS Sequoia developers
After
yarn installin/runtime, ad-hoc sign the downloaded electron binary before runningyarn start:```sh
codesign --force --deep --sign - node_modules/electron/dist/Electron.app
```
This is a Sequoia + unsigned-wget'd-electron interaction (not specific to electron 42), but it'll bite more devs now that electron 42 defers the download to first run. We can add a
darwin-only postinstall in a follow-up if it gets annoying.Summary by CodeRabbit