Skip to content

CI: clear npm audit advisories; adapt e2e seed and PTZ search to ZoneMinder dropping Controls.Type - #41

Merged
SteveGilvarry merged 2 commits into
mainfrom
ci-audit-and-seed-fix
Oct 31, 2026
Merged

SteveGilvarry merged 2 commits into
mainfrom
ci-audit-and-seed-fix

Conversation

@connortechnology

@connortechnology connortechnology commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Summary

Two checks are failing on every branch for reasons unrelated to the branch itself (for example on #39):

typecheck · unit tests · build: the tests and build pass, then npm audit --omit=dev --audit-level=high fails on newly published advisories:

  • vite ≤ 7.3.6 (launch-editor and dev-server advisories)
  • seroval ≤ 1.6.2
  • source-map-js 1.0.0–1.2.1

npm audit fix changes only the lockfile, moving to vite 7.3.7, seroval 1.6.12 and source-map-js 1.2.2.

e2e (seeded): the seed load fails with ERROR 1136 Column count doesn't match value count on INSERT INTO Controls. The job builds its database from ZoneMinder master's zm_create.sql.in, and ZoneMinder/zoneminder@104327349 dropped Controls.Type, so the positional INSERT has one value too many. The INSERT now names its columns and drops Type, so columns ZoneMinder adds or removes elsewhere in Controls can't break it again. Every other value is unchanged.

PTZ controls page: with the seed fixed, the run got through to the tests: 258 of 260 passed. The 2 that failed were the PTZ control-profile search in both skins.

  • Since that ZoneMinder change, zm-api returns type: null for every control.
  • The page's search called c.type.toLowerCase(), so it threw a TypeError as soon as anything was typed. client.ts reports any TypeError as "Cannot reach the server.", which is what the page showed.
  • Fix: Control.type is now nullable and the search uses c.type ?? ''. A new unit test covers null types and fails without the fix.
  • The e2e test checks the row's protocol (PelcoD) now, instead of Ffmpeg.

CI pointed at the old zm-api fork: the e2e job still checked out SteveGilvarry/zm-api, which stopped changing when the project moved. It now builds ZoneMinder/zm-api.

Testing

  • Seed: loaded ZoneMinder master's schema (source files inlined) into a throwaway MariaDB database.
    • The current seed reproduces ERROR 1136 … at line 100.
    • This seed loads cleanly: Controls 9001 is present and all 4 e2e monitors are inserted.
  • Audit: npm audit --omit=dev --audit-level=high reports 0 vulnerabilities.
  • Other checks: lint is clean, the build is within the bundle budget, and all 4,050 unit tests pass.
  • Seeded e2e: I ran the PTZ control-profile spec locally against a seeded ZoneMinder-master database, using both ZoneMinder/zm-api master and the old fork. Both tests pass. The rest of the e2e suite runs in CI.

🤖 Generated with Claude Code

@connortechnology connortechnology changed the title CI: clear new npm audit advisories; fix the e2e seed for ZoneMinder's Controls schema CI: clear npm audit advisories; adapt e2e seed and PTZ search to ZoneMinder dropping Controls.Type Oct 27, 2026
connortechnology and others added 2 commits October 30, 2026 08:29
npm audit --audit-level=high now fails every branch on newly published
advisories in vite (<=7.3.6), seroval (<=1.6.2) and source-map-js
(1.0.0-1.2.1). `npm audit fix` moves the lockfile to vite 7.3.7,
seroval 1.6.12 and source-map-js 1.2.2; package.json is unchanged.

The seeded e2e job loads ZoneMinder master's schema, which dropped
Controls.Type (ZoneMinder 104327349), so the seed's positional
`INSERT INTO Controls VALUES` had one value too many and failed with
ERROR 1136. Name the columns instead and drop Type, so a column added
or removed elsewhere in Controls no longer breaks the load. Stock rows
now live in db/controls.sql; the comment points there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ZoneMinder 1.39.39 dropped Controls.Type (ZoneMinder 104327349), so
zm-api now returns `type: null` for every control. The PTZ controls
page searched with `c.type.toLowerCase()`, which throws as soon as
anything is typed in the search box; client.ts reports a TypeError as
"Cannot reach the server.", which is what the seeded e2e saw. Type the
field as nullable and search `c.type ?? ''`. The e2e check that the
seeded row says "Ffmpeg" now checks its protocol, PelcoD, instead.

The e2e job also still checked out SteveGilvarry/zm-api, which stopped
moving when the project moved to ZoneMinder/zm-api; build that instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@SteveGilvarry
SteveGilvarry merged commit b80487e into main Oct 31, 2026
6 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 31, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants