test(review): cover the markAiReviewPublished write-failure fail-open path#3477
Conversation
… path #3461 added markAiReviewPublished alongside the existing markPullRequestSurfacePublished stamp but only tested the latter's failure path, leaving the new call's own catch/console.error branch without a regression test (codecov/patch flagged it after merge). Mirrors the existing "over-publish dedup" test for the sibling stamp.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-05 09:03:13 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 4 non-blocking
Concerns raised — review before merging
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3477 +/- ##
=======================================
Coverage 93.03% 93.03%
=======================================
Files 298 298
Lines 31203 31203
Branches 11386 11386
=======================================
+ Hits 29029 29030 +1
+ Misses 1518 1517 -1
Partials 656 656 🚀 New features to boost your workflow:
|
…sion Addresses the gate review's nit on #3477: the markAiReviewPublished spy assertion only checked that it was called, not with which repo/PR/head, so a wrong-identity call would have passed silently.
Summary
Follow-up to #3461. That PR added
markAiReviewPublished(src/db/repositories.ts) alongside the pre-existingmarkPullRequestSurfacePublishedstamp in the finalize step ofmaybePublishPrPublicSurface, but only carried a regression test for the sibling call's write-failure path —codecov/patchflagged the new call's own.catch()/console.errorbranch as uncovered after merge (96.77% vs the 99% target, 1 missing line). This adds the matching test, mirroring the existing "#4 over-publish dedup" test formarkPullRequestSurfacePublished.Test-only change; no production code touched.
No linked issue — direct coverage follow-up to #3461's post-merge Codecov finding.
Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run typechecknpm run test:coverage— confirmed the previously-uncovered line (src/queue/processors.ts'smarkAiReviewPublishedcatch handler) is now exercised; full unsharded suite greennpm run actionlint/test:workers/build:mcp/test:mcp-pack/ui:*(not re-run — test-only change undertest/unit/, none of these are affected)npm audit --audit-level=moderate— 0 vulnerabilities (no dependency changes)If any required check was skipped, explain why:
test/unit/queue.test.ts; no source, workflow, MCP, or UI files touched.Safety
UI Evidencesection. (N/A — no UI change.)