Skip to content

merge queue: embarking main (783c7d0), #1265 and #1246 together#1277

Closed
mergify[bot] wants to merge 6 commits intomainfrom
mergify/merge-queue/30972f4f61
Closed

merge queue: embarking main (783c7d0), #1265 and #1246 together#1277
mergify[bot] wants to merge 6 commits intomainfrom
mergify/merge-queue/30972f4f61

Conversation

@mergify
Copy link
Copy Markdown
Contributor

@mergify mergify Bot commented Apr 21, 2026

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

Branch main (783c7d0), #1265 and #1246 are embarked together for merge.

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

jd and others added 6 commits April 20, 2026 15:58
Adds two helpers to mergify_cli/stack/reorder.py, used by the new
squash and fixup commands:

- run_action_rebase reorders picks to a desired sha order (same as
  run_rebase) and additionally rewrites pick -> squash|fixup for shas
  listed in actions. An optional exec_after_sha + exec_command pair
  inserts an "exec <cmd>" line right after the named sha's row — used
  by squash to amend the combined commit's message while HEAD still
  points at it.
- display_action_plan prints the plan tagged with each commit's action.

run_rebase now delegates to run_action_rebase with an empty actions
dict to avoid duplicating the embedded rebase-todo rewrite script.

No user-facing behavior change — preparation for the fixup and squash
commands.

Change-Id: I560beaa3ed28ee211f601d15e550411fbe8107c4
Add "mergify stack fixup COMMIT..." which folds each listed commit into
its parent inside the stack (dropping its message) without opening an
editor. Multiple commits can be listed: each folds into its own parent.

Errors when a listed commit is first-in-stack, unknown, or duplicated.
Supports --dry-run.

Change-Id: I98a90fd7225be7b88ce2e879a0576f36d7f19d0b
Pins the JSON output shape of `mergify stack list --json` so any
drift is caught in CI. The Rust port will reuse this model as its
output schema, and downstream scripts that parse this output get a
stable contract.

- New `mergify_cli/stack/list_schema.py` with Pydantic BaseModels
  mirroring StackListOutput.to_dict(). extra="forbid" rejects any
  new/renamed/removed fields or wrong types.
- test_stack_list_json_output now validates parsed output against
  StackListJsonOutput. Failing here means either the code drifted
  (needs revert) or the shape changed intentionally (update both
  the dataclass and the schema in one commit, treat as a breaking
  change for consumers).

`freeze list`, `queue status`, `queue show` are deliberately NOT
locked: their JSON output is a passthrough of the Mergify API
response, so the schema is the API's contract, not this CLI's.
Added inline comments documenting that invariant so the Rust port
preserves the passthrough behavior without introducing
transformations.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Change-Id: I72306d8596c6ca7c4f2f562fc1298244417a57b3
Introduces a named test helper, ``assert_stdout_is_single_json_document``,
and wires it into the four ``--json`` tests (``stack list``,
``queue status``, ``queue show``, ``freeze list``).

The helper asserts that stdout under ``--json`` mode contains
exactly one JSON document — no banners, no progress lines, no
trailing text. Functionally identical to ``json.loads(stdout)``
(which already rejects trailing non-whitespace), but the helper
gives future readers a clearly-named invariant to grep for and
produces an explanatory failure message instead of a raw
``JSONDecodeError``.

Nothing to fix in production code: a sweep of ``console.print``,
``click.echo``, and ``print()`` call sites found no leaks into the
``--json`` code paths. Recent fixes on main (e.g. 7adb94b) already
cleaned up known cases. This PR exists to keep the invariant
visible so future changes don't quietly regress it.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Change-Id: I5a37d5c1b0373eb00a0b61e90bdadf482e8693dd
@mergify mergify Bot deployed to Mergify Merge Protections April 21, 2026 07:52 Active
@mergify mergify Bot closed this Apr 21, 2026
@mergify mergify Bot deleted the mergify/merge-queue/30972f4f61 branch April 21, 2026 07:59
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