Commit 98939da
committed
feat(rust): port ci git-refs and ci queue-info to native Rust (Phase 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: I8d3f96e6cb4eb51e6cd195951b3e622cee7efdd41 parent eec2488 commit 98939da
9 files changed
Lines changed: 1275 additions & 9 deletions
File tree
- crates
- mergify-ci
- src
- mergify-cli/src
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
0 commit comments