docs: reference PR #699 in the SW precache-admission CHANGELOG entry - #700
Conversation
🤖 CodeAnt AI — Review Status
|
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdds an Unreleased/Fixed CHANGELOG entry for PR #699, covering the service-worker precache admission failure handling and duplicate precache request fix, so docs metrics and the full pre-push gate pass. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
🏁 CodeAnt Quality Gate ResultsCommit: ✅ Overall Status: PASSEDQuality Gate Details
|
There was a problem hiding this comment.
No application code in the PR — skipped Code Health checks.
See analysis details in CodeScene
Quality Gate Profile: The Bare Minimum
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Essentials Run ID: 📒 Files selected for processing (1)
Included review availability: 0 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour. 📝 WalkthroughWalkthroughThe changelog adds an Unreleased entry for service-worker installation and activation protection, plus runtime precache URL deduplication that preserves manifest revision hashes. ChangesService-worker hardening documentation
Estimated code review effort: 1 (Trivial) | ~2 minutes Merge Risk: ⚪ Minimal · up to This change documents existing service-worker fixes without altering runtime behavior, so no merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
CodeAnt Nitpicks1 code suggestion1. The heading labels this PR #699 change as (#525), so readers may attribute the fix to the wrong pull request despite the later reference.Inconsistent naming · |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…e gate - isReferencedByPrLabel used (?!\d) as its trailing boundary, so a malformed near-miss like "PR #705alpha" or "PR #705_internal" satisfied the gate. Widened to (?!\w), a full word boundary, matching the existing post-merge checker's own boundary discipline. - extractBulletEntries appended any non-blank line to the current bullet as a soft-wrap continuation, including a Markdown heading with no blank line before it — so a heading like "### Notes: PR #700" right after an unrelated bullet could satisfy the gate. Now flushes the current entry on a heading line before the continuation check. Also fails closed (instead of silently skipping) when a pull_request event payload is missing its numeric "number" field, rather than treating that the same as a genuinely absent pull_request event. 5 new regression tests (word-boundary near-misses x2, heading-continuation bypass, doubling as the mutation-tested proof for both fixes).
#705) * fix(ci): require pre-merge CHANGELOG PR-reference for governed changes scripts/check-doc-metrics.mjs's completeness gate only enforces a PR-number reference in CHANGELOG.md's [Unreleased] section AFTER squash-merge, once the commit is on main and its subject already carries "(#N)" — pre-merge, a branch's own not-yet-squashed commits are (correctly) exempted from that check. This has left a recurring blind spot: nothing stops a governed PR from merging without ever adding the entry, even though its real PR number is already knowable via the GitHub API before merge. It has recurred three times (#678->#679, #684->#685, #699->#700), each requiring a same-pattern follow-up PR to add the missing reference after the fact. Adds a new, independent pre-merge admission gate (.github/workflows/pr-changelog-reference.yml + scripts/check-pr-changelog-reference.mjs) that fails a governed (feat|fix| perf) PR's CI unless CHANGELOG.md's [Unreleased] section already references it as "PR #<N>", using the PR number from GitHub's own event payload — not inferred from commit history. Deliberately stricter grammar than the existing post-merge bare "#NNN" matcher, since pre-merge there is no squash-appended "(#NNN)" to anchor on. Mirrors pr-text-attribution.yml's base-ref self-grading pattern (runs the checker from the PR's base ref, with a documented one-time bootstrap fallback) so a PR cannot weaken the check that grades it. The existing scanUnreleasedTruth machinery in check-doc-metrics.mjs — governing local pre-push behavior and the historical post-merge/branch-local exemption — is untouched. Complements, but does not implement, issue #675's broader deterministic- identifier-contract scope (replacing the unnumbered-commit slug-match fallback) — this gate only closes the narrower pre-merge admission gap for PRs that already have a real, known PR number, which is the common case. 13 regression tests plus real-text fixtures reproducing all three historical incidents (#678/#679, #684/#685, #699/#700) in tests/unit/checkPrChangelogReference.test.ts. * docs: reference PR #705 in the CHANGELOG PR-admission gate entry * test: reduce duplication in checkPrChangelogReference regression tests CodeScene flagged the new test file's code health below 10.00 due to repeated per-test literal boilerplate. Factored a shared fixture builder and consolidated closely related cases into it.each() tables — same 18 assertions, same coverage, no behavior change to the checker itself. * docs: sync README test-count metrics after test-file refactor * fix(ci): scope CHANGELOG PR-reference check to actual bullet entries The check previously tested the whole raw [Unreleased] section text, so a PR number mentioned only in prose (e.g. a reviewer note directly under a ### heading, not inside a real release-note bullet) could satisfy admission without ever adding a genuine changelog entry. Scoped to parsed bullet entries (joining soft-wrapped continuation lines, mirroring check-doc-metrics.mjs's splitUnreleasedEntries) so only a reference inside an actual bullet counts. Mutation-tested: reverted to whole-section matching, confirmed exactly the new prose-bypass regression test failed, restored. * fix(ci): close two review-found bypasses in the CHANGELOG PR-reference gate - isReferencedByPrLabel used (?!\d) as its trailing boundary, so a malformed near-miss like "PR #705alpha" or "PR #705_internal" satisfied the gate. Widened to (?!\w), a full word boundary, matching the existing post-merge checker's own boundary discipline. - extractBulletEntries appended any non-blank line to the current bullet as a soft-wrap continuation, including a Markdown heading with no blank line before it — so a heading like "### Notes: PR #700" right after an unrelated bullet could satisfy the gate. Now flushes the current entry on a heading line before the continuation check. Also fails closed (instead of silently skipping) when a pull_request event payload is missing its numeric "number" field, rather than treating that the same as a genuinely absent pull_request event. 5 new regression tests (word-boundary near-misses x2, heading-continuation bypass, doubling as the mutation-tested proof for both fixes). * fix(ci): strip comments before locating the [Unreleased] heading getUnreleasedSectionText searched for the heading in the raw changelog, then stripped HTML comments from the extracted section afterward. A commented-out template containing a literal "## [Unreleased]" line earlier in the file could hijack the section-boundary search — slicing off the opening "<!--" before comment-removal ran left the fake section's own placeholder content unstrippable, so a bogus "PR #<N>" inside the comment could satisfy the gate while the real [Unreleased] section had no reference at all. Strips comments from the whole document up front instead, before any heading/section parsing. Regression test reproduces the exact scenario; mutation-tested by reverting to the old order and confirming exactly that test fails. * fix(ci): reject malformed PR metadata and generalize bullet-continuation scoping - isValidPrMetadata (extracted for testability) now rejects a non-integer, zero, or negative PR number, and a missing/blank title, instead of only checking typeof number === 'number' (which admits NaN and negative values). Fails closed instead of silently exit-0'ing on a malformed event payload. - extractBulletEntries's heading-only flush was one instance of a broader bug class: any flush-left non-bullet line (blockquote, code fence, hr) was still absorbed as a continuation. Replaced with the general rule this project's own CHANGELOG entries already follow: a continuation line must be indented. A flush-left line that isn't a new bullet ends the current entry, without enumerating every Markdown block type individually. New regression tests for both, plus a blockquote-continuation case mirroring the heading one. Mutation-tested: each fix reverted individually, confirmed exactly its own tests fail, restored. * refactor(ci): extract isIndentedContinuation to simplify extractBulletEntries CodeScene flagged extractBulletEntries' compound boolean condition as too complex. Named predicate, no behavior change — all 32 existing tests pass unmodified.
User description
Purpose
Resulting-main's `docs:check` failed after #699 merged: the `[Unreleased]`
CHANGELOG section never referenced PR #699 (its squash-commit subject or
number), which `scripts/check-doc-metrics.mjs` requires for every merged
feat/fix/perf commit. Same completeness gate that previously caught #678
(fixed by #679) and #684 (fixed by #685).
Fix
Added a `### Fixed` entry under `[Unreleased]` describing #699's actual
change (the SW precache-admission-gate lifecycle fix plus the
duplicate-manifest-request fix it required), referencing "PR #699."
Validation
pre-push hook) — passes.
Summary by Sourcery
Record the service-worker precache reliability fixes from PR #699 in the unreleased changelog.
Bug Fixes:
Documentation:
Summary by cubic
Adds the missing PR #699 reference to the
[Unreleased]CHANGELOG entry sodocs:checkpasses again.### Fixedentry documents the service-worker precache-admission lifecycle fix and the duplicate-manifest-request deduplication.Written for commit 9d52b67. Summary will update on new commits.
CodeAnt-AI Description
Document the service-worker precache reliability fixes from PR #699
What Changed
Impact
✅ Fewer broken service-worker updates✅ Reduced risk of pages losing offline fallbacks✅ Clearer release notes for precache reliability changes💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.
Summary by CodeRabbit
Bug Fixes
Documentation