fix(deploy): capture migrate stderr so P3005 detection actually works#30
Merged
Conversation
Previous attempt at P3005 tolerance (#29) used stdio: 'inherit' on the execSync call. That made the migrate deploy output stream to the build log but left err.stderr/err.stdout empty on failure — so the catch block's '${combined}.includes("P3005")' check ran against an empty string and the special-case never triggered. Confirmed live in the post-merge Vercel build log (commit 2656756): the build still failed with the original P3005 error, never hitting my warning branch. Switch to stdio: ['inherit', 'pipe', 'pipe'] so: - stdin still inherits (interactive prompts can still happen) - stdout+stderr are captured into err.stdout/err.stderr on failure - we echo them ourselves to keep build logs informative Both the success and failure paths now write the captured output to the build log explicitly, preserving the visibility 'inherit' gave us. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What broke
The post-#29 Vercel build still failed with the original P3005 error:
The warning I added in #29 (
⚠️ P3005: production schema is not baselined) never printed.Why
execSyncwithstdio: "inherit"streams the child's stdout/stderr directly to the parent — but does not populateerr.stderr/err.stdouton failure. The catch block was checkingcombined.includes("P3005")against an empty string, so the special-case branch never triggered.Fix
stdin still inherits, but stdout+stderr are captured into
err.stdout/err.stderr. The script then echoes them to the build log itself so we keep the same visibility"inherit"gave us.Both success and failure paths now write captured output explicitly.
🤖 Generated with Claude Code