refactor(ts): fetch quarantine and flaky context through the Rust client - #75
Merged
Conversation
Collaborator
Author
|
This pull request is part of a Mergify stack:
|
Merge Protections🟢 All 6 merge protections satisfied — ready to merge. 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:24
Base automatically changed from
devs/kozlek/thomasberdy/mrgfy-8439-rust-api-client/expose-shared-api-client-napi-binding--7ab86c8c
to
main
August 10, 2026 12:07
`@mergifyio/ci-core` stops making these two calls itself. Pagination, the `Link` header walk, cycle detection and status handling all move behind `CiApiClient`, so they live once — in Rust, shared with pytest-mergify — instead of being reimplemented per language. What stays on the TS side is the fail-open mapping the plugins actually depend on: the client's tri-state (value / dormant / rejection) collapses to an empty set or a null context, with the reason logged. The `mode === "new"` empty-baseline guard stays here too rather than moving into the client. It is a *policy* about how a run behaves, not a wire concern: with no baseline every test looks new and the whole suite would rerun. It mirrors the Rust budget engine's `should_run`. Plugins now build one client per run and pass it down, which doubles as the test seam. `MergifyReporterOptions.apiClient` (vitest) and `RunGlobalSetupDeps.createClient` (playwright) let the behavior suites drive both features without a network or a `.node` binary — the Playwright globalSetup tests move off stubbing global `fetch`, which the Rust client bypasses entirely. The `.node`-less path also gets real coverage now: no client means the features stay off rather than the run breaking. Deleted with the duplicated code: the TS pagination and HTTP-status tests, which the Rust client's own suite covers. One behavior change worth noting: a 402 on the flaky-detection context now logs the client's "Mergify API returned HTTP 402" instead of "Flaky detection not available (no subscription)". The fail-open outcome is identical; only the wording differs. Trace upload still goes through the OTLP exporter — that swap is the next commit. Related to MRGFY-8439 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Change-Id: I26ec074fcd9c40c801ea9b2392774b6f9fd428a7
kozlek
force-pushed
the
devs/kozlek/thomasberdy/mrgfy-8439-rust-api-client/fetch-quarantine-flaky-context-rust-client--26ec074f
branch
from
August 10, 2026 12:12
ae29c34 to
fd11fc9
Compare
Collaborator
Author
Revision history
|
JulianMaurin
approved these changes
Aug 10, 2026
jd
approved these changes
Aug 11, 2026
Collaborator
Author
|
@Mergifyio queue |
Merge Queue Status
This pull request spent 30 seconds in the queue, including 2 seconds running CI. Required conditions to merge
|
mergify
Bot
deleted the
devs/kozlek/thomasberdy/mrgfy-8439-rust-api-client/fetch-quarantine-flaky-context-rust-client--26ec074f
branch
August 11, 2026 15:28
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.
@mergifyio/ci-corestops making these two calls itself. Pagination, theLinkheader walk, cycle detection and status handling all move behindCiApiClient, so they live once — in Rust, shared with pytest-mergify —instead of being reimplemented per language. What stays on the TS side is the
fail-open mapping the plugins actually depend on: the client's tri-state
(value / dormant / rejection) collapses to an empty set or a null context, with
the reason logged.
The
mode === "new"empty-baseline guard stays here too rather than movinginto the client. It is a policy about how a run behaves, not a wire concern:
with no baseline every test looks new and the whole suite would rerun. It
mirrors the Rust budget engine's
should_run.Plugins now build one client per run and pass it down, which doubles as the
test seam.
MergifyReporterOptions.apiClient(vitest) andRunGlobalSetupDeps.createClient(playwright) let the behavior suites driveboth features without a network or a
.nodebinary — the PlaywrightglobalSetup tests move off stubbing global
fetch, which the Rust clientbypasses entirely. The
.node-less path also gets real coverage now: no clientmeans the features stay off rather than the run breaking.
Deleted with the duplicated code: the TS pagination and HTTP-status tests,
which the Rust client's own suite covers.
One behavior change worth noting: a 402 on the flaky-detection context now logs
the client's "Mergify API returned HTTP 402" instead of "Flaky detection not
available (no subscription)". The fail-open outcome is identical; only the
wording differs.
Trace upload still goes through the OTLP exporter — that swap is the next
commit.
Related to MRGFY-8439
Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com