Skip to content

merge queue: embarking main (301ae09) and #1380 together#1402

Closed
mergify[bot] wants to merge 2 commits into
mainfrom
mergify/merge-queue/bdb8ac972e
Closed

merge queue: embarking main (301ae09) and #1380 together#1402
mergify[bot] wants to merge 2 commits into
mainfrom
mergify/merge-queue/bdb8ac972e

Conversation

@mergify
Copy link
Copy Markdown
Contributor

@mergify mergify Bot commented May 11, 2026

🎉 This pull request has been checked successfully and will be merged soon. 🎉

Branch main (301ae09) and #1380 are embarked together for merge.

This pull request has been created by Mergify to speculatively check the mergeability of #1380.
You don't need to do anything. Mergify will close this pull request automatically when it is complete.

Required conditions of queue rule default for merge:

Required conditions to stay in the queue:

---
checking_base_sha: 301ae095c6c7ae056a2da70d82e42c654e993cc5
previous_failed_batches: []
pull_requests:
  - number: 1380
    scopes: []
scopes: []
...

jd and others added 2 commits May 11, 2026 09:13
…ands

Reported by user: ``mergify queue status --help`` rejected the
flag with ``error: unexpected argument '--help' found``. Root
cause: ``CliRoot`` had ``disable_help_flag = true``, so clap's
auto-generated ``--help`` machinery wasn't wired up — and our
``detect_native`` then surfaced the resulting parser error
(because ``looks_native`` matched) instead of falling through.

Three changes:

1. Drop ``disable_help_flag = true`` from ``CliRoot``. clap now
   auto-recognizes ``-h`` / ``--help`` at every level and
   generates its standard help blurb listing flags + subcommands.

2. ``detect_native`` catches the special help-error kinds
   (``DisplayHelp`` and
   ``DisplayHelpOnMissingArgumentOrSubcommand``) explicitly and
   calls ``err.exit()`` regardless of the ``looks_native``
   heuristic. ``err.exit()`` prints help to stdout and calls
   ``process::exit(0)``. The previous flow also called
   ``err.exit()`` on parser errors when ``looks_native``, but it
   only fired when the argv contained a (group, subcommand) pair
   — root-level ``mergify --help`` had no such pair so it would
   have leaked to the Python shim.

3. Honor ``MERGIFY_CLI_TESTING_UTF8_MODE`` from the Rust binary.
   ``test_binary_build.py`` runs ``mergify --help`` against the
   wheel-installed binary to verify UTF-8 emoji output works
   (particularly on Windows). The marker used to be printed by
   ``mergify_cli/cli.py::main``, but now that ``--help`` is
   handled natively the Python path no longer fires. Mirror the
   marker from the Rust binary: the binary is UTF-8 native on
   every platform (no ``os.execv`` re-exec needed), so report
   ``utf8_mode=1`` on Windows (matching the post-re-exec value
   the test expects) and ``utf8_mode=0`` elsewhere.

Verified locally:

- ``mergify --help`` lists the three native top-level groups
  (``config`` / ``ci`` / ``queue``).
- ``mergify queue --help`` lists the native queue subcommands
  (``pause`` / ``unpause`` / ``status``).
- ``mergify queue status --help`` shows ``--branch`` / ``--json``
  / ``--token`` / ``--api-url`` / ``--repository`` with their
  doc-strings.
- ``MERGIFY_CLI_TESTING_UTF8_MODE=1 mergify --help`` prints
  ``utf8_mode=0`` and ``✅`` before the help text.

Known follow-up: ``mergify queue --help`` doesn't list ``show``
because it's still shimmed (no clap variant). Fixable by
registering opaque clap stubs for shimmed commands; deferred to
the PR that ports ``queue show``.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Change-Id: I2922aa2d83af6c99cb551f2a95bf5a4959832375
@mergify mergify Bot deployed to Mergify Merge Protections May 11, 2026 09:50 Active
@mergify mergify Bot temporarily deployed to func-tests-live May 11, 2026 09:50 Inactive
@mergify mergify Bot closed this May 11, 2026
@mergify mergify Bot deleted the mergify/merge-queue/bdb8ac972e branch May 11, 2026 10:04
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.

1 participant