Fly deploy: replace grep app-existence check with jq#41
Merged
Conversation
The grep-against-JSON existence check missed an existing app because
fly's JSON output has whitespace between key/colon/value ("Name":
"cotrackpro-talk") and the grep pattern looked for the no-space
form. The step then tried to create the app and Fly correctly
rejected with "Name has already been taken."
Switch to a jq predicate that parses the JSON and tolerates both
the array-of-apps and object-keyed-by-app shapes.
|
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.
Why
Last workflow run failed with:
The app
cotrackpro-talkwas created in an earlier run, but the existence check missed it becausefly apps list -jformats its JSON with whitespace between key/colon/value ("Name": "cotrackpro-talk"), and our grep pattern looked for the no-space form ("Name":"cotrackpro-talk"). The step then attempted to create the app and Fly correctly rejected it.Fix
Use jq to parse the JSON and check for the app name. Handles both the array-of-apps shape and the object-keyed-by-app shape so we survive flyctl version differences.
Test plan
app cotrackpro-talk existsand continues to deploy/health→ 200Generated by Claude Code