Skip to content

feat(ci): promote ci junit-process and its junit-upload alias to native Rust#1467

Open
jd wants to merge 1 commit into
devs/jd/worktree-rust-port/encode-junit-cases-otlp-upload-mergify-ci-insights--cbc72716from
devs/jd/worktree-rust-port/promote-ci-junit-process-shim-native-rust--6bd59de4
Open

feat(ci): promote ci junit-process and its junit-upload alias to native Rust#1467
jd wants to merge 1 commit into
devs/jd/worktree-rust-port/encode-junit-cases-otlp-upload-mergify-ci-insights--cbc72716from
devs/jd/worktree-rust-port/promote-ci-junit-process-shim-native-rust--6bd59de4

Conversation

@jd
Copy link
Copy Markdown
Member

@jd jd commented May 27, 2026

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

Depends-On: #1466

@jd
Copy link
Copy Markdown
Member Author

jd commented May 27, 2026

This pull request is part of a Mergify stack:

# Pull Request Link
1 feat(ci): swap Python's OTLP encode+upload for the native Rust pipeline #1466
2 feat(ci): promote ci junit-process and its junit-upload alias to native Rust #1467 👈

@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented May 27, 2026

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🔴 ⛓️ Depends-On Requirements

Waiting for

This rule is failing.

Requirement based on the presence of Depends-On in the body of the pull request

🔴 👀 Review Requirements

Waiting for

  • #approved-reviews-by>=2
This rule is failing.
  • any of:
    • #approved-reviews-by>=2
    • author = dependabot[bot]
    • author = mergify-ci-bot
    • author = renovate[bot]

🔴 🔎 Reviews

Waiting for

  • #review-requested = 0
This rule is failing.
  • #review-requested = 0
  • #changes-requested-reviews-by = 0
  • #review-threads-unresolved = 0

🟢 🤖 Continuous Integration

Wonderful, this rule succeeded.
  • all of:
    • check-success=ci-gate

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert|ui)(?:\(.+\))?:

🟢 📕 PR description

Wonderful, this rule succeeded.
  • body ~= (?ms:.{48,})

@jd jd force-pushed the devs/jd/worktree-rust-port/promote-ci-junit-process-shim-native-rust--6bd59de4 branch from 8078737 to ed7a74d Compare May 27, 2026 08:27
@jd jd force-pushed the devs/jd/worktree-rust-port/encode-junit-cases-otlp-upload-mergify-ci-insights--cbc72716 branch from 3a3d6cc to ee06c7a Compare May 27, 2026 08:27
@jd jd temporarily deployed to func-tests-live May 27, 2026 08:27 — with GitHub Actions Inactive
@jd jd temporarily deployed to func-tests-live May 27, 2026 08:27 — with GitHub Actions Inactive
@jd
Copy link
Copy Markdown
Member Author

jd commented May 27, 2026

Revision history

# Type Changes Reason Date
1 initial 8078737 2026-05-27 08:27 UTC
2 content 8078737 → ed7a74d 2026-05-27 08:27 UTC
3 content ed7a74d → 6eeb3d9 2026-05-27 08:46 UTC
4 content 6eeb3d9 → 6317d48 (raw) 2026-05-27 09:00 UTC
5 rebase 6317d48 → a353a93 (rebase only) 2026-05-27 09:18 UTC
6 rebase a353a93 → cc3c840 (rebase only) 2026-05-27 10:04 UTC
7 rebase cc3c840 → e5b9480 (rebase only) 2026-05-27 10:15 UTC
8 rebase 5474036 → 70d22a9 (rebase only) 2026-05-28 08:20 UTC
9 content 70d22a9 → ee35991 (raw) Update parse_all in command.rs to build ParseResult with the new suite_names field, introduced in the Phase A swap. 2026-05-28 09:45 UTC
10 content ee35991 → 951ac81 (raw) Update parse_all / UploadMetadata construction in command.rs for the new spans.rs API (build_traces returns Result; UploadMetadata gains run_id field). Both came in via the Phase B Python bridge work. 2026-05-28 10:21 UTC
11 content 951ac81 → dce251a (raw) Fold the deprecated 'ci junit-upload' alias promotion (previously #1468) into this commit. The alias is trivial (one extra clap variant + DeprecationWarning stderr line) and dispatches to the same or… 2026-05-28 11:40 UTC
12 rebase dce251a → b592eb8 (rebase only) 2026-05-29 06:35 UTC
13 rebase b592eb8 → 741009a (rebase only) 2026-05-29 08:31 UTC
14 rebase 741009a → b7bb5a5 (rebase only) 2026-05-29 11:32 UTC
15 content b7bb5a5 → 929b2cc (raw) 2026-05-29 14:03 UTC

@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 27, 2026 08:28 Failure
@jd jd force-pushed the devs/jd/worktree-rust-port/promote-ci-junit-process-shim-native-rust--6bd59de4 branch from ed7a74d to 6eeb3d9 Compare May 27, 2026 08:46
@jd jd force-pushed the devs/jd/worktree-rust-port/encode-junit-cases-otlp-upload-mergify-ci-insights--cbc72716 branch from ee06c7a to 0c646f7 Compare May 27, 2026 08:46
@jd jd temporarily deployed to func-tests-live May 27, 2026 08:46 — with GitHub Actions Inactive
@jd jd temporarily deployed to func-tests-live May 27, 2026 08:46 — with GitHub Actions Inactive
@jd jd temporarily deployed to func-tests-live May 27, 2026 08:46 — with GitHub Actions Inactive
@jd jd temporarily deployed to func-tests-live May 28, 2026 08:20 — with GitHub Actions Inactive
@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 28, 2026 08:21 Failure
@jd jd force-pushed the devs/jd/worktree-rust-port/promote-ci-junit-process-shim-native-rust--6bd59de4 branch from 70d22a9 to ee35991 Compare May 28, 2026 09:45
@jd jd force-pushed the devs/jd/worktree-rust-port/encode-junit-cases-otlp-upload-mergify-ci-insights--cbc72716 branch from e901cae to 0e3e818 Compare May 28, 2026 09:45
@jd jd temporarily deployed to func-tests-live May 28, 2026 09:45 — with GitHub Actions Inactive
@jd jd temporarily deployed to func-tests-live May 28, 2026 09:45 — with GitHub Actions Inactive
@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 28, 2026 09:45 Failure
@jd jd force-pushed the devs/jd/worktree-rust-port/encode-junit-cases-otlp-upload-mergify-ci-insights--cbc72716 branch from 0e3e818 to 19c0db2 Compare May 28, 2026 10:21
@jd jd force-pushed the devs/jd/worktree-rust-port/promote-ci-junit-process-shim-native-rust--6bd59de4 branch from ee35991 to 951ac81 Compare May 28, 2026 10:21
@jd jd temporarily deployed to func-tests-live May 28, 2026 10:21 — with GitHub Actions Inactive
@jd jd temporarily deployed to func-tests-live May 28, 2026 10:21 — with GitHub Actions Inactive
@jd jd temporarily deployed to func-tests-live May 28, 2026 10:21 — with GitHub Actions Inactive
@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 28, 2026 10:21 Failure
@jd jd changed the title feat(ci): promote ci junit-process from shim to native Rust feat(ci): promote ci junit-process and its junit-upload alias to native Rust May 28, 2026
@jd jd force-pushed the devs/jd/worktree-rust-port/promote-ci-junit-process-shim-native-rust--6bd59de4 branch from 951ac81 to dce251a Compare May 28, 2026 11:40
@jd jd temporarily deployed to func-tests-live May 28, 2026 11:40 — with GitHub Actions Inactive
@jd jd temporarily deployed to func-tests-live May 28, 2026 11:40 — with GitHub Actions Inactive
@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 28, 2026 11:41 Failure
@jd jd marked this pull request as ready for review May 28, 2026 11:57
@jd jd force-pushed the devs/jd/worktree-rust-port/promote-ci-junit-process-shim-native-rust--6bd59de4 branch from dce251a to b592eb8 Compare May 29, 2026 06:35
@jd jd force-pushed the devs/jd/worktree-rust-port/encode-junit-cases-otlp-upload-mergify-ci-insights--cbc72716 branch from 19c0db2 to 0963560 Compare May 29, 2026 06:35
@jd jd temporarily deployed to func-tests-live May 29, 2026 06:35 — with GitHub Actions Inactive
@jd jd temporarily deployed to func-tests-live May 29, 2026 06:35 — with GitHub Actions Inactive
@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 29, 2026 06:35 Failure
@jd jd force-pushed the devs/jd/worktree-rust-port/promote-ci-junit-process-shim-native-rust--6bd59de4 branch from b592eb8 to 741009a Compare May 29, 2026 08:31
@jd jd force-pushed the devs/jd/worktree-rust-port/encode-junit-cases-otlp-upload-mergify-ci-insights--cbc72716 branch from 0963560 to 63a2a41 Compare May 29, 2026 08:31
@jd jd temporarily deployed to func-tests-live May 29, 2026 08:31 — with GitHub Actions Inactive
@jd jd temporarily deployed to func-tests-live May 29, 2026 08:31 — with GitHub Actions Inactive
sileht
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants