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.
`glab api user | jq -r .username` reports only jq's exit status, and jq -r exits 0 on empty input, so a failed `glab api` left ME empty: --self's --author filter silently matched everything, and the claim marker assigned nobody while still looking like it succeeded. Both sites now capture glab's status separately and use `jq -er`. Also probe for jq in the GitLab pre-flight — piping to the standalone binary made it a hard dependency of that path, which only glab was being checked for.
…e jq probe
Two follow-ups from the second review pass:
- `jq -e` fails only on null/false, so `{"username":""}` exited 0 and left ME
empty. `--author ""` is not an empty filter to glab, it is NO filter — --self
would have enumerated and claimed other people's issues. Both sites now guard
on non-empty separately from the -e check.
- The jq probe was in the shared pre-flight, so a GitLab repo working a PLAN.md
backlog aborted without jq even though that mode never calls plain `glab api`.
Moved it to the top of Phase 1 issues mode, where the dependency actually is.
A links-API outage read as "no native blockers" because the pipeline reported jq's status and jq succeeds on empty input — so the picker could claim a dependent ahead of its blocker. The lookup now captures glab's response and status first; a failed lookup is UNRESOLVED (body convention only, stated aloud), not unblocked. Also probe for jq in the swarm preconditions: swarm replaces Phases 1-7, so Phase 1's probe never ran there even though A1e/A2e make the same `glab api ... | jq` dependency call.
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
Patch release fixing
/do:next's GitLab issue-claiming path.glab api(unlike theglab issue/glab mrsubcommands) has no built-in--jqflag and exits withUnknown flag: --jq. All fourglab apicall sites incommands/do/next.mdnow pipe to the standalonejqbinary instead.Test plan
npm test— 397 tests pass, 0 failglab api … --jqoccurrences remain outside changelog proseglab issue view --jqdeliberately left alone (that subcommand does support the flag)Full Diff: v3.35.0...v3.35.1