feat(rust): port ci git-refs and ci queue-info to native Rust (Phase 1.6)#1302
Conversation
This was referenced Apr 23, 2026
Member
Author
|
This pull request is part of a Mergify stack:
|
This was referenced Apr 23, 2026
Contributor
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🔴 ⛓️ Depends-On RequirementsWaiting for:
This rule is failing.Requirement based on the presence of
🔴 👀 Review RequirementsWaiting for:
This rule is failing.
🔴 🔎 ReviewsWaiting for:
This rule is failing.
🟢 🤖 Continuous IntegrationWonderful, this rule succeeded.
🟢 Enforce conventional commitWonderful, this rule succeeded.Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
🟢 📕 PR descriptionWonderful, this rule succeeded.
|
…1.6) Adds `github_event` (GitHub Actions event payload deserialization) and `queue_metadata` (MQ YAML fenced-block extraction) shared modules to the mergify-ci crate, and ports two commands on top of them: - `ci queue-info` — prints MQ batch metadata as pretty JSON; errors INVALID_STATE (exit 7) outside an MQ context. Appends to `$GITHUB_OUTPUT` with the same `ghadelimiter_<uuid>` heredoc the Python version uses. - `ci git-refs` — detects base/head refs from Buildkite env, GitHub event payload, `refs/notes/mergify/<branch>` git notes, MQ PR body, or falls back to `HEAD^..HEAD`. Supports `text`/`shell`/`json` output formats, writes `base`/`head` to `$GITHUB_OUTPUT`, and calls `buildkite-agent meta-data set` when `BUILDKITE=true`. 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`. PORT_STATUS.toml flips both entries to `native`. The looks-native heuristic in `main.rs` learns the two new subcommand names so argv errors surface as clap exit 2 instead of silently falling through to the Python shim. Adds `serde_yaml_ng` (YAML parser) and `uuid` (ghadelimiter) deps to the mergify-ci crate. Binary grows ~100KB to 8.6MB. 19 new Rust tests (8 event/metadata, 3 queue-info, 12 git-refs + 2 format round-trips merged in). Full workspace: 79 tests green, compat harness 4/4, port-inventory guard 4/4. Change-Id: I8d3f96e6cb4eb51e6cd195951b3e622cee7efdd4
c9705cd to
9117fc7
Compare
8cb0904 to
45e5380
Compare
Member
Author
Revision history
|
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.
Adds
github_event(GitHub Actions event payload deserialization) andqueue_metadata(MQ YAML fenced-block extraction) shared modules to themergify-ci crate, and ports two commands on top of them:
ci queue-info— prints MQ batch metadata as pretty JSON; errorsINVALID_STATE (exit 7) outside an MQ context. Appends to
$GITHUB_OUTPUTwith the sameghadelimiter_<uuid>heredoc thePython version uses.
ci git-refs— detects base/head refs from Buildkite env, GitHubevent payload,
refs/notes/mergify/<branch>git notes, MQ PR body,or falls back to
HEAD^..HEAD. Supportstext/shell/jsonoutput formats, writes
base/headto$GITHUB_OUTPUT, and callsbuildkite-agent meta-data setwhenBUILDKITE=true.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.PORT_STATUS.toml flips both entries to
native. The looks-nativeheuristic in
main.rslearns the two new subcommand names so argverrors surface as clap exit 2 instead of silently falling through to
the Python shim.
Adds
serde_yaml_ng(YAML parser) anduuid(ghadelimiter) deps tothe mergify-ci crate. Binary grows ~100KB to 8.6MB.
19 new Rust tests (8 event/metadata, 3 queue-info, 12 git-refs + 2
format round-trips merged in). Full workspace: 79 tests green,
compat harness 4/4, port-inventory guard 4/4.
Depends-On: #1301