fix(review): require persisted visual captures - #4136
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4136 +/- ##
==========================================
- Coverage 94.11% 94.10% -0.01%
==========================================
Files 432 432
Lines 38348 38349 +1
Branches 13979 13979
==========================================
- Hits 36091 36089 -2
- Misses 1600 1602 +2
- Partials 657 658 +1
🚀 New features to boost your workflow:
|
|
Caution 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥 🛑 Gittensory review result - fixes requiredReview updated: 2026-07-10 08:22:00 UTC
🛑 Suggested Action - Manual Review
Review summary Nits — 5 non-blocking
Why this is blocked
CI checks failing
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.
|
42c3534 to
32e4a76
Compare
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| 🔵 In progress View logs |
gittensory-ui | cf94e10 | Jul 10 2026, 08:23 AM |
2fb6565 to
c460407
Compare
…und a persisted marker This PR's isPersistedShotUrl now requires a real R2 key=, which only a genuine Browser Rendering pass can produce -- env.BROWSER is unavailable in this unit-test environment, so buildCapture always fell back to a placeholder and the gate correctly (per this PR's own fix) never saw it as satisfied, making the old assertion structurally unable to pass regardless of code correctness. Rather than mock a full headless-browser launch inside this already-massive shared test file, seeds the marker the same way production does: an EARLIER pass's markPullRequestVisualCaptureSatisfied call, before the webhook under test runs. This is a faithful (not weaker) test of the real behavior -- capture and gate evaluation routinely happen on different webhook deliveries in production -- and fully covers the read-back half of the #4110 gate; the render half is covered separately by test/unit/visual-shot.test.ts.
Motivation
/shot?url=fallback links (returned when rendering failed or R2 was missing) were treated as evidence of a real bot-captured before/after pair./shot?key=URLs as machine-proven evidence so a failed/no-render on-demand URL cannot mark a PR asbotCaptureSatisfiedand bypass maintainer-configured checks.Description
isPersistedShotUrl(...)which requires a/shot?URL that contains akey=and excludesplaceholder=markers insrc/review/visual/capture.ts.isPersistedShotUrlpredicate in the per-route pair check sohasSuccessfulBotCaptureonly returns true for persisted cached PNGs.test/unit/visual-capture.test.tsto assert persisted?key=URLs satisfy the predicate and add a regression test proving on-demand?url=fallback URLs do not satisfy bot-capture evidence.Testing
npx vitest run test/unit/visual-capture.test.tsand thehasSuccessfulBotCapturetests passed (all tests in that file passed).npm run typecheckand it succeeded with no errors.npm run test:coveragebut the full coverage run did not complete within the session (the broader queue test suite exercised and long-running tasks prevented finishing in this environment).npm audit --audit-level=moderateand it failed due to the registry audit endpoint returning403 Forbiddenin this environment.Codex Task