Skip to content

refactor(ts): fetch quarantine and flaky context through the Rust client - #75

Merged
mergify[bot] merged 1 commit into
mainfrom
devs/kozlek/thomasberdy/mrgfy-8439-rust-api-client/fetch-quarantine-flaky-context-rust-client--26ec074f
Aug 11, 2026
Merged

refactor(ts): fetch quarantine and flaky context through the Rust client#75
mergify[bot] merged 1 commit into
mainfrom
devs/kozlek/thomasberdy/mrgfy-8439-rust-api-client/fetch-quarantine-flaky-context-rust-client--26ec074f

Conversation

@kozlek

@kozlek kozlek commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

@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

@mergify
mergify Bot had a problem deploying to Mergify Merge Protections August 6, 2026 14:45 Failure
@kozlek

kozlek commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator Author

This pull request is part of a Mergify stack:

# Pull Request Link
1 refactor(ts): fetch quarantine and flaky context through the Rust client #75 👈
2 refactor(ts): upload traces through the Rust client #76
3 refactor(ts): assemble spans directly, dropping the OpenTelemetry SDK #77

@mergify

mergify Bot commented Aug 6, 2026

Copy link
Copy Markdown

Merge Protections

🟢 All 6 merge protections satisfied — ready to merge.

Show 6 satisfied protections

🟢 🤖 Continuous Integration

  • all of:
    • check-success=ci-gate

🟢 👀 Review Requirements

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

🟢 Enforce conventional commit

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

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

🟢 🔎 Reviews

  • #changes-requested-reviews-by = 0
  • #review-requested = 0
  • #review-threads-unresolved = 0

🟢 📕 PR description

  • body ~= (?ms:.{48,})

🟢 🚦 Auto-queue

When all merge protections are satisfied, this pull request will be queued automatically.

@mergify
mergify Bot requested a review from a team August 6, 2026 14:48
@kozlek
kozlek marked this pull request as ready for review August 6, 2026 16:24
@kozlek kozlek added the manual merge Merge by hand with a merge commit; bypasses the squash queue label Aug 6, 2026
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
kozlek force-pushed the devs/kozlek/thomasberdy/mrgfy-8439-rust-api-client/fetch-quarantine-flaky-context-rust-client--26ec074f branch from ae29c34 to fd11fc9 Compare August 10, 2026 12:12
@kozlek

kozlek commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator Author

Revision history

# Type Changes Reason Date
1 initial ae29c34 2026-08-10 12:12 UTC
2 rebase ae29c34 → fd11fc9 (rebase only) 2026-08-10 12:12 UTC

@mergify
mergify Bot deployed to Mergify Merge Protections August 10, 2026 12:13 Active
@mergify
mergify Bot requested a review from a team August 10, 2026 12:22
@kozlek kozlek removed the manual merge Merge by hand with a merge commit; bypasses the squash queue label Aug 11, 2026
@kozlek

kozlek commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator Author

@Mergifyio queue

@mergify

mergify Bot commented Aug 11, 2026

Copy link
Copy Markdown

Merge Queue Status

  • Entered queue2026-08-11 15:27 UTC · Rule: default · triggered by @kozlek with the @mergifyio queue command
  • Checks skipped · PR is already up-to-date
  • Merged2026-08-11 15:28 UTC · at fd11fc99936f88c78a9ff1e4cf62c1370cef8532 · squash

This pull request spent 30 seconds in the queue, including 2 seconds running CI.

Required conditions to merge

@mergify mergify Bot added the queued label Aug 11, 2026
@mergify
mergify Bot merged commit 95c88ea into main Aug 11, 2026
22 checks passed
@mergify
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
@mergify mergify Bot removed the queued label Aug 11, 2026
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.

3 participants