ci: Attach Vercel build logs to Slack post on failures - #1956
Open
marcleblanc2 wants to merge 4 commits into
Open
ci: Attach Vercel build logs to Slack post on failures#1956marcleblanc2 wants to merge 4 commits into
marcleblanc2 wants to merge 4 commits into
Conversation
…nd the Slack post by any text Vercel sends vercel.deployment.failed (state.detail deployment_failed) for a build that exits non-zero; vercel.deployment.error is only for deleted deployments, so the workflow never ran on a real build failure. fetch-log now also checks the deployment was built from COMMIT_SHA, since the two arrive as separate inputs. The Slack step could not find the Vercel app's post for b241772 even though it was in the window; match on text, attachments and blocks without requiring bot_id, and list the messages seen when giving up. Amp-Thread-ID: https://ampcode.com/threads/T-01a093c3-a827-71ba-af20-c13e851c9a77 Co-authored-by: Amp <amp@ampcode.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The post's top-level text is the commit title plus 'failed to deploy'; the short SHA is only in a context block, which is why the SHA match missed. The Inspect button URL ends in the deployment ID, which is also unique per PR when two PRs share a commit.
The exact deployment ID match makes a wide window safe, and a re-run by hand can come long after the post. Print the newest 20 messages seen when giving up, to make the next miss easy to diagnose.
The repository is public, so nothing a build prints should land in a PR comment or a workflow artifact. The log is attached as .txt to the Vercel Slack post, so Slack renders it inline, and the PR comment links to that reply (or to the channel when the upload did not happen).
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.
Fixing the GitHub action's filter to find the Vercel post in Slack, to attach the build logs in Slack instead of PRs on a public repo, just in case anything sensitive makes it way into the build, and out of the logs.
Follow-up to #1946, found by re-triggering the build on #1948 after merging #1946
Tested
Build failure logs posted in Slack
Build failure PR comment test: PR checks on a broken PR, left broken (do not merge) #1948 (comment) links to the Slack post, instead of posting build logs publicly
Amp thread