Part of #3607.
Motivation (reshaped from the original scope — see comments below)
The original scope was Cloudflare-Workers-Builds-specific (and effectively metagraphed-specific): teach
preview-url.ts to query Cloudflare's API for a branch/commit's build. That doesn't serve the actual goal —
any self-hoster should be able to wire up THEIR repo's existing preview-deploy setup with config, not
code, regardless of whether they use Cloudflare, Vercel, Netlify, or something bespoke.
Concretely: metagraphed-ui's Worker is connected to Cloudflare Workers Builds (Git integration, root dir
apps/ui, non-production-branch builds enabled — confirmed live in the dashboard). But a live check against
metagraphed PR #3724 found neither a "Workers Builds" GitHub check run nor a GitHub Deployment record for its
head SHA — Workers Builds' non-production output apparently doesn't surface on GitHub the way Cloudflare
Pages' classic integration does. Building bespoke code against ONE provider's API would just repeat this
problem for the next self-hoster using Vercel, Netlify, or anything else.
Requirements
- Design a
review.visual.preview .gittensory.yml config block that lets a repo declare how to find its
own "after" preview URL, supporting (in rough priority order):
- Manual URL template (universal fallback, zero provider knowledge needed): e.g.
url_template: "https://pr-{number}.mysite.com" or "https://{head_sha_short}.myworker.workers.dev" —
works for literally any provider whose preview URLs follow a predictable pattern, with no
provider-specific code in gittensory at all.
- GitHub-native discovery (today's existing three methods — Deployments API, commit checks, bot PR
comment) as the zero-config default for providers that DO integrate with GitHub the classic way
(Cloudflare Pages, Netlify, Vercel's GitHub App all post real Deployments).
- (Stretch, only if 1–2 don't cover a real case) a provider-specific API lookup — e.g. Cloudflare Workers
Builds' own API if its dashboard has no "post to GitHub" toggle. Investigate whether such a toggle
exists before writing provider-specific code — a config setting is more maintainable than an API client.
- Precedence: an explicit
url_template always wins (repo told us exactly where to look); otherwise fall
back to GitHub-native discovery; otherwise no preview available → existing pending/failed placeholder
behavior, unchanged.
- Absent config must be byte-identical to today (GitHub-native discovery only, exactly gittensory-ui's
current behavior) — this is additive, not a breaking change for existing behavior.
- Whatever's built must let metagraphed use option 1 (manual template) immediately without needing option 3
at all, since Cloudflare Workers Builds' GitHub-visibility gap may never get resolved on Cloudflare's side.
Deliverables
Expected outcome
Any self-hoster can point gittensory at their repo's existing preview-deploy URL pattern with a few lines
of YAML, regardless of which provider they use — no gittensory code change required per provider.
Effort
S–M — the manual-template path is small and provider-agnostic; GitHub-native discovery already exists and
just needs to become the fallback instead of the only path.
Part of #3607.
Motivation (reshaped from the original scope — see comments below)
The original scope was Cloudflare-Workers-Builds-specific (and effectively metagraphed-specific): teach
preview-url.tsto query Cloudflare's API for a branch/commit's build. That doesn't serve the actual goal —any self-hoster should be able to wire up THEIR repo's existing preview-deploy setup with config, not
code, regardless of whether they use Cloudflare, Vercel, Netlify, or something bespoke.
Concretely:
metagraphed-ui's Worker is connected to Cloudflare Workers Builds (Git integration, root dirapps/ui, non-production-branch builds enabled — confirmed live in the dashboard). But a live check againstmetagraphed PR #3724 found neither a "Workers Builds" GitHub check run nor a GitHub Deployment record for its
head SHA — Workers Builds' non-production output apparently doesn't surface on GitHub the way Cloudflare
Pages' classic integration does. Building bespoke code against ONE provider's API would just repeat this
problem for the next self-hoster using Vercel, Netlify, or anything else.
Requirements
review.visual.preview.gittensory.ymlconfig block that lets a repo declare how to find itsown "after" preview URL, supporting (in rough priority order):
url_template: "https://pr-{number}.mysite.com"or"https://{head_sha_short}.myworker.workers.dev"—works for literally any provider whose preview URLs follow a predictable pattern, with no
provider-specific code in gittensory at all.
comment) as the zero-config default for providers that DO integrate with GitHub the classic way
(Cloudflare Pages, Netlify, Vercel's GitHub App all post real Deployments).
Builds' own API if its dashboard has no "post to GitHub" toggle. Investigate whether such a toggle
exists before writing provider-specific code — a config setting is more maintainable than an API client.
url_templatealways wins (repo told us exactly where to look); otherwise fallback to GitHub-native discovery; otherwise no preview available → existing pending/failed placeholder
behavior, unchanged.
current behavior) — this is additive, not a breaking change for existing behavior.
at all, since Cloudflare Workers Builds' GitHub-visibility gap may never get resolved on Cloudflare's side.
Deliverables
.gittensory.ymlschema + parser + resolver forreview.visual.preview(config-as-code pattern:yml > default, parser in
focus-manifest.ts, resolver, tests)preview-url.tstries: explicit template → existing GitHub-native discovery → pending/failed as todayeven though the shipped fix doesn't depend on it)
{number}/{head_sha}/{head_sha_short}placeholder substitution), absent config falls through to existing discovery unchanged
.gittensory.yml.exampledocuments the new knob with a generic (non-metagraphed-specific) example,and metagraphed's own private config gets a real
url_templateset as the first real usageExpected outcome
Any self-hoster can point gittensory at their repo's existing preview-deploy URL pattern with a few lines
of YAML, regardless of which provider they use — no gittensory code change required per provider.
Effort
S–M — the manual-template path is small and provider-agnostic; GitHub-native discovery already exists and
just needs to become the fallback instead of the only path.