fix: glab api has no --jq flag, pipe to jq instead - #215
Merged
Conversation
Caught live while dogfooding the fix against a real GitLab issue: plain glab api (unlike glab issue/glab mr subcommands) has no built-in --jq flag and errors with "Unknown flag: --jq." Every glab api call now pipes to the standalone jq binary instead.
Merged
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.
Summary
/do:next's GitLab paths callglab api ... --jq, but plainglab apihas no built-in--jqflag — unlikegh api, and unlike theglab issue/glab mrsubcommands, which do. Every one of those calls fails on a GitLab repo. This pipes them to the standalonejqbinary instead.Four call sites in
commands/do/next.md:glab api userin the--selfin-flight-set filter (step 1)glab api userin the--selfexplicit-#numauthor gate (step 5)glab api userin the Phase 2 claim blockglab api projects/:id/issues/<N>/linksin the native blocked-by check (step 4)Follow-up to #150 — the fix was written 17 minutes after that PR merged and never got shipped.
Test plan
npm test— 397 pass, 0 failgrep -n 'glab api [a-z:/<>-]*--jq' commands/do/next.mdreturns nothingglabisn't installed locally); the flag set is per glab's documentedapicommand.