Skip to content

test(live): cover the quarantine add/remove round-trip - #1801

Draft
jd wants to merge 1 commit into
devs/jd/fix/live-tests-tests-show-admin-token/drop-mirror-claims-deleted-python-files--dd9e1e28from
devs/jd/fix/live-tests-tests-show-admin-token/cover-quarantine-add-remove-round-trip--20ed0098
Draft

test(live): cover the quarantine add/remove round-trip#1801
jd wants to merge 1 commit into
devs/jd/fix/live-tests-tests-show-admin-token/drop-mirror-claims-deleted-python-files--dd9e1e28from
devs/jd/fix/live-tests-tests-show-admin-token/cover-quarantine-add-remove-round-trip--20ed0098

Conversation

@jd

@jd jd commented Sep 4, 2026

Copy link
Copy Markdown
Member

MRGFY-9001 dropped ci_application_key from POST and DELETE on
/ci/{owner}/repositories/{repo}/quarantines at the same time it
dropped it from search/tests. Only search/tests had a live
test, so only search/tests turned red; mergify tests quarantines add and remove broke for every ci key with no signal at all.
The first two commits of this stack documented that. This closes
it.

The 20-odd wiremock tests in tests_quarantine.rs cannot cover
this: a mock server never authenticates, so no scope change is
visible to them. It has to be the live suite or nothing.

Shape follows freeze_create_update_delete_roundtrip, the existing
create-and-clean-up test in this file: a Drop guard removes the
entry so a failed assertion mid-test still leaves the canary
repository clean, and it warns rather than panics, because
panicking in Drop during an unwind aborts the process and buries
the assertion message that explains the failure. The guard is
registered before the response is parsed — an unparseable body
still means the row exists server-side.

Two details specific to quarantines:

  • The quarantined name is __mergify_cli_smoke_quarantine_<rand>__
    and matches nothing any real suite reports, so even a completely
    skipped cleanup cannot suppress a genuine failure on the canary
    repository. A leaked row is inert.
  • Removal goes by name rather than by the id add returned, so one
    run covers the list read that resolves the name and the delete.
    Cleanup then expects exit 6 ("not quarantined") on the happy
    path, since the body already removed the row.

The 8-char entropy the freeze test generated inline is now
unique_suffix(), shared by both.

Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01JBz3hxMUDCuWftT6qAHtnn

MRGFY-9001 dropped `ci_application_key` from `POST` and `DELETE` on
`/ci/{owner}/repositories/{repo}/quarantines` at the same time it
dropped it from `search/tests`. Only `search/tests` had a live
test, so only `search/tests` turned red; `mergify tests quarantines
add` and `remove` broke for every `ci` key with no signal at all.
The first two commits of this stack documented that. This closes
it.

The 20-odd wiremock tests in `tests_quarantine.rs` cannot cover
this: a mock server never authenticates, so no scope change is
visible to them. It has to be the live suite or nothing.

Shape follows `freeze_create_update_delete_roundtrip`, the existing
create-and-clean-up test in this file: a `Drop` guard removes the
entry so a failed assertion mid-test still leaves the canary
repository clean, and it warns rather than panics, because
panicking in `Drop` during an unwind aborts the process and buries
the assertion message that explains the failure. The guard is
registered before the response is parsed — an unparseable body
still means the row exists server-side.

Two details specific to quarantines:

- The quarantined name is `__mergify_cli_smoke_quarantine_<rand>__`
  and matches nothing any real suite reports, so even a completely
  skipped cleanup cannot suppress a genuine failure on the canary
  repository. A leaked row is inert.
- Removal goes by name rather than by the id `add` returned, so one
  run covers the list read that resolves the name *and* the delete.
  Cleanup then expects exit 6 ("not quarantined") on the happy
  path, since the body already removed the row.

The 8-char entropy the freeze test generated inline is now
`unique_suffix()`, shared by both.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JBz3hxMUDCuWftT6qAHtnn
Change-Id: I20ed0098fe86acd633ad6864eed035f6e5f47dd1
@mergify
mergify Bot had a problem deploying to Mergify Merge Protections September 4, 2026 15:38 Failure
@jd

jd commented Sep 4, 2026

Copy link
Copy Markdown
Member Author

This pull request is part of a Mergify stack:

# Pull Request Link
1 fix(live-tests): move tests show onto the admin token #1798
2 docs(live-tests): drop the mirror claims for deleted Python files #1799
3 test(live): cover the quarantine add/remove round-trip #1801 👈

@mergify

mergify Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🔴 3 of 7 protections blocking · waiting on 👀 reviews and ⛓️ dependency

Protection Waiting on
🔴 ⛓️ Depends-On Requirements ⛓️ dependency
🔴 👀 Review Requirements 👀 reviews
🔴 🔎 Reviews 👀 reviews
🟢 🤖 Continuous Integration
🟢 Enforce conventional commit
🟢 📕 PR description
🟢 🚦 Auto-queue

🔴 ⛓️ 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

Show 4 satisfied protections

🟢 🤖 Continuous Integration

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

🟢 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)(?:\(.+\))?!?:

🟢 📕 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 September 4, 2026 15:45
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.

1 participant