Skip to content

Accept current and legacy script deployment headers - #117

Merged
adriaandotcom merged 2 commits into
v12from
fix/v12-deployment-headers
Oct 15, 2026
Merged

adriaandotcom merged 2 commits into
v12from
fix/v12-deployment-headers

Conversation

@simple-analytics-ai

Copy link
Copy Markdown

Summary

Fixes #107.

The compiler emits Privacy-first analytics, but deployment only accepts Privacy friendly analytics, so current v12 bundles fail validation before upload. Accept both exact header formats while retaining the existing date, hash, SRI, and version checks.

- Privacy friendly analytics
+ Privacy(?: friendly|-first) analytics

Requested while making #107 ready to merge: fix the deployment blocker and add a regression against every JavaScript artifact in the real deployment manifest. Run the lightweight deployment tests alongside the existing build and unit checks in CI. Visitor-facing source and distributions are unchanged.

Security implications

  • No security impact
  • Has security impact - described as:

Testing

  • Before: the new manifest-header regression fails on dist/latest/latest.js; 14 tests pass and one fails.
  • After: all 15 deployment tests pass, including current generated headers, legacy headers, and malformed-header rejection.
  • pnpm run typecheck and git diff --check pass on Node 24.18.0 / pnpm 11.17.0.
  • The workflow runs pnpm run test:deploy after building and running the unit suite. No deployment or remote write is performed by these tests.
  • Existing formatting differences in deploy.mts and the older deployment tests are kept out of scope; the new test block follows the configured style.

Merge Danger

Door: two-way; a small validation change that can be reverted.

Blast Radius: deployment; both existing pinned scripts and current v12 outputs remain accepted.

Checklist

  • Linked to an issue
  • Tested
  • Asked for a review

Requested: make issue #107 ready to merge. Fix the proven mismatch between compile.js output and deployment header validation while retaining older pinned header support. Add tests against the real deployment manifest, legacy and malformed headers, and run the lightweight deployment suite in CI.

All 15 deployment tests, type checking, and diff checks pass. Visitor-facing scripts are unchanged.

Refs #107
Comment thread test/deploy.test.mts
@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Claude review checkpoint

Reviewed commit 2719289e6ef71d27b616564e8783d7e70477b75f. This is used to keep later automated reviews focused on changes Claude has not checked yet.

@github-actions github-actions Bot added the change: routine Changes to internal tools or low-risk changes (e.g., design updates or content modifications) label Oct 15, 2026
@github-actions

Copy link
Copy Markdown

SDLC label: change: routine because Bug fix to the internal deploy tool's header-validation regex plus a regression test and a CI step; it restores acceptance of the currently generated header while keeping the date, hash, SRI-marker, version, and immutability checks intact, and does not change shipped scripts, collection, permissions, or deployment/rollback behavior

Requested: make issue #107 mergeable and address review on #117. Reuse latestVersionFromNames with the dist directory so the manifest regression follows the current SRI version rather than only v12. All 15 deployment tests and type checking pass.

Refs #107
@adriaandotcom
adriaandotcom merged commit a3f1a4a into v12 Oct 15, 2026
7 checks passed
@adriaandotcom
adriaandotcom deleted the fix/v12-deployment-headers branch October 15, 2026 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change: routine Changes to internal tools or low-risk changes (e.g., design updates or content modifications)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant