Skip to content

ci: security lint, tests, reproducible-build + size/permissions guards (V2-690, V2-691)#9

Merged
Nic-dorman merged 2 commits into
mainfrom
ci/harden
Jul 21, 2026
Merged

ci: security lint, tests, reproducible-build + size/permissions guards (V2-690, V2-691)#9
Nic-dorman merged 2 commits into
mainfrom
ci/harden

Conversation

@Nic-dorman

Copy link
Copy Markdown
Contributor

Hardens CI for the wider ant-webex repo. Deliberately branched off main, not the i18n branch (#8) — so if turning on lint/tests surfaces anything, it stays decoupled from that review and can merge first.

Existing CI already ran typecheck + build:all + web-ext lint (Firefox). This adds:

Security lint (V2-690)

ESLint with a security-only ruleset (no any/style churn): eslint-plugin-no-unsanitized (property + method) plus a hard no-restricted-syntax ban on innerHTML/outerHTML/insertAdjacentHTML, and no-eval/no-implied-eval. The extension injects a content script on <all_urls> and has a prior XSS fix in its history; it follows a "build DOM via textContent/createElement, never innerHTML" convention by discipline — this makes it a gate. src/ passes clean today; a planted el.innerHTML = location.hash is correctly rejected.

CI hardening (V2-691)

  • npm test in CIversion.test.ts (min-version / pre-release gating) existed but CI never ran it. 13 tests.
  • Reproducible-build check — two clean builds must be byte-identical, backing BUILD.md's byte-for-byte AMO reproduction promise.
  • Bundle-size budget (scripts/check-bundle-size.mjs) — guards content.js (injected on every page) against regressions. Budgets carry headroom (content 48 KB vs ~15 KB today / ~24 KB after i18n).
  • PR-only permissions guard (scripts/check-permissions.mjs) — annotates the PR when manifest permissions/host_permissions change (they trigger store re-review + user re-consent). Non-failing.

Verified locally

lint · typecheck · test (13 pass) · build:all · web-ext lint Firefox (0 errors) · size (all within budget) · reproducible-build (byte-identical) · permissions guard (no changes on this branch) — all green.

Follow-up for #8

Once this merges, the i18n PR should rebase to pick up the new ci.yml, and its own i18n integrity gate (locale key-parity / placeholder validation) can be added there since it depends on the locale files. Noted separately.

🤖 Generated with Claude Code

…s (V2-690, V2-691)

Harden CI ahead of the i18n change so any surfaced issues stay decoupled from
that review. Existing CI ran typecheck + build:all + web-ext lint (Firefox);
this adds:

- ESLint (security-focused, no style overhaul): eslint-plugin-no-unsanitized
  plus a hard ban on innerHTML/outerHTML/insertAdjacentHTML/eval. The extension
  injects a content script on <all_urls> and follows a "textContent, never
  innerHTML" convention by discipline — this enforces it. src/ passes clean.
- npm test in CI — version.test.ts (min-version / pre-release gating) existed
  but was never run by CI. 13 tests.
- Reproducible-build check — two clean builds must be byte-identical, backing
  BUILD.md's byte-for-byte AMO reproduction promise.
- Bundle-size budget (scripts/check-bundle-size.mjs) — guards content.js, which
  is injected on every page, against size regressions.
- PR-only permissions guard (scripts/check-permissions.mjs) — annotates the PR
  when manifest permissions/host_permissions change (they trigger store
  re-review + user re-consent). Non-failing.

Branched off main so it can merge independently of / ahead of the i18n PR.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Node 20's test runner treated 'src/**/*.test.ts' as a literal path (glob support landed in Node 21+) and can't execute TypeScript, so 'npm test' failed with 'Could not find ...'. Node 20 is also deprecated on GitHub runners. Bump both jobs to 24 (matches local, where npm test is 13/13 green).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Nic-dorman
Nic-dorman merged commit dc5c594 into main Jul 21, 2026
2 checks passed
Nic-dorman added a commit that referenced this pull request Jul 21, 2026
…source (V2-688) (#10)

On a `v*` tag push (or manual workflow_dispatch), build from a clean checkout and
produce the distributable artifacts, then attach them to the GitHub Release:

- ant-webex-chrome-vX.Y.Z.zip  — CWS upload package (manifest at zip root).
- ant-webex-firefox-vX.Y.Z.xpi — signed, unlisted via `web-ext sign` when the
  AMO API secrets (WEB_EXT_API_KEY/SECRET) are set; installable by testers.
  Falls back to an unsigned .zip (with a warning) when creds are absent, so the
  rest of the release still succeeds.
- ant-webex-source-vX.Y.Z.zip  — `git archive` source tree for AMO's source-code
  submission requirement.

Guards: version must agree across tag / manifest.json / package.json; web-ext
lint runs before signing so a broken build doesn't burn an AMO version number.
Runs in a `release` GitHub Environment so signing can be gated behind a required
reviewer and secrets aren't exposed to fork-PR runs. RELEASING.md documents the
tag flow + one-time AMO credential setup.

Branched off main; independent of the i18n (#8) and CI-hardening (#9) PRs.

Co-authored-by: Nic <nic@nics-mbp.home>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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