feat(ci): promote ci junit-process and its junit-upload alias 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
70d22a9 to
ee35991
Compare
e901cae to
0e3e818
Compare
0e3e818 to
19c0db2
Compare
ee35991 to
951ac81
Compare
ci junit-process from shim to native Rustci junit-process and its junit-upload alias to native Rust
951ac81 to
dce251a
Compare
dce251a to
b592eb8
Compare
19c0db2 to
0963560
Compare
b592eb8 to
741009a
Compare
0963560 to
63a2a41
Compare
sileht
previously approved these changes
May 29, 2026
…native Rust
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 both `ci junit-process` and its deprecated alias
`ci junit-upload`.
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 both
`Subcommands::Ci(CiSubcommand::JunitProcess)` and
`Subcommands::Ci(CiSubcommand::JunitUpload)` from `ShimmedArgs`
to full clap variants sharing the same `JunitProcessCliArgs`
(args are identical), adds the `("ci", "junit-process")` and
`("ci", "junit-upload")` entries to `NATIVE_COMMANDS`, and routes
both through `mergify_ci::junit_process::run`. The `junit-upload`
arm prints a `DeprecationWarning: 'junit-upload' is deprecated,
use 'junit-process' instead.` line to stderr before forwarding —
matching the click `deprecated="…"` decorator the Python side
used.
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.
With this commit the entire `ci` group is native — every
`Subcommand` variant dispatches in-process, and the
`ci junit-process` / `ci junit-upload` Python implementations
(and the `_internal junit-parse` / `_internal junit-upload`
bridges introduced in the two previous PRs) are no longer
load-bearing. They stay in the wheel for one release as a safety
net; the cleanup follow-up removes them along with the
`opentelemetry-sdk` Python dep.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Change-Id: I6bd59de407ddcd4196bdd7e7b8ddb4a88885af7a
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.
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 both
ci junit-processand its deprecated aliasci junit-upload.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.rspromotes bothSubcommands::Ci(CiSubcommand::JunitProcess)andSubcommands::Ci(CiSubcommand::JunitUpload)fromShimmedArgsto full clap variants sharing the same
JunitProcessCliArgs(args are identical), adds the
("ci", "junit-process")and("ci", "junit-upload")entries toNATIVE_COMMANDS, and routesboth through
mergify_ci::junit_process::run. Thejunit-uploadarm prints a
DeprecationWarning: 'junit-upload' is deprecated, use 'junit-process' instead.line to stderr before forwarding —matching the click
deprecated="…"decorator the Python sideused.
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.
With this commit the entire
cigroup is native — everySubcommandvariant dispatches in-process, and theci junit-process/ci junit-uploadPython implementations(and the
_internal junit-parse/_internal junit-uploadbridges introduced in the two previous PRs) are no longer
load-bearing. They stay in the wheel for one release as a safety
net; the cleanup follow-up removes them along with the
opentelemetry-sdkPython dep.Co-Authored-By: Claude Opus 4.7 noreply@anthropic.com
Depends-On: #1466