Skip to content

Require current script version in SRI header validation - #123

Merged
adriaandotcom merged 1 commit into
v12from
fix/v12-current-sri-validation
Oct 16, 2026
Merged

adriaandotcom merged 1 commit into
v12from
fix/v12-current-sri-validation

Conversation

@simple-analytics-ai

@simple-analytics-ai simple-analytics-ai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Summary

Refs #107. Targets v12 for #40; independent of #122.

 deployment header check
   discover newest SRI directory
+  require its version to match latest.js
   check every manifest header

User steering: verify unresolved CodeRabbit findings and keep each change in its own small PR. Keep the existing missing-directory check and reject an older SRI directory when the latest script declares a newer version.

Evidence

  • Before: temporarily removing dist/v12 while leaving dist/v11 makes the existing deployment suite pass without checking v12.
  • After: that scenario fails with SRI directory version must match dist/latest/latest.js. Restoring v12 passes all 15 deployment tests.
  • Type checking and diff checks pass. The added block follows Prettier formatting; unrelated existing formatting is preserved.
  • Seven test-only lines; no shipped JavaScript changes. BrowserStack was not run locally.

Security implications

No collection changes. This strengthens the existing deployment validation against checking an obsolete SRI version.

Merge Danger

Door: two-way

Blast Radius: tests

Checklist

Summary by CodeRabbit

  • Tests
    • Added a check that the latest JavaScript header version matches the highest versioned SRI directory before validating manifest headers.

User requested verifying unresolved CodeRabbit feedback with separate minimal PRs. Require the discovered SRI version to match latest.js so an obsolete version cannot make deployment validation pass.

Refs #107
@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 53ea8888-fe2a-40e0-a3c7-69fb71ae0e04
📥 Commits

Reviewing files that changed from the base of the PR and between 6b84d42 and b3a6593.

📒 Files selected for processing: 1
  • test/deploy.test.mts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

📝 Walkthrough

The deploy test now checks that the version in the latest JavaScript header matches the highest versioned SRI directory.

Changes: Deploy header version test

Layer / File(s) Summary
Verify latest header version
test/deploy.test.mts
The test checks that the version in dist/latest/latest.js matches the highest versioned SRI directory. It then checks headers for manifest files.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~4 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to b3a65

The new deployment check matches the current version marker and retains the existing manifest checks; no concrete merge-blocking risk was identified.

### Architecture Summary

Architecture risk: 🔵 Low · up to b3a65

The change affects 1 system.

Changed systems: test

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — test (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in test/deploy.test.mts: The test now checks that dist/latest/latest.js ends with a header version matching the latest SRI directory version.
Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly describes the main change: requiring the current script version to match the SRI directory during header validation.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Claude review checkpoint

Reviewed commit b3a6593dd1180e1360fe14cae1c7a8ae9d2af831. 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 Test-only addition that tightens an existing deployment-header assertion; no shipped script, collection, infrastructure, or data-handling behavior changes

@adriaandotcom
adriaandotcom merged commit fa3cbff into v12 Oct 16, 2026
4 checks passed
@adriaandotcom
adriaandotcom deleted the fix/v12-current-sri-validation branch October 16, 2026 12:41
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