merge queue: embarking main (45b7a13), #1223 and #1242 together#1245
Closed
mergify[bot] wants to merge 4 commits intomainfrom
Closed
merge queue: embarking main (45b7a13), #1223 and #1242 together#1245mergify[bot] wants to merge 4 commits intomainfrom
mergify[bot] wants to merge 4 commits intomainfrom
Conversation
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
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.
🎉 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
defaultfor merge:title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?:#approved-reviews-by>=2author = dependabot[bot]author = mergify-ci-botauthor = renovate[bot]body ~= (?ms:.{48,})#changes-requested-reviews-by = 0#review-requested = 0#review-threads-unresolved = 0check-success=ci-gateRequired conditions to stay in the queue:
base=mainlabel!=manual mergetitle ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?:#approved-reviews-by>=2author = dependabot[bot]author = mergify-ci-botauthor = renovate[bot]body ~= (?ms:.{48,})#changes-requested-reviews-by = 0#review-requested = 0#review-threads-unresolved = 0check-success=ci-gate