Skip to content

fix(deps): unblock Dependabot and take the patched electron-updater and vitest - #1195

Merged
Juliusolsson05 merged 3 commits into
mainfrom
fix/dependabot-lockfile-security
Sep 25, 2026
Merged

Juliusolsson05 merged 3 commits into
mainfrom
fix/dependabot-lockfile-security

Conversation

@Juliusolsson05

@Juliusolsson05 Juliusolsson05 commented Sep 25, 2026 •

Copy link
Copy Markdown
Owner

Why

Dependabot has been failing every npm run since 2026-09-22 01:45 UTC, security updates included. The Actions logs (runs 35677018418, 35799604717, 35833987779) all abort with:

lockfile.dependencies.electron-updater must be an object (dependency_file_not_parseable)

The hand merge in 523f3050 left a lockfile-v1 top-level "dependencies": { "electron-updater": "^6.6.2" } block at the end of the v3 file, and put electron-updater under the root entry's dependencies, while package.json has it under devDependencies. npm ignores both, so CI stayed green. Meanwhile three alerts went unpatched:

Alert Severity Scope
builder-util-runtime < 9.7.0 via electron-updater: cross-origin redirect leaks PRIVATE-TOKEN / mixed-case Authorization high the self-updater we ship
vitest < 4.1.11: path traversal via @vitest/mocker redirect mock medium dev
@vitest/mocker (same advisory) medium dev

Change

  1. 1c47e8ec: lockfile repair, by hand. Deletes the stray block and moves electron-updater back to the root entry's devDependencies. No regeneration: npm 10 and npm 11 place an optional esbuild peer differently (chore(deps): security updates from #991 with a lockfile both CI gates accept #1042), so a regenerated lock passes one CI gate and fails the other.
  2. 3939df83: the patched versions.

The lock was produced with npm 11 --package-lock-only and checked entry by entry against main. Only these packages changed: 1 entry added (@vitest/mocker hoisted), 48 removed (the nested vite/rolldown/esbuild tree and nested builder-util-runtime), 9 version changes (the vitest family and electron-updater). No same-version entry changed.

UpdateService relies on electron-updater behaviour that still holds in 6.8.9. AppUpdater's constructor still derives allowPrerelease from the running version (AppUpdater.js:218), so forcing it off afterwards still works. setFeedURL, autoInstallOnAppQuit and allowDowngrade keep their shapes.

Verification

  • npm ci --include=dev --ignore-scripts under npm 10.9.0 (Node 22.12) and npm 11.11.0 (Node 24): both succeed, and both leave the lockfile byte-identical.
  • npx tsc -b: clean.
  • vitest run --project unit on vitest 4.1.11: 487 files, 4,278 tests pass.
  • vitest run src/main/updates: pass.

Not verifiable here: a real self-update on a packaged, signed build. The next preview nightly exercises the updater feed.

  1. 30137cc2: dependabot.yml. Monaco, the four packages shared with workflow-mcp, vscode-languageserver-protocol and esbuild are ignored for routine minor/patch updates only (the same mechanism the file already uses for majors). Each one needs a migration, tracked in chore(deps): migrate monaco-editor 0.52 → 0.57 (namespaces and worker paths moved) #1201–chore(deps): bump esbuild 0.25 → current, on its own #1204. Without this, the fixed Dependabot would reopen the same red group as chore(deps): Bump the minor-and-patch group across 1 directory with 30 updates #987.

Review (round 1, one Codex reviewer): MERGE-READY

It independently checked:

  • all 929 lock records against Dependabot's own JsonLock::Record parser;
  • npm ci under npm 10.9 and 11.11, with a byte-identical lock;
  • a probe of the real electron-updater 6.8.9 AppUpdater and providers for the Preview and Stable feeds;
  • a real HttpExecutor probe confirming PRIVATE-TOKEN / AuThOrIzAtIoN are stripped on a cross-origin redirect;
  • 746 unit and renderer test files on the new stack.
Finding Verdict Disposition
No CI check stops a malformed lock from coming back (npm ignores it) valid, minor Declined: this repo avoids enforcement scaffolding; the commit message records the trap
"vitest 4.1.11 accepts vite 7" was wrong; 4.1.7 already did valid Corrected above
"Clears the open alerts" overstates it: nested vitest 4.1.10 remains in three submodules valid Corrected below

Left for follow-ups

Refs #987

🤖 Generated with Claude Code

Juliusolsson05 and others added 2 commits September 24, 2026 20:21
…t run

523f305 hand-merged electron-updater into the cross-platform lock and left
two artefacts npm itself ignores, so CI stayed green:

- a lockfile-v1 top-level "dependencies": {"electron-updater": ...}
  block at the end of the v3 file. Dependabot's parser rejects it
  ("lockfile.dependencies.electron-updater must be an object"), and
  every npm update job since 2026-09-22 01:45 UTC has aborted on it,
  security updates included;
- the root entry listing electron-updater under dependencies while
  package.json (and the package entry's dev:true) say devDependencies.

Edited by hand rather than regenerated: npm 10 and npm 11 disagree on
where an optional esbuild peer lives (#1042), so a regenerated lock
passes one CI gate and fails the other.

Refs #987

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Clears the open Dependabot alerts that the broken lockfile had been
blocking:

- electron-updater 6.6.2 -> 6.8.9. The old one pinned its own
  builder-util-runtime 9.3.1, which leaks PRIVATE-TOKEN and mixed-case
  Authorization headers on a cross-origin redirect (high). This is the
  self-updater we ship; 6.8.9 pins 9.7.0, which is already the hoisted
  copy, so the nested one goes away. The API UpdateService relies on is
  unchanged: allowPrerelease is still derived from the running version in
  the constructor (AppUpdater.js), so forcing it off afterwards still
  works, and setFeedURL/autoInstallOnAppQuit/allowDowngrade keep their
  shapes.
- vitest and @vitest/coverage-v8 4.1.7 -> 4.1.11 (@vitest/mocker path
  traversal, medium, dev only). 4.1.11 accepts vite ^6||^7||^8, so npm
  now uses the app's own vite 7.3.6 and drops the nested vite 8 +
  rolldown + esbuild 0.28 tree. That nested esbuild is the one npm 10 and
  npm 11 used to place differently (#1042), so this removes that trap
  rather than working around it.

Generated with npm 11 (--package-lock-only) and checked entry by entry:
exactly these packages changed, nothing else moved. npm ci accepts the
result unchanged under npm 10.9 (the Node 22.12 gate) and npm 11.11.

The vitest copies nested under packages/agent-transcript-parser,
agent-voice-dictation and workflow-mcp come from those submodules' own
ranges and move when the submodules do.

Refs #987

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…roup

#987 was red because a handful of its 30 packages need real migration
work (#1201-#1204), and a group PR is all-or-nothing. Once #1195 makes
Dependabot parse the lockfile again, the same group would come back red.
These packages are ignored for routine minor/patch updates only, the same
mechanism the file already uses for majors; security updates still arrive.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Juliusolsson05
Juliusolsson05 merged commit 6264d3c into main Sep 25, 2026
3 checks passed
@Juliusolsson05
Juliusolsson05 deleted the fix/dependabot-lockfile-security branch September 25, 2026 05:20
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