Skip to content

merge queue: embarking main (45b7a13), #1223 and #1242 together#1245

Closed
mergify[bot] wants to merge 4 commits intomainfrom
mergify/merge-queue/023784b9c5
Closed

merge queue: embarking main (45b7a13), #1223 and #1242 together#1245
mergify[bot] wants to merge 4 commits intomainfrom
mergify/merge-queue/023784b9c5

Conversation

@mergify
Copy link
Copy Markdown
Contributor

@mergify mergify Bot commented Apr 20, 2026

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

Branch main (45b7a13), #1223 and #1242 are embarked together for merge.

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

sileht and others added 4 commits April 19, 2026 00:36
Lets users consume detected refs in scripts without awk-parsing. Shell
format emits MERGIFY_GIT_REFS_{BASE,HEAD,SOURCE}=... lines suitable for
`eval`, with shlex-quoted values; json emits a single-line object.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Change-Id: I10e0ba970faf5e0b6e69d72544dba4835e72ca8d
Establishes typed exit codes across the CLI as preparation for the
upcoming Python→Rust port, and migrates every semantic error path
to use them.

## Foundation

- `MergifyError(click.ClickException)`: CLI-level error with a typed
  per-instance `exit_code` (ExitCode IntEnum). Click's standalone-mode
  handler catches it automatically and exits with the typed code, so
  `main()` needs no extra except clause.
- `show()` writes "error: <msg>" in red to stderr via `click.secho`,
  matching the behavior of `click.ClickException`. Honors click's
  `file` parameter when provided.

## Migrations

- `config/cli.py`: 7 `click.ClickException` raises -> `MergifyError`
  (CONFIGURATION_ERROR / MERGIFY_API_ERROR / GENERIC_ERROR); the
  schema-validation-errors path now uses `ctx.exit()` after printing
  the per-error details (avoids a redundant "error: ..." line).
  Invalid PR URL -> `click.BadParameter` (exit 2 - argument error).
- `ci/cli.py`: 5 `click.ClickException` raises -> `MergifyError`
  (scopes / scopes_send -> CONFIGURATION_ERROR; queue_info outside
  a merge queue context -> INVALID_STATE).
- `stack/{open,push,checkout}.py`: bare `sys.exit(0)` ->
  `sys.exit(ExitCode.SUCCESS)` for uniformity.
- junit-process: pinned the existing GENERIC_ERROR exits against
  regression (invalid XML, empty reports).

## Tests

- Round-trip: every ExitCode value round-trips through MergifyError.
- Integration: click's standalone-mode translates MergifyError to
  the typed exit code via both CliRunner and the real `main()`.
- Parametrized cross-command contract walker pins the config and ci
  failure modes; per-command tests cover stack and queue.

## UX impact

Semantic failures now exit with a typed code instead of bare 1.
Scripts relying on `exit == 1` for config or ci-scopes errors need
updating. `config simulate` with an invalid PR URL now exits 2
(click.BadParameter) rather than 1.

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

Change-Id: I4d526fbf31d854b4c4fd4bbf0bcebdbcf79d5368
@mergify mergify Bot deployed to Mergify Merge Protections April 20, 2026 10:11 Active
@mergify mergify Bot closed this Apr 20, 2026
@mergify mergify Bot deleted the mergify/merge-queue/023784b9c5 branch April 20, 2026 10:16
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.

2 participants