refactor(ts): upload traces through the Rust client - #76
Open
kozlek wants to merge 1 commit into
Open
Conversation
Collaborator
Author
|
This pull request is part of a Mergify stack:
|
Merge Protections🔴 1 of 7 protections blocking · waiting on 🙋 you
🔴 No Manual MergeWaiting for
This rule is failing.
Show 6 satisfied protections🟢 🤖 Continuous Integration
🟢 👀 Review Requirements
🟢 Enforce conventional commitMake sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
🟢 🔎 Reviews
🟢 📕 PR description
🟢 🚦 Auto-queueWhen all merge protections are satisfied, this pull request will be queued automatically. |
kozlek
marked this pull request as ready for review
August 6, 2026 16:50
kozlek
force-pushed
the
devs/kozlek/thomasberdy/mrgfy-8439-rust-api-client/upload-traces-rust-client--314107d7
branch
from
August 10, 2026 12:12
46ffe3a to
1e9efd0
Compare
Collaborator
Author
Revision history
|
Base automatically changed from
devs/kozlek/thomasberdy/mrgfy-8439-rust-api-client/fetch-quarantine-flaky-context-rust-client--26ec074f
to
main
August 11, 2026 15:28
|
@kozlek this pull request is now in conflict 😩 |
Replaces `@opentelemetry/exporter-trace-otlp-proto` with a `SpanExporter` backed by `CiApiClient.uploadTrace`, so protobuf encoding, gzip, oversized-trace splitting and upload retries are shared with pytest-mergify rather than reimplemented. The dependency is dropped. Span *construction* deliberately stays on the OpenTelemetry SDK — unlike pytest-mergify, which dropped the SDK entirely. The framework-specific span assembly is exactly the TS-side glue worth keeping, so `NativeTraceExporter` only marshals *finished* spans into plain data at the boundary: hex ids, `bigint` nanosecond timestamps, and attributes flattened to key/value pairs. Array attributes are dropped — nothing these plugins emit uses one and the upload path cannot represent them. `createTracing` now takes the client instead of token/repoName/apiUrl; the injected-exporter escape hatch and the `MERGIFY_CI_DEBUG` console exporter both still short-circuit ahead of it, so the behavior suites are unaffected. With the last caller gone, `splitRepoName` goes too — its only job was building the API URLs that `ApiConfig::from_full_name` now builds. It was exported from `@mergifyio/ci-core`, which documents itself as internal with no cross-version API stability. That completes the swap: quarantine, flaky-detection context and trace upload all run through the shared Rust client, and the duplicated TS client and OTLP export are gone. Test selection, the remaining acceptance criterion, is deliberately not here: the TS packages have no test-selection feature to swap — pytest has one, the TS clients never got it — so adding it is net-new user-visible behavior, split out to MRGFY-8497 rather than smuggled into a refactor. `FlakyDetector` likewise keeps its own budget arithmetic instead of adopting the Rust budget engine. They are not equivalent: `budget::plan` has no `max_test_name_length` filter and no min/max execution-count repeat math, so swapping would silently change which tests rerun and how often. Fixes MRGFY-8439 Related to MRGFY-8497 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Change-Id: I314107d73f6dff7757c2fdfd61399089c8882a22
kozlek
force-pushed
the
devs/kozlek/thomasberdy/mrgfy-8439-rust-api-client/upload-traces-rust-client--314107d7
branch
from
August 11, 2026 15:50
1e9efd0 to
3d270a6
Compare
jd
approved these changes
Aug 12, 2026
AlexandreGaubert
approved these changes
Aug 13, 2026
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.
Replaces
@opentelemetry/exporter-trace-otlp-protowith aSpanExporterbacked by
CiApiClient.uploadTrace, so protobuf encoding, gzip,oversized-trace splitting and upload retries are shared with pytest-mergify
rather than reimplemented. The dependency is dropped.
Span construction deliberately stays on the OpenTelemetry SDK — unlike
pytest-mergify, which dropped the SDK entirely. The framework-specific span
assembly is exactly the TS-side glue worth keeping, so
NativeTraceExporteronly marshals finished spans into plain data at the boundary: hex ids,
bigintnanosecond timestamps, and attributes flattened to key/value pairs.Array attributes are dropped — nothing these plugins emit uses one and the
upload path cannot represent them.
createTracingnow takes the client instead of token/repoName/apiUrl; theinjected-exporter escape hatch and the
MERGIFY_CI_DEBUGconsole exporter bothstill short-circuit ahead of it, so the behavior suites are unaffected.
With the last caller gone,
splitRepoNamegoes too — its only job was buildingthe API URLs that
ApiConfig::from_full_namenow builds. It was exported from@mergifyio/ci-core, which documents itself as internal with no cross-versionAPI stability.
That completes the swap: quarantine, flaky-detection context and trace upload
all run through the shared Rust client, and the duplicated TS client and OTLP
export are gone.
Test selection, the remaining acceptance criterion, is deliberately not here:
the TS packages have no test-selection feature to swap — pytest has one, the TS
clients never got it — so adding it is net-new user-visible behavior, split out
to MRGFY-8497 rather than smuggled into a refactor.
FlakyDetectorlikewise keeps its own budget arithmetic instead of adoptingthe Rust budget engine. They are not equivalent:
budget::planhas nomax_test_name_lengthfilter and no min/max execution-count repeat math, soswapping would silently change which tests rerun and how often.
Fixes MRGFY-8439
Related to MRGFY-8497
Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com