fix(cli): make mergify --help list Python-shimmed commands too#1452
Merged
mergify[bot] merged 1 commit intoMay 21, 2026
Conversation
`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
Member
Author
|
This pull request is part of a Mergify stack:
|
This was referenced May 21, 2026
Contributor
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🟢 🤖 Continuous IntegrationWonderful, this rule succeeded.
🟢 👀 Review RequirementsWonderful, this rule succeeded.
🟢 Enforce conventional commitWonderful, this rule succeeded.Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
🟢 🔎 ReviewsWonderful, this rule succeeded.
🟢 📕 PR descriptionWonderful, this rule succeeded.
|
There was a problem hiding this comment.
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
Dispatchoutcome (NativevsShim) 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.
sileht
approved these changes
May 21, 2026
kozlek
approved these changes
May 21, 2026
Contributor
Merge Queue Status
This pull request spent 26 seconds in the queue, including 2 seconds running CI. Required conditions to merge
|
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.
mergify --helpshipped to users dropped half the CLI off thehelp screen: clap only knew about the natively-ported groups
(
config,ci,queue,freeze), so the still-shimmedstackgroup disappeared from the listing. The same gap hitmergify ci --help— it showed three native subcommands andomitted
scopes,junit-process,junit-upload. Deferring toPython wouldn't have fixed it either: Python's CLI no longer
registers
configorqueue(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>:Stack(ShimmedArgs)ci:Scopes,JunitProcess,JunitUploadStub variants have
disable_help_flag = true, so--helpfallsinto
argsinstead of triggering clap's stub help — meaningmergify stack --helpandmergify ci scopes --helppassthrough to Python and surface the real per-command help.
Dispatch grows a new outcome:
Dispatch::Native(cmd)forin-process execution,
Dispatch::Shim(argv)for "forward thisto Python." The previous
Option<NativeCommand>becomesOption<Dispatch>.After this:
mergify --helplistsconfig | ci | queue | freeze | stack.mergify ci --helplists all 6 subcommands (3 native + 3 shimmed).mergify stack --helpshows Python's full stack help.mergify queue status --helpstill uses clap's native help.Co-Authored-By: Claude Opus 4.7 noreply@anthropic.com