Skip to content

fix(live-tests): use the admin token for the test-search smoke test - #1796

Open
jd wants to merge 1 commit into
mainfrom
devs/jd/worktree-skill/use-admin-token-test-search-smoke-test--5a1fe7db
Open

fix(live-tests): use the admin token for the test-search smoke test#1796
jd wants to merge 1 commit into
mainfrom
devs/jd/worktree-skill/use-admin-token-test-search-smoke-test--5a1fe7db

Conversation

@jd

@jd jd commented Sep 4, 2026

Copy link
Copy Markdown
Member

tests_show_no_match has failed on every pull request in this repo
since 2026-09-03, with a 403 on
GET /v1/ci/{owner}/repositories/{repo}/search/tests. Nothing in
this repo caused it and nothing here can be blamed for it: the
last green run was 2026-09-02 13:27Z, and
Mergifyio/monorepo#39768 — "cut the ci application key down to
least privilege" — merged 2026-09-03 08:40Z.

That change dropped search/tests from the ci application key's
scope on purpose. mergify tests show is an interactive developer
command, run from a laptop by someone with their own credential;
it is not work an unattended CI job does, so a token that sits in
CI config should not reach it. The endpoint's security in the
public OpenAPI is now AdminApplicationKey, MergifyTokenBearerAuth
and GitHubTokenBearerAuth — no ApplicationKey. The 403 is the
product working.

So the test is wrong, not the API: it passes
LIVE_TEST_MERGIFY_TOKEN_CI at an endpoint the CI key is
deliberately barred from. Switch it to
LIVE_TEST_MERGIFY_TOKEN_ADMIN, which is the admin application
key the queue-admin and freeze tests already use and which the
endpoint still accepts, and widen the comments on
live_admin_token and in the workflow so the next reader knows
the split is about what a CI token may reach, not about
merge-queue endpoints specifically.

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

`tests_show_no_match` has failed on every pull request in this repo
since 2026-09-03, with a 403 on
`GET /v1/ci/{owner}/repositories/{repo}/search/tests`. Nothing in
this repo caused it and nothing here can be blamed for it: the
last green run was 2026-09-02 13:27Z, and
Mergifyio/monorepo#39768 — "cut the ci application key down to
least privilege" — merged 2026-09-03 08:40Z.

That change dropped `search/tests` from the `ci` application key's
scope on purpose. `mergify tests show` is an interactive developer
command, run from a laptop by someone with their own credential;
it is not work an unattended CI job does, so a token that sits in
CI config should not reach it. The endpoint's `security` in the
public OpenAPI is now `AdminApplicationKey`, `MergifyTokenBearerAuth`
and `GitHubTokenBearerAuth` — no `ApplicationKey`. The 403 is the
product working.

So the test is wrong, not the API: it passes
`LIVE_TEST_MERGIFY_TOKEN_CI` at an endpoint the CI key is
deliberately barred from. Switch it to
`LIVE_TEST_MERGIFY_TOKEN_ADMIN`, which is the admin application
key the queue-admin and freeze tests already use and which the
endpoint still accepts, and widen the comments on
`live_admin_token` and in the workflow so the next reader knows
the split is about what a CI token may reach, not about
merge-queue endpoints specifically.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018bo8M8rLudvf22poAaxLfY
Change-Id: I5a1fe7dbbfb021d25ba7f3e1bc76108e37ac3f09
Copilot AI lite review requested due to automatic review settings September 4, 2026 12:59
@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): use the admin token for the test-search smoke test #1796 👈
2 docs(release): add a maintainer skill for cutting a release #1795

@mergify
mergify Bot had a problem deploying to Mergify Merge Protections September 4, 2026 12:59 Failure
@jd
jd deployed to func-tests-live September 4, 2026 12:59 — 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 change is narrowly scoped to using the correct token for an endpoint that no longer accepts the CI application key, with matching documentation updates.

Pull request overview

Updates the live functional smoke tests for the mergify Rust CLI to use the admin application key for the tests show “test-search” endpoint, matching the API’s updated authorization model (403 for the CI-scoped key is now expected behavior).

Changes:

  • Switch tests_show_no_match to authenticate with LIVE_TEST_MERGIFY_TOKEN_ADMIN instead of the CI-scoped token.
  • Clarify in-code and workflow comments that the token split is about least-privilege scoping (CI token vs admin-required endpoints), including tests show.
File summaries
File Description
crates/mergify-cli/tests/live_smoke.rs Uses live_admin_token() for the tests show smoke test and expands rationale comments.
.github/workflows/func-tests-live.yaml Updates workflow comments to document that tests show uses the admin token alongside other admin-scoped endpoints.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

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

@mergify
mergify Bot requested a review from a team September 4, 2026 13:06
@jd
jd marked this pull request as ready for review September 4, 2026 13:43
@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