Skip to content

fix(live-tests): move tests show onto the admin token - #1798

Open
jd wants to merge 1 commit into
mainfrom
devs/jd/fix/live-tests-tests-show-admin-token/move-tests-show-onto-admin-token--4e4c3e30
Open

fix(live-tests): move tests show onto the admin token#1798
jd wants to merge 1 commit into
mainfrom
devs/jd/fix/live-tests-tests-show-admin-token/move-tests-show-onto-admin-token--4e4c3e30

Conversation

@jd

@jd jd commented Sep 4, 2026

Copy link
Copy Markdown
Member

MRGFY-9001 cut the ci application key to what a CI job actually
needs, and GET /ci/{owner}/repositories/{repo}/search/tests lost
ci_application_key along with it. tests_show_no_match still
passed the CI-scoped token, so every live run since has failed with
a 403 on that one test — on pull requests that touch nothing near
it.

Reading test health is a developer inspecting a repository, not
something a CI job does, so the 403 is the intended answer and the
test was asserting an obsolete contract. It moves to the admin
token, under the admin banner with the queue and freeze tests that
were separated for the same reason.

The narrowing also took the two quarantine mutations the CLI makes
(tests quarantines add and remove); no live test covers those,
so they broke silently. Three doc surfaces promised any token
worked, and AGENTS.md makes README and --help the owners of the
token contract, so all three now say which key each command needs:

  • skills/mergify-ci/SKILL.md grows one ## Authentication
    section glossing the two key classes, replacing the per-command
    repetition the sibling merge-protections skill already avoids.
    It also states the rule for the commands that keep working, so
    the silence on quarantines list/get is readable rather than
    looking like an oversight.
  • README documents the split at group altitude, next to the
    existing token resolution order.
  • --help for the three affected commands says it inline. Those
    doc comments feed cli_schema.rs, which the docs site renders,
    so the golden snapshot moves with them.

While in that section: the tests show exit-code table claimed 1
= flaky and 6 = broken, but tests_show::run returns
ExitCode::Success on every rendered path — pinned by
unhealthy_tests_still_exit_success. A CI gate written from that
table never fired, and it read this commit's own 403 (exit 6, a
CliError) as "a broken test". Corrected to what the command does.

Nothing in Mergifyio/mergify-ci-integrations is affected: its
whole API surface is traces, quarantines (list),
flaky-detection-context and test-selection, all of which the
narrowing kept.

Verified on CI: run 33880789655 reports tests_show_no_match ... ok
with 12/12 green, so the admin key does carry CI-Insights read
scope. search/tests is the only route the suite covers —
tests/{test_id} is narrowed the same way but the no-match query
returns before the details fetch, which the helper's doc now says.

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

Copilot AI lite review requested due to automatic review settings September 4, 2026 13:55
@mergify
mergify Bot had a problem deploying to Mergify Merge Protections September 4, 2026 13:55 Failure
@jd
jd deployed to func-tests-live September 4, 2026 13:55 — with GitHub Actions Active
@mergify

mergify Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🔴 2 of 6 protections blocking · waiting on 👀 reviews

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

🔴 👀 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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The changes align the live tests and docs with the intended authorization model and are low-risk (token selection + documentation only).

Pull request overview

This PR updates the live functional smoke tests and supporting documentation to reflect that CI-Insights test health endpoints are intentionally not accessible with the CI-scoped application key (403 by design), and must be exercised with the admin-scoped token instead.

Changes:

  • Switch tests_show_no_match live smoke test from the CI token to the admin token.
  • Clarify in the live test token helper docs that the admin token covers both queue-management endpoints and CI-Insights test reads.
  • Update the mergify-ci skill documentation to state that tests show and quarantine mutations require an admin key (or PAT), and that CI keys are rejected.
File summaries
File Description
skills/mergify-ci/SKILL.md Documents that CI-Insights test reads and quarantine mutations require admin-scoped auth (CI key 403s).
crates/mergify-cli/tests/live_smoke.rs Moves tests show live smoke coverage onto the admin token and updates token-scope rationale.
.github/workflows/func-tests-live.yaml Updates workflow commentary to include tests show among admin-token-covered endpoints.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread skills/mergify-ci/SKILL.md Outdated
@mergify
mergify Bot requested a review from a team September 4, 2026 14:03
MRGFY-9001 cut the `ci` application key to what a CI job actually
needs, and `GET /ci/{owner}/repositories/{repo}/search/tests` lost
`ci_application_key` along with it. `tests_show_no_match` still
passed the CI-scoped token, so every live run since has failed with
a 403 on that one test — on pull requests that touch nothing near
it.

Reading test health is a developer inspecting a repository, not
something a CI job does, so the 403 is the intended answer and the
test was asserting an obsolete contract. It moves to the admin
token, under the admin banner with the queue and freeze tests that
were separated for the same reason.

The narrowing also took the two quarantine mutations the CLI makes
(`tests quarantines add` and `remove`); no live test covers those,
so they broke silently. Three doc surfaces promised any token
worked, and AGENTS.md makes README and `--help` the owners of the
token contract, so all three now say which key each command needs:

- `skills/mergify-ci/SKILL.md` grows one `## Authentication`
  section glossing the two key classes, replacing the per-command
  repetition the sibling merge-protections skill already avoids.
  It also states the rule for the commands that keep working, so
  the silence on `quarantines list`/`get` is readable rather than
  looking like an oversight.
- README documents the split at group altitude, next to the
  existing token resolution order.
- `--help` for the three affected commands says it inline. Those
  doc comments feed `cli_schema.rs`, which the docs site renders,
  so the golden snapshot moves with them.

While in that section: the `tests show` exit-code table claimed `1`
= flaky and `6` = broken, but `tests_show::run` returns
`ExitCode::Success` on every rendered path — pinned by
`unhealthy_tests_still_exit_success`. A CI gate written from that
table never fired, and it read this commit's own 403 (exit 6, a
`CliError`) as "a broken test". Corrected to what the command does.

Nothing in `Mergifyio/mergify-ci-integrations` is affected: its
whole API surface is `traces`, `quarantines` (list),
`flaky-detection-context` and `test-selection`, all of which the
narrowing kept.

Verified on CI: run 33880789655 reports `tests_show_no_match ... ok`
with 12/12 green, so the admin key does carry CI-Insights read
scope. `search/tests` is the only route the suite covers —
`tests/{test_id}` is narrowed the same way but the no-match query
returns before the details fetch, which the helper's doc now says.

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

Change-Id: I4e4c3e308adb7dbd68052ef9b03c2e42381dd8ce
@jd
jd force-pushed the devs/jd/fix/live-tests-tests-show-admin-token/move-tests-show-onto-admin-token--4e4c3e30 branch from 4b37722 to c0055cb Compare September 4, 2026 14:39
@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

@jd

jd commented Sep 4, 2026

Copy link
Copy Markdown
Member Author

Revision history

# Type Changes Reason Date
1 initial 4b37722 2026-09-04 14:38 UTC
2 content 4b37722 → c0055cb code review: fixed the stale tests show exit-code table (claimed 1=flaky/6=broken; the command always exits 0, and 6 is this commit's own 403); moved the test under an admin banner instead of leavi… 2026-09-04 14:38 UTC

@jd
jd deployed to func-tests-live September 4, 2026 14:39 — with GitHub Actions Active
@mergify
mergify Bot had a problem deploying to Mergify Merge Protections September 4, 2026 14:39 Failure
@jd
jd marked this pull request as ready for review September 4, 2026 15:20
@mergify
mergify Bot requested a review from a team September 5, 2026 09:11
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