feat(review): add per-repo review.visual capture config - #3644
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Adds `review.visual` to the .gittensory.yml manifest so a self-hoster
can point the before/after screenshot pipeline at their own repo's
preview setup without any code changes:
- preview.url_template: an explicit "after" preview URL template
({number}/{head_sha}/{head_sha_short} placeholders) that always wins
over GitHub-native preview discovery -- the only option for a
provider (e.g. Cloudflare Workers Builds' non-production branch
builds) that never surfaces a GitHub-visible deployment at all.
Validated at parse time against the same SSRF guard the renderer
applies at render time (isSafeHttpUrl), so a malformed template
warns immediately instead of silently degrading to a blank cell.
- routes.paths / routes.max_routes: an explicit route list that
replaces automatic file-to-route inference for a repo whose routing
convention isn't gittensory-ui's TanStack file-based one, plus an
override for the built-in per-PR route cap.
All-absent (default, every repo today) resolves to the existing
GitHub-native discovery chain and automatic route inference, so this
is byte-identical until a maintainer opts in. Also documents the two
review.* fields (finding_categories, visual) that were still missing
from .gittensory.yml.example's field-exhaustiveness map after #3635.
Part of #3607. Closes #3609. Closes #3610.
789706f to
5dbbb8a
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3644 +/- ##
==========================================
+ Coverage 93.13% 93.28% +0.15%
==========================================
Files 314 314
Lines 32005 32054 +49
Branches 11725 11747 +22
==========================================
+ Hits 29807 29903 +96
+ Misses 1552 1517 -35
+ Partials 646 634 -12
🚀 New features to boost your workflow:
|
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-05 22:31:54 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 6 non-blocking
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.
|
…nches codecov/patch flagged 91.18% on the prior commit: wrapping the existing GitHub-native discovery chain in a new `else` block (so the explicit url_template check could run first) re-indented every line inside it, which counts as "changed" for patch coverage even though the logic itself didn't change. Adds the missing branch coverage: - target.previewUrl already set (skips discovery, no fetch calls) - getLatestDeploymentStatus throwing (defense-in-depth; the callee itself always catches internally and never actually throws today) - a preview URL found via a commit check run (skips the PR-comment fallback) - every getPreviewBuildState outcome the pending-poll branch reads: building, succeeded, and absent (no matching check run at all)
Summary
review.visualto the.gittensory.ymlmanifest so a self-hoster can point the before/after screenshot capture pipeline at their own repo's preview setup, purely through config:preview.url_template: an explicit "after" preview URL template ({number}/{head_sha}/{head_sha_short}placeholders) that always wins over the existing GitHub-native discovery chain (Deployments API → commit checks → cloudflare-bot PR comment) — the only option for a provider (e.g. Cloudflare Workers Builds' non-production branch builds) that never surfaces a GitHub-visible deployment at all. Validated at parse time against the same SSRF guard (isSafeHttpUrl) the renderer applies at render time, so a malformed template warns immediately at config-read time instead of silently degrading to a blank cell later.routes.paths/routes.max_routes: an explicit route list that replaces automatic file-to-route inference for a repo whose routing convention isn't gittensory-ui's TanStack file-based one, plus an override for the built-in per-PR route cap (applies to either source).GITTENSORY_REVIEW_SCREENSHOTS+ the repo cutover allowlist.finding_categoriesandvisualin.gittensory.yml.example's field-exhaustiveness map, which docs(config): make .gittensory.yml.example genuinely exhaustive, add a drift check #3635 (merged after this branch was cut) otherwise leaves them out of.Part of #3607. Closes #3609. Closes #3610.
Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlint(not run — no workflow files changed)npm run typechecknpm run test:coveragelocally;codecov/patchrequires ≥99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.npm run test:workers(not run — no Worker-runtime-specific code touched)npm run build:mcp(not run — no MCP package changes)npm run test:mcp-pack(not run — no MCP package changes)npm run ui:openapi:check(not run — no API/OpenAPI changes)npm run ui:lint(not run — noapps/gittensory-ui/**changes)npm run ui:typecheck(not run — noapps/gittensory-ui/**changes)npm run ui:build(not run — noapps/gittensory-ui/**changes)npm audit --audit-level=moderateIf any required check was skipped, explain why:
src/queue/processors.ts,src/review/visual/capture.ts,src/signals/focus-manifest.ts,.gittensory.yml.example, andtest/unit/**— no UI, MCP, wrangler binding, OpenAPI, or workflow files changed, so the UI/MCP/workers/openapi/actionlint checks above have no surface to exercise. Rannpx tsc --noEmit -p .(full project, clean) and targetedvitest runacross every affected test file (focus-manifest.test.ts,visual-capture.test.ts,visual-paths.test.ts,visual-wire.test.ts,visual-collapsible.test.ts,visual-diff.test.ts,visual-shot.test.ts,visual-config-wiring.test.ts,signals-coverage.test.ts,auto-review-wiring.test.ts, and the fullqueue.test.tssuite) — 1132/1132 passing — plus a scopedvitest --coveragepass confirming every new line insrc/signals/focus-manifest.ts,src/review/visual/capture.ts, andsrc/queue/processors.tsis hit, including theprocessors.tscall site inside thescreenshotsAllowed(...)branch (added a newqueue.test.tsintegration test that drives a real webhook throughprocessJobwith the screenshots flag on and a visual-path file changed, since that branch previously had zero test coverage even before this PR — seetest/unit/queue.test.ts, "threads review.visual config into the capture pipeline...").Safety
url_templateis validated against the existing SSRF guard, with new tests covering both a non-HTTPS and a private-host rejection.)UI Evidencesection below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository. (N/A — backend/config-only change, no visible UI surface.).gittensory.yml.exampleupdated;CHANGELOG.mduntouched.)UI Evidence
N/A — this PR has no visible UI/frontend surface (backend config-schema + capture-pipeline wiring only).
Notes
url_templateis chosen for a repo whose preview provider doesn't surface a GitHub-visible deployment.