feat(ci): promote ci junit-process from shim to native Rust#1467
Conversation
This was referenced May 27, 2026
Member
Author
|
This pull request is part of a Mergify stack:
|
This was referenced May 27, 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.
|
8078737 to
ed7a74d
Compare
3a3d6cc to
ee06c7a
Compare
Member
Author
Revision history
|
ed7a74d to
6eeb3d9
Compare
ee06c7a to
0c646f7
Compare
6eeb3d9 to
6317d48
Compare
6317d48 to
a353a93
Compare
0c646f7 to
fa0eeaf
Compare
fa0eeaf to
dd1bfdf
Compare
a353a93 to
cc3c840
Compare
Third and final layer of the port: the orchestration that wires
the JUnit parser, OTLP encoder, uploader, and a new quarantine
API client together, plus the native clap dispatch that retires
the Python shim for this subcommand.
Two new modules under `junit_process`:
- `quarantine` POSTs failing test names to
`/v1/ci/<owner>/repositories/<repo>/quarantines/check` and
splits the response into quarantined / non-quarantined buckets.
The categorize step counts unknown names as non-quarantined to
match Python (an API that silently drops a name still blocks
the corresponding failure).
- `command::run` orchestrates the per-invocation flow: resolve
the token / repo / target branch (falling back to the CI-env
detector for the latter two), expand `**`/`*`/`?` patterns into
paths, parse every file, hit the quarantine endpoint, feed the
quarantined set into the OTLP builder so each case span gets
the right `cicd.test.quarantined` value at build time, upload
the gzipped protobuf, and render the report. Network failures
on quarantine or upload are non-fatal — the report calls them
out and the verdict still fires based on
`failing_tests_not_quarantined_count`.
The dispatch layer in `main.rs` promotes
`Subcommands::Ci(CiSubcommand::JunitProcess)` from
`ShimmedArgs` to a full clap variant, adds the
`("ci", "junit-process")` entry to `NATIVE_COMMANDS`, and routes
through `mergify_ci::junit_process::run`. `ci junit-upload`
(deprecated) keeps its shim.
The detector gains `get_tests_target_branch` (base ref OR head
ref) so the orchestrator can derive the branch the quarantine API
should look up tests on without round-tripping through Python.
Output is byte-for-byte the same as the Python implementation's
`process_junit_files` — same separators, same emoji, same
`Run ID`/`Exit code` lines, same `┌ … │ … └─` box-drawn failure
blocks. End-to-end smoke against the live `junit_fail.xml`
fixture exits 1 on a non-quarantined failure and 0 on an
all-pass run, matching Python's contract.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Change-Id: I6bd59de407ddcd4196bdd7e7b8ddb4a88885af7a
cc3c840 to
e5b9480
Compare
dd1bfdf to
2ecb8c2
Compare
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.
Third and final layer of the port: the orchestration that wires
the JUnit parser, OTLP encoder, uploader, and a new quarantine
API client together, plus the native clap dispatch that retires
the Python shim for this subcommand.
Two new modules under
junit_process:quarantinePOSTs failing test names to/v1/ci/<owner>/repositories/<repo>/quarantines/checkandsplits the response into quarantined / non-quarantined buckets.
The categorize step counts unknown names as non-quarantined to
match Python (an API that silently drops a name still blocks
the corresponding failure).
command::runorchestrates the per-invocation flow: resolvethe token / repo / target branch (falling back to the CI-env
detector for the latter two), expand
**/*/?patterns intopaths, parse every file, hit the quarantine endpoint, feed the
quarantined set into the OTLP builder so each case span gets
the right
cicd.test.quarantinedvalue at build time, uploadthe gzipped protobuf, and render the report. Network failures
on quarantine or upload are non-fatal — the report calls them
out and the verdict still fires based on
failing_tests_not_quarantined_count.The dispatch layer in
main.rspromotesSubcommands::Ci(CiSubcommand::JunitProcess)fromShimmedArgsto a full clap variant, adds the("ci", "junit-process")entry toNATIVE_COMMANDS, and routesthrough
mergify_ci::junit_process::run.ci junit-upload(deprecated) keeps its shim.
The detector gains
get_tests_target_branch(base ref OR headref) so the orchestrator can derive the branch the quarantine API
should look up tests on without round-tripping through Python.
Output is byte-for-byte the same as the Python implementation's
process_junit_files— same separators, same emoji, sameRun ID/Exit codelines, same┌ … │ … └─box-drawn failureblocks. End-to-end smoke against the live
junit_fail.xmlfixture exits 1 on a non-quarantined failure and 0 on an
all-pass run, matching Python's contract.
Co-Authored-By: Claude Opus 4.7 noreply@anthropic.com
Depends-On: #1466