Skip to content

docs(compute): Deploy Button page and generator (repository-url) - #8116

Draft
ankur-arch wants to merge 5 commits into
mainfrom
feat/compute-deploy-button-docs
Draft

docs(compute): Deploy Button page and generator (repository-url)#8116
ankur-arch wants to merge 5 commits into
mainfrom
feat/compute-deploy-button-docs

Conversation

@ankur-arch

@ankur-arch ankur-arch commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

⚠️ Hold — do not merge yet. Merge only after prisma/pdp-control-plane#4770 is merged and deployed, during the launch window once the flow is enabled for all accounts. The Console PR owns the /new/clone route; merging this first would document a flow readers cannot complete.

What this PR enables

A Deploy Button reference page for Prisma Compute (/docs/compute/deploy-button), matching Vercel's Deploy Button experience: developers generate a "Deploy with Prisma" button for their own public GitHub repository and embed it in READMEs, blog posts, or websites. One click takes a user through the Console flow that copies the repository into their own GitHub account, provisions a Prisma Postgres database, collects any required environment variables, and starts the first deployment.

The documented contract (matches Console PR #4770 exactly)

https://console.prisma.io/new/clone
  ?repository-url=https://github.com/<owner>/<repo>     (required)
  [&project-name=<prefill>]
  [&env=KEY1,KEY2]
  [&env-example-<NAME>=<safe non-secret prefill>]
  [&utm_source=…&utm_medium=…&utm_campaign=…]

A deployable repository needs: a root package.json, a supported lockfile (bun.lock, package-lock.json, pnpm-lock.yaml, yarn.lock), a root prisma.compute.json describing a single app with no pinned region, and a runnable TypeScript application listening on the declared httpPort. The page states all of this under "Make your repository deployable".

What changed (latest revision)

  • Fixed the main deploy button. The hero button was authored as a Markdown image link, which the docs MDX pipeline wraps in ImageZoom — clicking it opened a zoom lightbox instead of navigating. It is now a literal anchor + img, verified clickable in a rendered page (href resolves to the Console clone URL, badge served from /docs/img/deploy-button.svg).
  • Removed the Console "Early Access" note.
  • Environment-variable support, matching the finalized Console contract:
    • The generator gains rows for required variable names plus optional safe example values, emitted as env / env-example-<NAME> on all three outputs (URL, Markdown, HTML). Names are validated client-side with the same rules as the Console ([A-Z_][A-Z0-9_]*, ≤10).
    • A new "Environment variables" page section documents the flow: names ride the URL, values are prompted inside the Console and stored encrypted on the new project, secrets never appear in any URL, examples must be safe to publish, and DATABASE_URL/DATABASE_URL_POOLED are provisioned automatically (shown as "Added automatically", never prompted).
    • The URL-format table documents both parameters; troubleshooting covers the invalid-env-list error.
  • All three formats (Markdown, HTML, direct URL) open the same Console deployment flow; verified in a browser that the generator produces consistent env-carrying output for each.

How to test it

  • pnpm --filter docs types:check, pnpm --filter docs lint:links, pnpm --filter docs lint:spellcheck all pass; changed files are Prettier-clean.
  • pnpm --filter docs dev, open http://localhost:3001/docs/compute/deploy-button: the hero button is a plain link (no zoom), the generator validates the repository URL and env-var names, and the copy buttons produce URL/Markdown/HTML snippets carrying the env parameters. Verified with Playwright against the rendered page.
  • End-to-end reference: ankur-arch/deploy-button-e2e is a throwaway public repository built to this page's contract (required WELCOME_MESSAGE variable, README with all three button formats generated by this page's rules).

What must happen before merging

  1. prisma/pdp-control-plane#4770 merged and deployed (it owns /new/clone, the env-var handling, and the sign-in deep link).
  2. A manual click-through of the ankur-arch/deploy-button-e2e button on a venus-flagged account reaches a successful Compute deployment (the push → webhook → build-runner leg has no automated gate).
  3. The clone flow is enabled for all accounts (the page documents an ungated experience).
  4. The referenced example repository (prisma/compute-deploy-example) README carries a working button.

Risks, limitations, and rollback

  • Content-only change; no runtime risk to other pages. The generator renders no user input as HTML (text snippets only).
  • The badge URL (/docs/img/deploy-button.svg) becomes a long-lived contract once third parties embed it — the path must not move after launch.
  • Not yet supported (documented as such): private repositories, non-default branches, redirect-url.
  • Rollback: revert the PR (keep the badge SVG if any external embeds already reference it).

🤖 Generated with Claude Code

Adds a Deploy Button reference page under Compute integrations: what the
button does, supported templates, URL format with attribution parameters,
troubleshooting, and copy-paste Markdown/HTML snippets. Includes an
interactive generator component and a hosted "Deploy with Prisma" SVG
badge for third-party READMEs to hot-link.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
blog Ready Ready Preview Jul 31, 2026 9:57am
docs Ready Ready Preview Jul 31, 2026 9:57am
eclipse Ready Ready Preview Jul 31, 2026 9:57am
site Ready Ready Preview Jul 31, 2026 9:57am

Request Review

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 3c60883c-4678-42e0-bd90-79f4f59c9c0e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

Comment thread apps/docs/src/components/deploy-button-generator.tsx Fixed
@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

🍈 Lychee Link Check Report

15 links: ✅ 3 OK | 🚫 0 errors | 🔀 2 redirects | 👻 12 excluded

✅ All links are working!


Full Statistics Table
Status Count
✅ Successful 3
🔀 Redirected 2
👻 Excluded 12
🚫 Errors 0
⛔ Unsupported 0
⏳ Timeouts 0
❓ Unknown 0

@argos-ci

argos-ci Bot commented Jul 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected 1 ignored Jul 31, 2026, 10:04 AM

@ankur-arch

Copy link
Copy Markdown
Contributor Author

Closing this. The Deploy Button contract changed to repository-url (Vercel parity) instead of template IDs, so the docs page and generator need a different shape. See the revised spec in pdp-control-plane projects/templates-deploy-button/spec.md.

@ankur-arch ankur-arch closed this Jul 30, 2026
The button's contract is now a repository URL: any public GitHub
repository with a root prisma.compute.json, a package.json, and a
lockfile is deployable — no registration or catalog entry. The page
documents the minimal repository contract and the
/new/clone?repository-url=… format, and the generator takes a
repository URL plus optional project-name and attribution.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ankur-arch ankur-arch changed the title docs(compute): add Deploy Button page and generator docs(compute): Deploy Button page and generator (repository-url) Jul 30, 2026
@ankur-arch ankur-arch reopened this Jul 30, 2026
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 30, 2026
- prisma.compute.json example uses the real schema (app.httpPort, not
  top-level name/port — the old example failed validation verbatim).
- Document the validation limits (file count/size caps, no workflows,
  no symlinks/submodules, single-app, region key rejected).
- Match the Console's actual copy for the name-conflict error, the
  15-minute authorization window, commit display and pinning behavior,
  the workspace picker, and the private-by-default visibility.
- Qualify push-to-recover advice by whether the project was created.
- Generator: project-name field shows its own validation hint,
  copy buttons get distinct accessible names, HTML snippet escapes
  ampersands in the href.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Fix the main button: a literal anchor + img instead of the markdown
  image, which the docs pipeline wrapped in ImageZoom and made unclickable
- Remove the early-access note
- Document the env / env-example-<NAME> URL parameters and add an
  Environment variables section (names in the URL, values prompted in
  Console, DATABASE_URL provisioned automatically)
- Generator: rows for required env-var names + safe example values,
  emitted on the URL, Markdown, and HTML outputs

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

2 participants