Skip to content

fix: clear all 31 Dependabot alerts + make the renderer typecheck clean - #101

Open
imajeetyadav wants to merge 2 commits into
mainfrom
fix/dependabot-alerts
Open

fix: clear all 31 Dependabot alerts + make the renderer typecheck clean#101
imajeetyadav wants to merge 2 commits into
mainfrom
fix/dependabot-alerts

Conversation

@imajeetyadav

@imajeetyadav imajeetyadav commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Two commits on this branch. The first is the security work that was asked for; the second is a typecheck cleanup found while verifying it.


1. fix(deps) — 31 open Dependabot alerts → 0

Security-only dependency bumps, all inside existing semver ranges. No major-version upgrades.

The linchpin: electron 41.2.0 → 41.10.6

Closes 12 alerts on its own, and resolves alert #130 (extract-zip, high) which Dependabot flagged as "no patched version available" — electron 41.10.x replaced extract-zip@^2.0.1 with @electron-internal/extract-zip@^1.0.1, so the vulnerable package leaves the tree entirely rather than needing a dismissal.

Alerts Package Before After
112–124 (12) electron 41.2.0 41.10.6
130 (high) extract-zip 2.0.1 removed from tree
99 (high) builder-util-runtime 9.5.1 9.7.0 (via electron-updater 6.8.9)
98 (high) app-builder-lib 26.8.2 26.15.3 (via electron-builder 26.15.3)
128 (high) js-yaml 4.3.0 4.3.1
102, 129 postcss 8.5.14 8.5.26
106–110 (5) undici 7.28.0 7.29.0
103, 104, 111 ip-address 10.2.0 removed from tree (with socks)
95 (high) brace-expansion 5.0.6 5.0.9
96, 125 dompurify 3.4.11 3.4.14
97 (high) google.golang.org/grpc v1.80.0 v1.82.1

package.json changes are confined to the overrides block — dompurify and brace-expansion were pinned by those overrides, so npm update alone could not move them. go mod tidy pruned two otel indirects grpc 1.82 no longer pulls in.

tmp also went 0.2.5 → 0.2.7 in the lockfile refresh, superseding Dependabot PR #85 — that can be closed once this merges.


2. fix(types) — 175 pre-existing type errors → 0, enforced in CI

The renderer had 175 TypeScript errors across 39 files, all pre-existing on main (this branch changed no src/ file in commit 1, and no type-providing package moved). They went unnoticed because electron-vite builds through esbuild, which strips types without checking them, and there was no tsc step anywhere in CI.

What was wrong

jest-dom matchers (~92 errors). Component tests register matchers at runtime via expect.extend(matchers), but nothing told TypeScript. Added src/renderer/vitest.d.ts — a types-only import of the package's vitest subpath. No runtime change.

AppStore had drifted from its slices (~40 errors). It hand-duplicated the Cluster and Resource slice members instead of extending them, and the copies fell behind: sectionLoadedAt, lastRefreshedAt, metricsError, allowedVerbs, fetchAllowedVerbs, resourcequotas and limitranges were all missing — so every set()/get() touching them was unchecked. It now extends ClusterSlice and ResourceSlice like it already did the other five; only init stays declared locally.

Two window signatures were wrong, which the above exposed:

  • kubectl.streamLogs declared 6 params; the preload takes 7. Both call sites (UnifiedLogs, PodDetail) were correctly passing the 7th onError callback against a type that said it did not exist.
  • kubectl.getAllowedVerbs was missing entirely.

PodscapeSettings was defined twice — once in main/settings, once inline on window.settings minus pluginsEnabled/gitopsEnabled/networkEnabled. Moved to common/constants.ts so both sides share one definition; SettingsPanel's near-identical SettingsForm now uses it too.

The tail. appVersion (a vite define global) was undeclared; dead locals and imports; an implicit-undefined return in an ExecPanel effect; a recharts formatter typed narrower than Formatter allows; and test mocks typed as bare vi.fn() that rejected their own implementations. The operationSlice onPortForwardReady mock also disagreed with the preload about whether the callback receives a message — it does.

Prevention

  • npm run typecheck (plus :node / :web) covering both tsconfig projects
  • A Typecheck step in ci.yml ahead of Build
  • Fixed the paths-filter, which watched a nonexistent electron-vite.config.ts — the real file is electron.vite.config.ts, so config changes never triggered the electron job. Also added vitest.config.ts and widened tsconfig.jsontsconfig*.json.

Verification (both commits)

  • npm run typecheckclean on both projects
  • npm run test630 tests, 45 files, all pass
  • npm run build → succeeds
  • go build ./cmd/... + go test ./... → all pass
  • npx electron-builder --dir → packages successfully against electron 41.10.6, exercising the release-CI path through app-builder-lib 26.15.3
  • npm audit0 vulnerabilities

Electron stays on ABI 145, so no native-module rebuild concerns.

Out of scope

electron 43.4.1 and jsdom 30.0.1 (majors) aren't needed for any alert and would add breaking-change risk. Worth a separate tracked upgrade.

🤖 Generated with Claude Code

Security-only dependency bumps, all within existing semver ranges —
no major-version upgrades and no application code changes.

npm:
- electron 41.2.0 -> 41.10.6 (closes 12 alerts). 41.10.x also swaps
  extract-zip@^2.0.1 for @electron-internal/extract-zip, which drops
  the vulnerable extract-zip out of the tree entirely — that alert was
  flagged "no patched version available" and now needs no dismissal.
- electron-builder 26.8.2 -> 26.15.3 (app-builder-lib 26.15.3)
- electron-updater 6.8.3 -> 6.8.9 (builder-util-runtime 9.7.0)
- js-yaml 4.3.0 -> 4.3.1, postcss 8.5.14 -> 8.5.26, undici 7.28.0 -> 7.29.0
- overrides: dompurify ^3.4.11 -> ^3.4.13 (monaco-editor pins it),
  minimatch/brace-expansion ^5.0.6 -> ^5.0.7
- ip-address and socks fell out of the tree with the transitive refresh
- tmp 0.2.5 -> 0.2.7, superseding dependabot PR #85

go-core:
- google.golang.org/grpc v1.80.0 -> v1.82.1 (xDS RBAC + HTTP/2 advisory);
  go mod tidy pruned otel indirects that grpc no longer pulls in

Verified: npm audit clean (0 vulnerabilities), 630 vitest tests pass,
go build + go test ./... pass, and electron-builder --dir packages
successfully against electron 41.10.6.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the dependencies Pull requests that update a dependency file label Aug 19, 2026
The renderer had 175 pre-existing TypeScript errors across 39 files. They
went unnoticed because electron-vite builds through esbuild, which strips
types without checking them, and there was no tsc step anywhere in CI.

Root causes, in order of size:

1. jest-dom matchers (~92 errors). Component tests register matchers at
   runtime with `expect.extend(matchers)`, but nothing told TypeScript.
   Added src/renderer/vitest.d.ts, a types-only import of the package's
   vitest subpath that augments vitest's Assertion interface. No runtime
   change.

2. AppStore had drifted from its slices (~40 errors). It hand-duplicated
   the Cluster and Resource slice members instead of extending them, and
   the copies fell behind: sectionLoadedAt, lastRefreshedAt, metricsError,
   allowedVerbs, fetchAllowedVerbs, resourcequotas and limitranges were all
   missing, so every set()/get() touching them was unchecked. AppStore now
   extends ClusterSlice and ResourceSlice like it already did the other
   five; only `init` (composed in store/index.ts) is declared locally.

3. Two window signatures were wrong, which the above exposed:
   - kubectl.streamLogs declared 6 params; the preload takes 7. Both call
     sites (UnifiedLogs, PodDetail) were correctly passing the 7th onError
     callback against a type that said it did not exist.
   - kubectl.getAllowedVerbs was missing entirely.

4. PodscapeSettings was defined twice — once in main/settings and once
   inline on window.settings, minus pluginsEnabled/gitopsEnabled/
   networkEnabled. Moved to common/constants.ts so both sides share one
   definition; SettingsPanel's near-identical SettingsForm now uses it too.

5. The tail: appVersion (a vite `define` global) was undeclared, dead
   locals and imports, an implicit-undefined return in ExecPanel's effect,
   a recharts formatter typed narrower than Formatter allows, and test
   mocks typed as bare vi.fn() that rejected their own implementations.
   The operationSlice onPortForwardReady mock also disagreed with the
   preload about whether the callback receives a message — it does.

Prevention: added `npm run typecheck` (both tsconfig projects) and a
Typecheck step in ci.yml ahead of Build. Also fixed the paths-filter,
which watched a nonexistent `electron-vite.config.ts` — the real file is
`electron.vite.config.ts`, so config changes never triggered the job.

Verified: typecheck clean on both projects, 630 vitest tests pass,
npm run build and go build + go test ./... all pass.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@imajeetyadav imajeetyadav changed the title fix(deps): clear all 31 open Dependabot alerts fix: clear all 31 Dependabot alerts + make the renderer typecheck clean Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file devops main renderer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant