Skip to content

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

Open
ankur-arch wants to merge 7 commits into
mainfrom
feat/compute-deploy-button-docs
Open

docs(compute): Deploy Button page and generator (repository-url)#8116
ankur-arch wants to merge 7 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: merge only after prisma/pdp-control-plane#4770 is deployed and GA'd. The docs link to console.prisma.io/new/clone, which is a 404 until then. Review now, merge later.

What this is

The public Deploy Button docs page (/docs/compute/deploy-button) plus an interactive generator. Authors paste a repo URL, optionally declare env vars, and copy a ready-to-paste badge.

flowchart LR
    A["Author opens\ndocs generator"] --> B["Enter repo URL\n+ env vars"]
    B --> C["Client-side validation\n(same rules as Console)"]
    C --> D["Copy URL /\nMarkdown / HTML"]
    D --> E["Badge in README"]
    E --> F["Visitor clicks,\nConsole takes over"]
Loading

Review in 3 checks

  1. Contract parity. Generated URLs use repository-url plus optional project-name, env, env-example-<NAME>, utm_*. Validation matches the Console: uppercase names, 10 max, 100-char examples, no control characters.
  2. Both env-var sources documented. Link parameters and app.env.vars in prisma.compute.json (with a copy-paste example).
  3. Troubleshooting matches reality. The error-message reference mirrors the Console's actual banners.

Where to look

Area File
Generator component apps/docs/src/components/deploy-button-generator.tsx
Docs page apps/docs/content/docs/compute/deploy-button.mdx
Badge asset apps/docs/public/img/deploy-button.svg

Testing

  1. Docs CI green: Playwright, link check, spellcheck, CodeQL, Argos.
  2. Generator lint and typecheck clean.
  3. URL output manually cross-checked against the Console implementation, including the control-character rule for example values (a pasted tab fails for the author, not their users).

Merge order

flowchart LR
    A["#4770\nConsole"] --> B["smoke test\n+ GA"] --> C["this PR"] --> D["example repo\nbadge swap"]
Loading

Nothing depends on this PR except the final badge swap in the example repo.

Summary by CodeRabbit

  • New Features

    • Added an interactive Deploy Button generator for GitHub repositories.
    • Generate deployment URLs, Markdown snippets, and HTML snippets with copy controls.
    • Supports optional project, tracking, and environment-variable settings with validation.
    • Added guidance for repository requirements, deployment setup, and troubleshooting.
  • Documentation

    • Added a comprehensive Deploy Button guide to the Compute documentation and navigation.

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 Aug 4, 2026 11:29am
docs Ready Ready Preview Aug 4, 2026 11:29am
eclipse Ready Ready Preview Aug 4, 2026 11:29am
site Error Error Aug 4, 2026 11:29am

Request Review

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 2c059b29-dc33-4d3b-b438-4482def747da

📥 Commits

Reviewing files that changed from the base of the PR and between 26c17ab and f6d84c6.

⛔ Files ignored due to path filters (1)
  • apps/docs/public/img/deploy-button.svg is excluded by !**/*.svg
📒 Files selected for processing (4)
  • apps/docs/content/docs/compute/deploy-button.mdx
  • apps/docs/content/docs/compute/meta.json
  • apps/docs/src/components/deploy-button-generator.tsx
  • apps/docs/src/mdx-components.tsx
🚧 Files skipped from review as they are similar to previous changes (3)
  • apps/docs/content/docs/compute/meta.json
  • apps/docs/src/components/deploy-button-generator.tsx
  • apps/docs/src/mdx-components.tsx

Walkthrough

The PR adds a client-side Deploy Button generator to the Compute documentation. It validates repository and environment-variable inputs, generates deploy URLs and embedding snippets, registers the component in MDX, and documents setup and troubleshooting.

Changes

Deploy Button

Layer / File(s) Summary
Validation and URL generation
apps/docs/src/components/deploy-button-generator.tsx
Validates repository and environment-variable inputs, normalizes values, and builds the Console clone URL.
Generator form and snippets
apps/docs/src/components/deploy-button-generator.tsx
Adds form controls, environment-variable management, previews, and Markdown and HTML outputs with copy controls.
MDX integration and documentation
apps/docs/src/mdx-components.tsx, apps/docs/content/docs/compute/meta.json, apps/docs/content/docs/compute/deploy-button.mdx
Registers the generator in MDX, adds it to Compute navigation, and documents repository requirements, deployment flow, URL parameters, environment variables, embedding, and troubleshooting.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant DeployButtonDocs
  participant DeployButtonGenerator
  participant Console
  User->>DeployButtonDocs: Open Deploy Button documentation
  DeployButtonDocs->>DeployButtonGenerator: Render generator
  User->>DeployButtonGenerator: Enter repository and optional parameters
  DeployButtonGenerator->>DeployButtonGenerator: Validate inputs and generate snippets
  DeployButtonGenerator->>Console: Provide deploy-button URL
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the Compute Deploy Button documentation page and generator added by the pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/compute-deploy-button-docs

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 - Aug 4, 2026, 11:34 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>
…ke the Console

The generator now rejects example values with control characters, the
same rule the Console applies, so a pasted tab fails for the author
instead of for their users. The env-var section documents the second
source of prompts: app.env.vars entries in prisma.compute.json appear
on the deploy form with the committed value as the prefill.

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/docs/content/docs/compute/deploy-button.mdx`:
- Around line 108-111: Update the safety guidance in the “Two rules keep this
safe” section to acknowledge that deploy-button URLs may include names and
optional public example values, while explicitly stating that secret values must
never be supplied. Ensure the surrounding README and browser-history guidance
matches this behavior and remains consistent with the env-example-RESEND_API_KEY
example.

In `@apps/docs/src/components/deploy-button-generator.tsx`:
- Line 138: Update envVarsValid and the validation around envRowValid to reject
duplicate environment-variable names after trimming whitespace. Mark every
conflicting row invalid before output generation, while preserving the existing
validation for other row fields and preventing later duplicate rows from being
silently discarded.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: b5f33b43-5450-40b3-b450-c6c10aa4d6b4

📥 Commits

Reviewing files that changed from the base of the PR and between 26c17ab and f6d84c6.

⛔ Files ignored due to path filters (1)
  • apps/docs/public/img/deploy-button.svg is excluded by !**/*.svg
📒 Files selected for processing (4)
  • apps/docs/content/docs/compute/deploy-button.mdx
  • apps/docs/content/docs/compute/meta.json
  • apps/docs/src/components/deploy-button-generator.tsx
  • apps/docs/src/mdx-components.tsx

Comment on lines +108 to +111
Two rules keep this safe:

- **The URL carries names, never values.** The user types each value (or accepts your example) in the Console form. Values never appear in the link, in browser history, or in the GitHub authorization round-trip.
- **Examples must be safe to publish.** An `env-example-<NAME>` value appears in your README for anyone to read, so use obvious placeholders like `re_example_123`, never a real key.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Correct the env-example URL statement.

Line 103 puts an env-example-RESEND_API_KEY value in the URL. These lines then say URLs carry names only and values never appear in links or browser history. State that links carry names and optional public example values, and that secret values must never be supplied.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/docs/content/docs/compute/deploy-button.mdx` around lines 108 - 111,
Update the safety guidance in the “Two rules keep this safe” section to
acknowledge that deploy-button URLs may include names and optional public
example values, while explicitly stating that secret values must never be
supplied. Ensure the surrounding README and browser-history guidance matches
this behavior and remains consistent with the env-example-RESEND_API_KEY
example.

);
const projectNameValid =
projectName.trim() === "" || PROJECT_NAME_PATTERN.test(projectName.trim());
const envVarsValid = envVars.every(envRowValid);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Reject duplicate environment-variable names.

envVarsValid accepts duplicate trimmed names. Lines 151-155 silently discard each later row. If examples differ, the form generates a snippet that retains only the first example. Detect duplicates and mark the conflicting row invalid before generating output.

Suggested validation
+function envVarsAreValid(rows: EnvVarRow[]): boolean {
+  const names = new Set<string>();
+
+  return rows.every((row) => {
+    if (!envRowValid(row)) return false;
+    const name = row.name.trim();
+    if (name === "") return true;
+    if (names.has(name)) return false;
+    names.add(name);
+    return true;
+  });
+}
+
-  const envVarsValid = envVars.every(envRowValid);
+  const envVarsValid = envVarsAreValid(envVars);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const envVarsValid = envVars.every(envRowValid);
function envVarsAreValid(rows: EnvVarRow[]): boolean {
const names = new Set<string>();
return rows.every((row) => {
if (!envRowValid(row)) return false;
const name = row.name.trim();
if (name === "") return true;
if (names.has(name)) return false;
names.add(name);
return true;
});
}
const envVarsValid = envVarsAreValid(envVars);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/docs/src/components/deploy-button-generator.tsx` at line 138, Update
envVarsValid and the validation around envRowValid to reject duplicate
environment-variable names after trimming whitespace. Mark every conflicting row
invalid before output generation, while preserving the existing validation for
other row fields and preventing later duplicate rows from being silently
discarded.

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