Skip to content

docs: propose Vercel hosting and PR previews - #1382

Merged
danbarr merged 4 commits into
mainfrom
adr/pr-preview-hosting
Sep 11, 2026
Merged

danbarr merged 4 commits into
mainfrom
adr/pr-preview-hosting

Conversation

@danbarr

@danbarr danbarr commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Proposes Vercel as the production host for mecatl.dev and the provider for documentation pull request previews.
  • Records the prepared project baseline: website/ as the root, builds limited to website/ and user-docs/ changes, Git Fork Protection enabled, and Deployment Protection disabled for previews.
  • Keeps the Preview environment secret-free, uses provider-generated preview domains outside the mecatl.dev same-site boundary, and enables Vercel's source and build-log protections.
  • Moves published URL redirects into repository-owned Vercel configuration so they return HTTP redirect responses.
  • Retains S3 and CloudFront only through a verified DNS cutover and rollback window, then decommissions the bespoke AWS deployment.

Development stage

  • Plan / Interface — Bounded/Architectural behavioral and exact-interface contract; no implementation
  • Implementation — based on an approved, merged Plan / Interface PR
  • Combined — compact one-task Bounded/Architectural exception; no separate plan PR,
    and the in-PR plan declares **Expected tasks:** 1, a non-placeholder
    **Combined rationale:**, and no runtime/public/operator/persistence/trust-boundary
    interface change (None — rationale; workflow-only meta-changes may review process
    docs/skills here)
  • Spike / Routine — acceptance-plan spine exempt; Spike evidence does not ship as-is

Contract linkage

  • Work classification: Spike
  • Classification rationale: This proposal records the agreed hosting direction and concrete Vercel project requirements. It contains no implementation.
  • Decision record: ADR 0331, Proposed
  • Human waiver of spine: No. This discussion-only Spike is exempt until reclassified.
  • Acceptance plan: N/A until implementation is proposed as Architectural work.
  • Human decisions resolved and recorded: The hosting direction and Vercel project baseline are resolved. Additional response headers, redirect verification, DNS cutover, rollback, and AWS decommissioning remain for implementation planning.
  • Plan / Interface PR: N/A
  • Approved commit baseline: N/A
  • Combined/exemption rationale: Spike decision record only; no implementation.

Interface conformance

No interface change. The ADR proposes boundaries for later review and implementation.

Issue relationship

Relates to #1009

Type of change

  • Behavioral/interface plan
  • Bug fix
  • New feature
  • Refactoring (no behavior change)
  • Dependency update
  • Documentation/process
  • Other (describe):

Test plan

Baseline checks

  • Acceptance-plan checker
  • Linting (task lint)
  • Offline test suite (task test)
  • Offline demo (go run ./cmd/mecademo)
  • Markdown changed: docs generation/link checks (task docs)
  • User docs/user-facing behavior changed: site build (task site:build)
  • Guarded engine API affected: compatibility check (task api:check)
  • Intentional engine API change: task api:update + engine/CHANGELOG.md
  • Landed plan: strict acceptance trace (task ac-trace-strict)
  • Final implementation review: /panel-review

Changes

File Change
docs/adr/0331-documentation-hosting-and-pr-previews.md Proposes Vercel for production and previews, records the prepared project requirements, and defines redirect, migration, rollback, and AWS decommissioning boundaries.
docs/adr/README.md Adds the proposed ADR to the index.

User-facing change

None. This PR records a proposed architecture decision and changes no website or deployment behavior.

Special notes for reviewers

The team has agreed on Vercel as the end state for both production and previews. The Vercel project is prepared with the security and build settings recorded in the ADR. Review should focus on whether those requirements and the remaining migration constraints are sufficient before implementation planning.

The ADR moved from 0327 to 0331 because other open pull requests claimed 0327 after this draft opened. ADR 0331 was unused on main and across open pull requests when this revision was pushed.

@Nashon-Steffen

Copy link
Copy Markdown
Contributor

Consider Vercel before building an isolated AWS preview plane

This ADR designs a second S3 and CloudFront plane for previews. The sibling docs site already solves the same problem a different way. stacklok/docs-website (docs.stacklok.com) runs the same Docusaurus stack on Vercel. It gets per-PR previews from Vercel's Git integration with no custom workflow, no bucket, no distribution, and no cleanup reconciler. Issue #1009 lists "move production and previews to Vercel" as candidate one. This ADR should record why that candidate is rejected before it commits the team to owning bespoke infrastructure.

Vercel measured against the #1009 requirements:

External-fork authorization and secret exposure. Met with config. A Docusaurus build needs no build secrets, so a fork build has nothing to leak. Vercel gates fork deploys behind team approval and lets you scope env vars out of Preview. This is the trust split the ADR reimplements as a two-stage workflow.

Same-site isolation from mecatl.dev. Met natively, and stronger than the proposed design. Previews serve from *.vercel.app, a separate registrable site on the Public Suffix List. Preview content cannot set mecatl.dev cookies or share its same-site boundary. One rule holds: keep previews on vercel.app. Do not map previews to a mecatl.dev subdomain, or the boundary returns.

Redirects, headers, caching, domains. Met, and an improvement on one point. vercel.json gives true HTTP 301 and 302 responses. That fixes the redirect limitation this ADR concedes it leaves out. vercel.json headers set the same preview controls the ADR wants: CSP, X-Robots-Tag: noindex, frame-ancestors 'none', and worker-src 'none'.

Observability. Gap. Logs and analytics live on Vercel, not in the AWS account. There is no CloudFront access log in-account, and any WAF is Vercel's, not a self-managed AWS WAF. The isolated AWS plane wins this line when in-account logging or an AWS-owned WAF is a firm requirement.

Retention and cleanup. Partial gap. Preview builds are ephemeral, but old preview URLs stay reachable until a retention policy or an API delete removes them. Vercel does not tear down on PR close the way this ADR's close workflow and reconciler do. A Vercel deployment-retention policy closes this. Optional Deployment Protection requires a login to view a preview and further limits the public surface.

Migration and rollback. Met, low risk. A previews-only stage changes nothing in production. A later production move points mecatl.dev DNS at Vercel, keeps S3 and CloudFront as the rollback target, and decommissions them in infra after verification.

Recommendation against the #1009 candidates:

  • Candidate C (Vercel for previews only) is the lowest-risk step. Production stays on S3 and CloudFront. The Vercel project is trivial to abandon when it does not fit.
  • Candidate A (production and previews on Vercel) is the best end state. It matches docs-website and removes standing AWS preview infrastructure.
  • Candidate B (this ADR) wins only when in-account access logs, a self-managed AWS WAF, and Terraform-owned hard retention are firm requirements.

The password gate is gone after launch per #1009, so it no longer argues for the AWS plane.

One question decides this. Does the docs team or security require access logs and a WAF inside the AWS account, plus a guaranteed teardown on PR close? If yes, this ADR is the right design. If no, Vercel meets every other requirement with far less to own. The ADR should then adopt candidate C now, with candidate A as the target.

@danbarr danbarr changed the title docs: propose isolated PR preview hosting docs: propose Vercel hosting and PR previews Sep 11, 2026
@danbarr

danbarr commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks, this comparison was the right forcing function. We discussed it and agree that Vercel is the right end state for both production and previews.

The revised ADR adopts candidate A. It uses Vercel Git Fork Protection, a secret-free Preview environment, provider-generated preview domains, and repository-owned HTTP redirects. S3 and CloudFront remain available only through production verification and an agreed rollback window, then the bespoke AWS deployment is decommissioned.

We are not retaining candidate C as a permanent split. The cutover will naturally run both hosts for a bounded period, but production and previews converge on Vercel. I also renumbered the ADR to 0331 because other open pull requests claimed 0327 after this draft opened.

@danbarr
danbarr marked this pull request as ready for review September 11, 2026 18:13
@vercel

vercel Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
mecatl-website Ignored Ignored Preview Sep 11, 2026 7:42pm UTC

Request Review

@danbarr
danbarr merged commit 75827a8 into main Sep 11, 2026
32 checks passed
@danbarr
danbarr deleted the adr/pr-preview-hosting branch September 11, 2026 23:02
@danbarr

danbarr commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

Merging based on @jbeda approval in Slack.

@toolhive-release-app toolhive-release-app Bot mentioned this pull request Sep 14, 2026
2 tasks
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