Skip to content

fix(review): per-repo review.visual.production_url override for bot-capture - #4564

Merged
JSONbored merged 1 commit into
mainfrom
feat/visual-capture-production-url
Jul 10, 2026
Merged

fix(review): per-repo review.visual.production_url override for bot-capture#4564
JSONbored merged 1 commit into
mainfrom
feat/visual-capture-production-url

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

  • buildCapture's "before" (production) shot reads PUBLIC_SITE_ORIGIN as a single global env var with no per-repo awareness — on a multi-repo self-host instance that's correct for at most one repo, so every other repo's before-shot silently degrades to a dash and the bot-capture pipeline can never produce a real before/after pair for it (blocking Enable + validate automated visual capture end-to-end for metagraphed #3611, the still-open "enable + validate for metagraphed" sub-issue of the Epic: extend automated visual-capture convergence (#577) to self-host + metagraphed #3607 epic).
  • Adds review.visual.production_url as a per-repo config-as-code override (SSRF-validated at parse time, same as preview.url_template), always winning over the env var when set.
  • Generalizes DEFAULT_ROUTE_FILE and isVisualPath's app-folder pattern beyond apps/gittensory-ui/ — metagraphed's UI lives at apps/ui/** using the identical TanStack flat-file routing convention, so route inference was silently falling back to "/" for every metagraphed PR regardless of which page actually changed.

Test plan

  • npm run typecheck
  • npm run test:coverage (unsharded) — new branches fully covered; verified via lcov that no new-diff line is in the uncovered set
  • npm run test:ci (full local gate, exit 0)
  • npm audit --audit-level=moderate — 0 vulnerabilities

…apture

PUBLIC_SITE_ORIGIN is a single global env var with no per-repo awareness, so
on a multi-repo self-host instance it can be correct for at most one repo --
every other repo's "before" (production) shot silently degrades to a dash,
which means the bot-capture screenshot pipeline never produces a real
before/after pair for that repo (#3611). Add review.visual.production_url as
a per-repo config-as-code override, mirroring the existing
review.visual.preview.url_template precedence pattern.

Also generalize the route-file regex (DEFAULT_ROUTE_FILE) and isVisualPath's
app-folder pattern beyond apps/gittensory-ui/ -- metagraphed's apps/ui/**
uses the identical TanStack flat-file routing convention, just under a
different app folder name, so route inference was silently falling back to
"/" for every metagraphed PR regardless of which page actually changed.
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
gittensory-ui 11f6451 Commit Preview URL

Branch Preview URL
Jul 10 2026, 03:29 AM

@JSONbored
JSONbored merged commit e063f55 into main Jul 10, 2026
9 checks passed
@JSONbored
JSONbored deleted the feat/visual-capture-production-url branch July 10, 2026 03:32
@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.09%. Comparing base (73c9d76) to head (11f6451).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4564   +/-   ##
=======================================
  Coverage   94.08%   94.09%           
=======================================
  Files         427      427           
  Lines       37961    37969    +8     
  Branches    13864    13867    +3     
=======================================
+ Hits        35715    35726   +11     
  Misses       1586     1586           
+ Partials      660      657    -3     
Files with missing lines Coverage Δ
packages/gittensory-engine/src/focus-manifest.ts 99.11% <100.00%> (+<0.01%) ⬆️
src/review/visual/capture.ts 94.73% <100.00%> (+1.97%) ⬆️
src/review/visual/paths.ts 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant