Skip to content

merge queue: embarking main (3a99878) and #1439 together#1471

Closed
mergify[bot] wants to merge 3 commits into
mainfrom
mergify/merge-queue/ac5858d0a3
Closed

merge queue: embarking main (3a99878) and #1439 together#1471
mergify[bot] wants to merge 3 commits into
mainfrom
mergify/merge-queue/ac5858d0a3

Conversation

@mergify
Copy link
Copy Markdown
Contributor

@mergify mergify Bot commented May 27, 2026

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

Branch main (3a99878) and #1439 are embarked together for merge.

This pull request has been created by Mergify to speculatively check the mergeability of #1439.
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: 3a998785f4e51605e1d3775a093fa522ddf3b8fc
previous_failed_batches: []
pull_requests:
  - number: 1439
    scopes: []
scopes: []
...

jd and others added 3 commits May 27, 2026 10:20
… Python

Two coupled gaps the same user-visible bug was hiding:

1. The Rust binary never declared the top-level `--debug` flag the
   Python CLI accepts. Invocations like `mergify --debug ci git-refs`
   were rejected with `error: unexpected argument '--debug' found`
   the moment a command was promoted from shim to native. Add
   `debug: bool` as a `global = true` argument on `CliRoot`; native
   commands accept it as a no-op (no native code path consults the
   flag yet) and shimmed dispatches re-inject `--debug` at the front
   of the forwarded argv so the Python `cli` group still receives it.

2. The Python `cli.py` parsed `--debug` into `ctx.obj["debug"]` but
   never called `utils.set_debug(...)`, so the module-level `_DEBUG`
   toggle stayed `False` and the 6+ `if is_debug():` sites in
   `utils.py` / `stack/*` never fired regardless of the flag. Wire
   `set_debug(debug=debug)` from the root group so the flag has the
   effect users have always expected it to have.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Change-Id: I62ac941db12c55c988896086d7042c3dacf863af
Every command crate's test module re-rolled the same ~30 LOC of
`SharedBytes` / `SharedWriter` / `Captured` / `make_output` glue —
about 350 LOC of pure boilerplate across 15 files, drifting over
time (some `Captured` had `stderr`, some didn't; one file even
carried a `_stderr_accessor_lives` dead-code stub just to silence
the resulting warning).

Extract the canonical version into a new `mergify-test-support`
crate that other crates pull in as a `dev-dependencies`. The new
`Captured` API exposes `human()` / `new(mode)` constructors and
`stdout()` / `stderr()` accessors, so the common pattern shrinks
from a 12-line `String::from_utf8(cap.stdout.lock().unwrap().clone())`
to `let s = cap.stdout()`.

Net `-418 / +114` lines across the workspace. Behavior unchanged;
all 233 tests pass.

The crate is `publish = false` and only ever appears under
`[dev-dependencies]`, so the test-only types never leak into a
production build.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Change-Id: If9d688cdaf55360ba90f386d2020b52346c19b28
@mergify mergify Bot deployed to Mergify Merge Protections May 27, 2026 13:34 Active
@mergify mergify Bot temporarily deployed to func-tests-live May 27, 2026 13:34 Inactive
@mergify mergify Bot closed this May 27, 2026
@mergify mergify Bot deleted the mergify/merge-queue/ac5858d0a3 branch May 27, 2026 13:50
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