Repository navigation
fix(gh,glab): don't pre-reject view/checks/run subcommands missing the id - #2123
Merged
Merged
Conversation
…e id gh and glab both accept several subcommands without an explicit id and resolve it from the current branch (gh pr view, gh pr checks, glab mr view) or open an interactive picker (gh run view). RTK was pre-rejecting with "X number required" before the underlying tool ever ran. Six call sites now treat the identifier as optional and forward the request unchanged, letting gh/glab decide: - gh pr view, gh pr checks, gh issue view, gh run view - glab mr view, glab issue view A new `parse_optional_identifier` helper in each file captures the "(Option<id>, Vec<extra>)" parse so the no-id branch is unit-testable. format_run_view also drops the dangling `#` from its header when the run id is empty (interactive-picker passthrough).
Contributor
Author
|
Hi @aeppling! Let me know please if anything is missing 🙏 |
Contributor
|
hey @B-Galati clean one LGTM, thanks for contributing to RTK :) |
aeppling
approved these changes
May 29, 2026
Merged
Contributor
Author
|
Thanks 🙏 |
social4hyq
pushed a commit
to social4hyq/homebrew-core
that referenced
this pull request
Sep 20, 2026
rtk 0.42.3 Created-by: HarmonybrewBot Commit-by: HarmonybrewBot Merged-by: HarmonybrewBot Description: Created by `brew bump` --- Created with `brew bump-formula-pr`.<details> <summary>release notes</summary> <pre>## [0.42.3](rtk-ai/rtk@v0.42.2...v0.42.3) (2026-06-05) ### Feats - feat(copilot): CLI native integration #2101 ### Fix - fix(docs): replace remaining MIT license references with Apache 2.0 [#2084](rtk-ai/rtk#2084) - fix: prevent crashes when output is piped rtk-ai/rtk#1048 close rtk-ai/rtk#1004 - fix(grep): parse single-file output containing colons rtk-ai/rtk#1554; close rtk-ai/rtk#1436. - fix(ls): preserve permission info as octal when -l/-la is passed rtk-ai/rtk#1675 - fix(cicd): MIT to Apache 2.0 [#2092](rtk-ai/rtk#2092) - fix(pkg): rtk is Apache 2.0 and no MIT [#2082](rtk-ai/rtk#2082) - fix(hook): collapse bash line continuations before matching #1572 close Hook matcher: leading backslash-newline defeats command rewrite #1564 - fix(gh,glab): don't pre-reject view/checks/run subcommands missing the id rtk-ai/rtk#2123 - fix(git): fix panic on multibyte chars in commit output rtk-ai/rtk#1266 ### Other - docs(readme): add Portuguese translation #2128 - doc(init): fix documentation inconsistencies arount rtk init rtk-ai/rtk#2173 - fix(provider): sanatize more chars when encoding claude code project pathes https://github.com/rtk-ai/rtk/pull/2172</pre> <p>View the full release notes at <a href="https://github.com/rtk-ai/rtk/releases/tag/v0.42.3">https://github.com/rtk-ai/rtk/releases/tag/v0.42.3</a>.</p> </details> <hr> See merge request: Harmonybrew/homebrew-core!10665
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.
Problem
ghandglabaccept several subcommands without an explicit id and resolve it from the current branch (or open an interactive picker). RTK was pre-rejecting these with"X number required"before the underlying tool ever ran.Example:
…even though
glab mr view(no args) is valid and looks up the MR for the current branch.Fix
Six call sites in
gh_cmd.rs/glab_cmd.rsnow treat the identifier as optional and forward the request unchanged, lettinggh/glabdecide:gh pr view,gh pr checks,gh issue view,gh run viewglab mr view,glab issue viewA new private
parse_optional_identifierhelper in each file captures the(Option<id>, Vec<extra>)parse so the no-id branch is unit-testable.format_run_viewalso drops the dangling#from its header when the run id is empty (interactive-picker passthrough).Tests
8 new unit tests (1954 total, all passing):
parse_optional_identifier— empty / flags-only / with-id paths × 2 filesformat_run_view— with and without an idEnd-to-end verified on
glab mr view(now defers to glab; in this repo glab returns its own "no GitLab remote configured" message instead of RTK's pre-rejection).