Skip to content

fix(cli): make mergify --help list Python-shimmed commands too#1452

Merged
mergify[bot] merged 1 commit into
mainfrom
devs/jd/worktree-rust-port/make-mergify-help-list-python-shimmed-cmds-too--6afee9ba
May 21, 2026
Merged

fix(cli): make mergify --help list Python-shimmed commands too#1452
mergify[bot] merged 1 commit into
mainfrom
devs/jd/worktree-rust-port/make-mergify-help-list-python-shimmed-cmds-too--6afee9ba

Conversation

@jd
Copy link
Copy Markdown
Member

@jd jd commented May 21, 2026

mergify --help shipped to users dropped half the CLI off the
help screen: clap only knew about the natively-ported groups
(config, ci, queue, freeze), so the still-shimmed
stack group disappeared from the listing. The same gap hit
mergify ci --help — it showed three native subcommands and
omitted scopes, junit-process, junit-upload. Deferring to
Python wouldn't have fixed it either: Python's CLI no longer
registers config or queue (those got removed when ported),
so its help is incomplete from the opposite side.

Fix by making clap the single source of truth. Register each
Python-shimmed command as a stub clap variant whose body is a
catch-all args: Vec<String>:

  • top level: Stack(ShimmedArgs)
  • ci: Scopes, JunitProcess, JunitUpload

Stub variants have disable_help_flag = true, so --help falls
into args instead of triggering clap's stub help — meaning
mergify stack --help and mergify ci scopes --help pass
through to Python and surface the real per-command help.

Dispatch grows a new outcome: Dispatch::Native(cmd) for
in-process execution, Dispatch::Shim(argv) for "forward this
to Python." The previous Option<NativeCommand> becomes
Option<Dispatch>.

After this:

  • mergify --help lists config | ci | queue | freeze | stack.
  • mergify ci --help lists all 6 subcommands (3 native + 3 shimmed).
  • mergify stack --help shows Python's full stack help.
  • mergify queue status --help still uses clap's native help.

Co-Authored-By: Claude Opus 4.7 noreply@anthropic.com

`mergify --help` shipped to users dropped half the CLI off the
help screen: clap only knew about the natively-ported groups
(`config`, `ci`, `queue`, `freeze`), so the still-shimmed
`stack` group disappeared from the listing. The same gap hit
`mergify ci --help` — it showed three native subcommands and
omitted `scopes`, `junit-process`, `junit-upload`. Deferring to
Python wouldn't have fixed it either: Python's CLI no longer
registers `config` or `queue` (those got removed when ported),
so its help is incomplete from the opposite side.

Fix by making clap the single source of truth. Register each
Python-shimmed command as a stub clap variant whose body is a
catch-all `args: Vec<String>`:

  - top level: `Stack(ShimmedArgs)`
  - `ci`: `Scopes`, `JunitProcess`, `JunitUpload`

Stub variants have `disable_help_flag = true`, so `--help` falls
into `args` instead of triggering clap's stub help — meaning
`mergify stack --help` and `mergify ci scopes --help` pass
through to Python and surface the real per-command help.

Dispatch grows a new outcome: `Dispatch::Native(cmd)` for
in-process execution, `Dispatch::Shim(argv)` for "forward this
to Python." The previous `Option<NativeCommand>` becomes
`Option<Dispatch>`.

After this:
- `mergify --help` lists `config | ci | queue | freeze | stack`.
- `mergify ci --help` lists all 6 subcommands (3 native + 3 shimmed).
- `mergify stack --help` shows Python's full stack help.
- `mergify queue status --help` still uses clap's native help.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Change-Id: I6afee9ba1e58856ca3a3261917cd2d1b8a20da81
Copilot AI review requested due to automatic review settings May 21, 2026 07:55
@mergify mergify Bot deployed to Mergify Merge Protections May 21, 2026 07:56 Active
@jd jd temporarily deployed to func-tests-live May 21, 2026 07:56 — with GitHub Actions Inactive
@jd
Copy link
Copy Markdown
Member Author

jd commented May 21, 2026

This pull request is part of a Mergify stack:

# Pull Request Link
1 fix(cli): make mergify --help list Python-shimmed commands too #1452 👈
2 test(freeze): add live smoke test for freeze create/update/delete #1436
3 feat(rust): port freeze create/update/delete to native Rust #1437
4 refactor(rust): dedupe emit-helper boilerplate across command crates #1438
5 refactor(rust): share test scaffolding via mergify-test-support crate #1439
6 refactor(core): introduce CommandContext for the queue+freeze prelude #1441
7 refactor(ci): consolidate the CI-env scrubber into a shared testing module #1442
8 refactor: drop stale Phase X.Y doc markers and one inline color branch #1443
9 refactor(tui): share StyledGlyph across queue show/status renderers #1444
10 refactor(queue): drop indexmap, group_by_scope returns a Vec<(K, V)> #1445
11 refactor(ci): swap uuid for getrandom in the GHA heredoc delimiter #1446
12 refactor(config): standardize the workspace on serde_yaml_ng for YAML parsing #1447

@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented May 21, 2026

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 🤖 Continuous Integration

Wonderful, this rule succeeded.
  • all of:
    • check-success=ci-gate

🟢 👀 Review Requirements

Wonderful, this rule succeeded.
  • any of:
    • #approved-reviews-by>=2
    • author = dependabot[bot]
    • author = mergify-ci-bot
    • author = renovate[bot]

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert|ui)(?:\(.+\))?:

🟢 🔎 Reviews

Wonderful, this rule succeeded.
  • #changes-requested-reviews-by = 0
  • #review-requested = 0
  • #review-threads-unresolved = 0

🟢 📕 PR description

Wonderful, this rule succeeded.
  • body ~= (?ms:.{48,})

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes missing commands in mergify --help (and mergify ci --help) by making the Rust/clap command tree the single source of truth for both Rust-native and still-Python-backed commands, while continuing to forward execution of shimmed commands to Python.

Changes:

  • Add clap “stub” variants for Python-shimmed commands (stack, ci scopes, ci junit-process, ci junit-upload) that capture all remaining args and forward them to Python (including --help).
  • Introduce a Dispatch outcome (Native vs Shim) so parsing can cleanly decide whether to run in-process or forward argv to the Python shim.
  • Update dispatching logic so clap-generated help lists the full CLI surface, while shimmed subcommand help is still rendered by the Python implementation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mergify mergify Bot requested a review from a team May 21, 2026 08:12
@mergify mergify Bot requested a review from a team May 21, 2026 08:12
@jd jd marked this pull request as ready for review May 21, 2026 09:33
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented May 21, 2026

Merge Queue Status

  • Entered queue2026-05-21 10:32 UTC · Rule: default
  • Checks skipped · PR is already up-to-date
  • Merged2026-05-21 10:32 UTC · at 6f1ee235dde01bfcd8f57d7429e2cf413d1a6691 · squash

This pull request spent 26 seconds in the queue, including 2 seconds running CI.

Required conditions to merge

@mergify mergify Bot added the queued label May 21, 2026
@mergify mergify Bot merged commit e2be985 into main May 21, 2026
20 checks passed
@mergify mergify Bot deleted the devs/jd/worktree-rust-port/make-mergify-help-list-python-shimmed-cmds-too--6afee9ba branch May 21, 2026 10:32
@mergify mergify Bot removed the queued label May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants