Fix production Vercel deploy linking#89
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThe PR introduces three independent improvements to CI workflows: a new preview smoke scoping system that conditionally skips smoke/Playwright tests based on changed files with integrated data sync polling, hardening of visual review page availability checks to warn rather than fail, and Vercel production deploy hardening with API preflight validation and org scope flags on all CLI commands. ChangesPreview Smoke Scoping System
Visual Review Page Availability Hardening
Vercel Production Deploy Hardening
Sequence Diagram(s)sequenceDiagram
participant Deployment as Deployment Event
participant PreviewScope as preview-scope Analyzer
participant DataSync as sync-preview-managed-data Check
participant SmokeTests as Deploy Smoke Tests
participant PlaywrightTests as Playwright Tests
Deployment->>PreviewScope: Inspect changed files for PR
PreviewScope-->>Deployment: should_smoke = true/false
alt should_smoke is false
Deployment->>Deployment: Skip smoke & Playwright
else should_smoke is true
Deployment->>DataSync: Poll check until completion
DataSync-->>Deployment: Check done
Deployment->>SmokeTests: Run with gates enabled
Deployment->>PlaywrightTests: Run with gates enabled
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR hardens the deploy-production GitHub Actions workflow’s Vercel linking behavior by adding an explicit Vercel API preflight and by ensuring CI writes .vercel/project.json before invoking the Vercel CLI, preventing “Project Settings” linking failures from surfacing late and ambiguously.
Changes:
- Add a Vercel project API preflight (token/team/project validation) with actionable error messages.
- Generate
.vercel/project.jsonin CI to force correct project linking. - Pass
--scope "$VERCEL_ORG_ID"explicitly tovercel pull,vercel build, andvercel deploy.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Preview deploy smoke failedTarget: https://optimitron-b0jfmxqbp-mike-p-sinns-projects.vercel.app/
The smoke request uses the Vercel automation bypass header and checks HTTP 200, owned error markers, and expected h1 text. |
Code reviewIssue:
These Suggested fix: drop |
Sentry preview audit failedThe preview smoke test ran, but the Sentry audit could not query issues. Error: Check that the GitHub secret used by this job has Sentry |
PR review packetStart here
No user-facing page or component changes were inferred from changed files or the visual review manifest. Changed files considered
Updated automatically when this PR's preview or visual review reruns. |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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 @.github/workflows/smoke-deploy.yml:
- Around line 160-162: The current code filters out files with status "removed"
when building the filenames array, which prevents smoke tests from running when
a PR deletes runtime-impacting files. Remove the filter that excludes removed
files so that all file statuses (including removed files) are included in the
filenames array. Apply this same change in both locations where the filenames
array is constructed using the filter and map pattern (in the "Resolve preview
smoke scope" steps).
- Around line 188-190: The preview-sync wait timeout is currently set to 10
minutes (timeoutMs = 10 * 60 * 1000) but the sync-preview-managed-data producer
job can run up to 30 minutes, causing false failures during queueing or slow
migrations. Increase the timeoutMs value in both "Wait for preview database
sync" steps (including the one at lines 188-190 and the duplicate at lines
498-500) to align with the 30-minute producer job window to allow sufficient
time for healthy runs to complete.
- Line 126: Replace all `uses:` entries in the workflow that reference version
tags (such as `@v8`, `@v6`) with their corresponding full commit SHAs to prevent
supply-chain drift. For each affected action like `actions/github-script@v8` and
others on the specified lines, replace the tag reference with the complete
commit SHA by looking up the release on the respective action's repository. This
converts references like `uses: actions/github-script@v8` to the format `uses:
actions/github-script@<full-commit-sha>`.
🪄 Autofix (Beta)
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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: de647600-0970-481e-a38f-6b99c0c73802
📒 Files selected for processing (4)
.github/scripts/preview-smoke-scope.mjs.github/scripts/preview-smoke-scope.test.mjs.github/workflows/ci.yml.github/workflows/smoke-deploy.yml
Summary
deploy-productionso token/team/project failures are explicit before the CLI runs.vercel/project.jsonin CI from the configured Vercel org/project IDs and pass--scopeto Vercelpull,build, anddeployWhy
The last
mainproduction deploy failed indeploy-productionatPull Vercel production settingswith:Error: Could not retrieve Project Settings. To link your Project, remove the .vercel directory and deploy again.The old workflow only checked that Vercel values were non-empty. This verifies the exact project API lookup and gives actionable errors for bad token, team, or project config before the CLI runs.
While validating this PR, two unrelated workflow blockers showed up: GitHub Pages propagation could hold
web-visual-review, and preview deploy smoke was exercising a drifted Neon preview DB even though this PR only changes deployment workflows. The final workflow keeps those paths bounded instead of hiding the problem with larger blanket timeouts.Validation
git diff --check -- .github/workflows/ci.yml .github/workflows/smoke-deploy.yml .github/scripts/preview-smoke-scope.mjs .github/scripts/preview-smoke-scope.test.mjs.github/workflows/ci.ymland.github/workflows/smoke-deploy.ymlwith Python/PyYAMLnode --test .github/scripts/generate-pr-preview-links.test.mjs .github/scripts/preview-managed-data-filter.test.mjs .github/scripts/preview-smoke-scope.test.mjs .github/scripts/preview-masking-workflow-order.test.mjs .github/scripts/audit-sentry-preview.test.mjsb429001c:core-validate,web-static-validate,web-e2e-validate,web-visual-review,sync-preview-managed-data, Vercel, CodeRabbit, and Claude reviewProduction deploy still only runs on
main, so the production path will be fully exercised after merge.