Skip to content

fix(gh): passthrough --help/-h on pr subcommands (#1474) - #1661

Closed
season179 wants to merge 15 commits into
rtk-ai:developfrom
season179:fix/gh-pr-help-passthrough-1474
Closed

season179 wants to merge 15 commits into
rtk-ai:developfrom
season179:fix/gh-pr-help-passthrough-1474

Conversation

@season179

Copy link
Copy Markdown

Closes #1474.

rtk gh pr comment --help returns ok commented, pr edit --help returns ok edited, and pr create --help stitches ok created onto mangled help text. pr view/checks/diff --help are also broken — they error with PR number required or drop output silently. Six of nine gh pr subcommands corrupt their help output.

Cause: pr_action and pr_create fabricate confirmations from ok_confirmation() regardless of stdout; view_pr/pr_checks require a positional PR number; pr_diff runs compact_diff over non-diff text. None of them check for --help/-h.

Fix: add a has_help_flag helper next to the existing has_json_flag, and short-circuit run_pr to passthrough when the flag is present. Same family as #720 / #730 — flag-aware passthrough at the dispatcher.

Verified locally on macOS / rtk 0.38.0:

subcommand before after
comment / edit ok commented / ok edited real help
create ok created + mangled help real help
view / checks PR number required real help
diff empty stdout real help
status / merge / list ✓ already worked ✓ unchanged

-h short flag also works. Filter path for non-help calls is unaffected (rtk gh pr list -L 3 still shows the compact format).

Test plan

  • 5 unit tests on has_help_flag (long, short, absent, substring resistance, --body=--help value form)
  • cargo fmt --all && cargo clippy --all-targets -- -D unsafe_code && cargo test --all — 1691 + 5 new pass
  • Live binary check across all 9 gh pr subcommands
  • Regression sanity: filtered rtk gh pr list output unchanged

aeppling and others added 15 commits April 17, 2026 09:44
…master--components--rtk

chore(master): release 0.37.0
…master--components--rtk

chore(master): release 0.37.1
…master--components--rtk

chore(master): release 0.37.2
hotfix(cicd): add git app for release please token
hotfix(cicd): github app token for write actions
…master--components--rtk

chore(master): release 0.38.0
pr_action and pr_create fabricate ok confirmations regardless of stdout,
and view_pr/pr_checks/pr_diff assume specific output formats — all six
mangle gh's help text. Add a has_help_flag check at the top of run_pr
so --help/-h short-circuits to passthrough.
@CLAassistant

CLAassistant commented May 1, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@pszymkowiak pszymkowiak added bug Something isn't working effort-small Quelques heures, 1 fichier filter-quality Filter produces incorrect/truncated signal good first issue Good for newcomers labels May 1, 2026
@pszymkowiak

Copy link
Copy Markdown
Collaborator

[w] wshm · Automated triage by AI

📊 Automated PR Analysis

🐛 Type bug-fix
🟢 Risk low

Summary

Fixes six of nine gh pr subcommands whose --help/-h output was corrupted by rtk filters fabricating confirmations or requiring positional args. Adds a has_help_flag helper and short-circuits run_pr to passthrough when the flag is present, letting gh print its native help text.

Review Checklist

  • Tests present
  • Breaking change
  • Docs updated

Linked issues: #1474


Analyzed automatically by wshm · This is an automated analysis, not a human review.

@dergachoff

Copy link
Copy Markdown

bumping this pr since issue is very annoying

@KuSh

KuSh commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator

Closing this in favour of #4348, which fixes #1474 for every gh pr subcommand by handing --help and -h to gh before any filter runs, and does the same for the other wrapped tools with tests against the real binaries. Review or comments are welcome on #4348, or reply here if your scope differs.

@KuSh KuSh closed this Oct 10, 2026
@KuSh KuSh added the duplicate This issue or pull request already exists label Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working duplicate This issue or pull request already exists effort-small Quelques heures, 1 fichier filter-quality Filter produces incorrect/truncated signal good first issue Good for newcomers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rtk gh pr comment --help outputs ok commented — filter discards stdout unconditionally

6 participants