merge queue: embarking main (8fcef7c) and #1405 together#1415
Closed
mergify[bot] wants to merge 3 commits into
Closed
merge queue: embarking main (8fcef7c) and #1405 together#1415mergify[bot] wants to merge 3 commits into
mergify[bot] wants to merge 3 commits into
Conversation
Pins the contract for ``mergify ci git-refs`` so a future Rust port can be validated against the same test that exercised the Python implementation. The next commit ports the command; this one lands first so it runs against Python at its own CI, then against Rust on rebase — same test, both ends of the port. The test runs in the existing live-tests harness but doesn't need the live token: ``ci git-refs`` is locally evaluated (no API call). The conftest fixture scrubs every CI provider env var and runs in a tmp dir, so the detector lands on its literal ``HEAD^..HEAD`` fallback path. The assertion checks for ``Base: HEAD^`` and ``Head: HEAD`` in stdout — output format that the Python and Rust implementations share verbatim. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Change-Id: Iae0e3fe5b4cc3b653529b80ae10bae6c83f3e53d
The Rust binary now serves ``mergify ci git-refs`` natively. The
Python implementation (``mergify_cli/ci/cli.py:git_refs``) and
its tests are removed in the same PR — port-and-delete keeps a
single live copy.
The previous commit landed a live-smoke test pinning the
``Base: HEAD^`` / ``Head: HEAD`` fallback contract. That same
test now exercises the Rust path.
The command detects the base/head git references for the
current build:
1. Buildkite env (``BUILDKITE_PULL_REQUEST`` and friends)
2. GitHub Actions event payload at ``$GITHUB_EVENT_PATH``
3. ``refs/notes/mergify/<branch>`` git notes (for merge-queue
draft PRs created by the Mergify backend)
4. The MQ PR body's YAML metadata block (fallback for tools
that can't read git notes)
5. Literal ``HEAD^..HEAD`` when none of the above match
Three output formats:
- ``text`` (default): ``Base: <ref>`` and ``Head: <ref>`` on
two lines.
- ``shell``: ``MERGIFY_GIT_REFS_{BASE,HEAD,SOURCE}=...`` lines
for ``eval``; values are properly shell-quoted.
- ``json``: a single JSON object ``{"base":..., "head":...,
"source":...}``.
The command also writes ``base=...\nhead=...`` to
``$GITHUB_OUTPUT`` when set, and calls ``buildkite-agent
meta-data set`` when ``BUILDKITE=true``.
This commit introduces two shared helper modules in the
``mergify-ci`` crate that the next port (``ci queue-info``)
will reuse:
- ``github_event``: GitHub Actions event payload deserialization
(``GITHUB_EVENT_PATH``).
- ``queue_metadata``: MQ YAML fenced-block extraction from PR
bodies and git notes.
The notes reader is injected as a trait-object callback so unit
tests can exercise the note-driven detection path without
touching a real git repository; the production path shells out
via ``real_notes_reader``.
Adds the ``serde_yaml_ng`` dep (YAML parser) to the
``mergify-ci`` crate.
12 new git-refs + 2 format round-trip tests plus 8
event/metadata tests in the shared helpers. The Python
git-refs tests in ``mergify_cli/tests/ci/test_cli.py`` are
removed.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Change-Id: I9a936b47b90f1128f6fdac6e4f29af6f1525a28c
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 (8fcef7c) and #1405 are embarked together for merge.
This pull request has been created by Mergify to speculatively check the mergeability of #1405.
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:depends-on = Mergifyio/mergify-cli#1404[⛓️ test(ci): add live smoke test for ci git-refs #1404]title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert|ui)(?:\(.+\))?:#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=maindepends-on = Mergifyio/mergify-cli#1404[⛓️ test(ci): add live smoke test for ci git-refs #1404]label!=manual mergetitle ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert|ui)(?:\(.+\))?:#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