AGENT SKILL

pr-preview-servers

Find and validate rotating GCP Cloud Run preview servers for PR branches.

使用场景测试与质量
License 许可
MIT
最近更新
2026-11-12
Stars
★ 6
Forks
0

01 前言 Front Matter

name
pr-preview-servers
description
Find and validate rotating GCP Cloud Run preview servers for PR branches.

03 SKILL.md 正文

PR Preview Servers — GCP Cloud Run Pool

Reference for the rotating preview server pool used to deploy PR branches.

Pool Configuration

  • Pool size: 10 servers (mvp-site-app-s1 through mvp-site-app-s10)
  • Service prefix: mvp-site-app
  • GCP project: $GCP_PROJECT_ID
  • Region: us-central1
  • Trigger: Any PR push to $PROJECT_ROOT/**, Dockerfile, requirements.txt, etc.
  • Workflow: .github/workflows/pr-preview.yml
  • Pool assignment script: .github/scripts/pr-server-pool.sh

URL Pattern

https://mvp-site-app-s{N}-{hash}-uc.a.run.app

Where {N} is 1–10 and {hash} is Cloud Run's stable unique URL segment.

Finding the Current PR's Preview URL

From GitHub CLI (fastest):

gh pr view <PR_NUMBER> --json comments --jq '.comments[].body' | grep -o 'https://mvp-site-app-s[^ ]*'

From PR comments in the UI: Look for the bot comment that says "Preview deployed to: https://..."

From Cloud Run directly:

gcloud run services describe mvp-site-app-s{N} \
  --project="$GCP_PROJECT_ID" \
  --region=us-central1 \
  --format='value(status.url)'

Deployment Details

The preview server is deployed with:

  • FLASK_ENV=production
  • ENVIRONMENT=preview
  • Secrets: GEMINI_API_KEY, CEREBRAS_API_KEY, OPENROUTER_API_KEY
  • NO TESTING_AUTH_BYPASS=true — real Firebase auth is required for protected endpoints
  • Max 2 Cloud Run instances, same timeout as production

Health Endpoint

GET /health
→ 200 {"status": "healthy", "service": "worldarchitect-ai", "timestamp": "..."}

Note: /health does not expose the ENVIRONMENT env var. Confirmed 2026-02-20.

Testing Against Preview Servers

Use the standalone smoke test (no local server startup needed):

# Test the current PR's preview server
python3 testing_mcp/test_openclaw_gateway_url_preview.py

# Test a specific preview URL
python3 testing_mcp/test_openclaw_gateway_url_preview.py \
  --server-url https://<preview-service-url-s10>

What You Can Test Without Auth

Test Why
/health → 200 Public health endpoint
/settings HTML → 200, field present Public HTML page
POST /api/settings → 401 (not 404) Route wired, auth enforced
Static assets Public static files

What Requires Real Firebase Auth

  • POST /api/settings with actual settings values (save to Firestore)
  • GET /api/settings (read user settings)
  • Any campaign API endpoint

Pool Eviction Policy

When all 10 slots are taken, the oldest assignment is evicted to make room. The evicted PR loses its preview URL. Check PR #N's comments for current status.

Known Preview Server URLs by PR

PR Server URL
#5662 s10 https://<preview-service-url-s10>
#5857 s2 https://<preview-service-url-s2>

Update this table as PRs are deployed. URL stays stable as long as the pool slot isn't evicted.

04 同仓库更多 Skills