Skip to content

feat(ci-insights): Add mergify tests show command#1382

Merged
mergify[bot] merged 1 commit into
mainfrom
devs/remyduthu/tests-lookup-cli/add-mergify-ci-tests-lookup-cmd--afe28649
May 21, 2026
Merged

feat(ci-insights): Add mergify tests show command#1382
mergify[bot] merged 1 commit into
mainfrom
devs/remyduthu/tests-lookup-cli/add-mergify-ci-tests-lookup-cmd--afe28649

Conversation

@remyduthu
Copy link
Copy Markdown
Contributor

@remyduthu remyduthu commented May 6, 2026

Wraps two CI Insights endpoints into a single batch command:

  • GET /v1/ci/{owner}/repositories/{repo}/search/tests resolves test
    identities by name (glob-aware) on the default branch. Filters
    (test_name, pipeline_name, job_name, …) travel as repeated
    query parameters; page size travels as per_page.
  • GET /v1/ci/{owner}/repositories/{repo}/tests/{test_id} returns the
    full health/metrics payload for one identity.

The search is a true batch API — pass one or more <NAME> positionals
(globs allowed) and one block per match is rendered. --json emits a
single {"tests": [...]} document; the human renderer hides metadata
lines for absent fields rather than printing placeholders. Exit code
reflects the worst health observed across results (0 = healthy or
unknown, 1 = any flaky, 6 = any broken).

split_owner_repo lives in detector.rs next to the existing
owner/repo validators so callers can interpolate the segments into
request paths without re-escaping. A new HttpClient::get_with_query
helper percent-encodes values and preserves repeated keys in caller
order, which the search endpoint relies on for test_name repetition.

Also adds a live-smoke case that exercises the search endpoint with a
guaranteed-nonexistent name so the round-trip stays independent of
canary repository state.

Fixes: MRGFY-7166

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

Copilot AI review requested due to automatic review settings May 6, 2026 13:56
@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 6, 2026 13:56 Failure
@remyduthu remyduthu self-assigned this May 6, 2026
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented May 6, 2026

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 🤖 Continuous Integration

Wonderful, this rule succeeded.
  • all of:
    • check-success=ci-gate

🟢 👀 Review Requirements

Wonderful, this rule succeeded.
  • any of:
    • #approved-reviews-by>=2
    • author = dependabot[bot]
    • author = mergify-ci-bot
    • author = renovate[bot]

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

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

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

🟢 🔎 Reviews

Wonderful, this rule succeeded.
  • #changes-requested-reviews-by = 0
  • #review-requested = 0
  • #review-threads-unresolved = 0

🟢 📕 PR description

Wonderful, this rule succeeded.
  • body ~= (?ms:.{48,})

@remyduthu remyduthu changed the title feat(rust): Add mergify ci tests lookup command feat(ci-insights): Add mergify ci tests lookup command May 6, 2026
@remyduthu remyduthu force-pushed the devs/remyduthu/tests-lookup-cli/add-mergify-ci-tests-lookup-cmd--afe28649 branch from 6544154 to 57267f7 Compare May 6, 2026 13:56
@remyduthu
Copy link
Copy Markdown
Contributor Author

remyduthu commented May 6, 2026

Revision history

# Type Changes Reason Date
1 initial 6544154 2026-05-06 13:56 UTC
2 rebase 6544154 → 57267f7 2026-05-06 13:56 UTC
3 content 57267f7 → 3d1d1d8 2026-05-06 14:38 UTC
4 content 3d1d1d8 → 10479a6 2026-05-20 09:39 UTC
5 content 10479a6 → 51d9b34 (raw) 2026-05-20 10:01 UTC
6 content 51d9b34 → 099fc3a (raw) 2026-05-20 10:20 UTC
7 content 099fc3a → 7a3a0d2 2026-05-20 13:38 UTC
8 rebase 7a3a0d2 → 93627c6 (rebase only) 2026-05-20 13:39 UTC
9 content 93627c6 → a42941c (raw) 2026-05-20 15:11 UTC
10 content a42941c → fb35e47 (raw) 2026-05-20 15:16 UTC
11 content fb35e47 → 0419af5 2026-05-21 14:41 UTC

@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 6, 2026 13:57 Failure
@remyduthu remyduthu marked this pull request as ready for review May 6, 2026 14:00
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new native Rust mergify ci tests lookup command to batch-resolve CI Insights test identities by name (glob-aware), fetch per-test health/metrics, and render either human output or a single JSON payload. This extends the Rust-native mergify ci surface area and introduces a reusable HTTP helper for ordered/repeated query parameters.

Changes:

  • Add mergify ci tests lookup NAME... command (CLI wiring, API calls, rendering, exit-code aggregation, and unit tests).
  • Add HttpClient::get_with_query to support ordered/repeated query params with proper encoding.
  • Update docs and add a live smoke test exercising the lookup endpoint.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
skills/mergify-ci/SKILL.md Documents the new ci tests lookup command, options, and exit codes.
README.md Mentions test health inspection under the mergify ci command group.
func-tests/test_live_smoke.py Adds a live smoke test for the lookup endpoint (no-match path).
crates/mergify-core/src/http.rs Introduces get_with_query plus unit tests for ordering/encoding behavior.
crates/mergify-cli/src/main.rs Adds clap subcommand plumbing + native dispatch for ci tests lookup and JSON mode selection.
crates/mergify-ci/src/tests_lookup.rs Implements lookup + details fan-out, rendering, JSON payload, exit code policy, and tests.
crates/mergify-ci/src/lib.rs Exposes the new tests_lookup module.
crates/mergify-ci/src/detector.rs Adds split_owner_repo helper with tests.
crates/mergify-ci/Cargo.toml Adds Rust deps needed by the new command (chrono, futures).
Cargo.lock Lockfile updates for newly introduced/updated dependencies.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/mergify-ci/src/detector.rs Outdated
Comment thread crates/mergify-cli/src/main.rs
Comment thread func-tests/test_live_smoke.py
@mergify mergify Bot requested a review from a team May 6, 2026 14:10
@remyduthu remyduthu force-pushed the devs/remyduthu/tests-lookup-cli/add-mergify-ci-tests-lookup-cmd--afe28649 branch from 57267f7 to 3d1d1d8 Compare May 6, 2026 14:38
@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 6, 2026 14:39 Failure
@remyduthu remyduthu marked this pull request as draft May 18, 2026 13:31
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented May 18, 2026

@remyduthu this pull request is now in conflict 😩

@mergify mergify Bot added the conflict label May 18, 2026
Comment thread crates/mergify-ci/src/tests_show.rs
@remyduthu remyduthu changed the title feat(ci-insights): Add mergify ci tests lookup command feat(ci-insights): Add mergify ci tests show command May 20, 2026
@remyduthu remyduthu force-pushed the devs/remyduthu/tests-lookup-cli/add-mergify-ci-tests-lookup-cmd--afe28649 branch from 3d1d1d8 to 10479a6 Compare May 20, 2026 09:39
@remyduthu remyduthu temporarily deployed to func-tests-live May 20, 2026 09:39 — with GitHub Actions Inactive
@remyduthu remyduthu temporarily deployed to func-tests-live May 20, 2026 09:39 — with GitHub Actions Inactive
@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 20, 2026 09:39 Failure
@mergify mergify Bot removed the conflict label May 20, 2026
Comment thread crates/mergify-ci/Cargo.toml Outdated
@mergify mergify Bot requested a review from a team May 20, 2026 13:59
@remyduthu remyduthu force-pushed the devs/remyduthu/tests-lookup-cli/add-mergify-ci-tests-lookup-cmd--afe28649 branch from 93627c6 to a42941c Compare May 20, 2026 15:11
@remyduthu remyduthu temporarily deployed to func-tests-live May 20, 2026 15:11 — with GitHub Actions Inactive
@remyduthu remyduthu temporarily deployed to func-tests-live May 20, 2026 15:11 — with GitHub Actions Inactive
@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 20, 2026 15:11 Failure
@remyduthu remyduthu force-pushed the devs/remyduthu/tests-lookup-cli/add-mergify-ci-tests-lookup-cmd--afe28649 branch from a42941c to fb35e47 Compare May 20, 2026 15:16
@remyduthu remyduthu temporarily deployed to func-tests-live May 20, 2026 15:16 — with GitHub Actions Inactive
@remyduthu remyduthu temporarily deployed to func-tests-live May 20, 2026 15:16 — with GitHub Actions Inactive
@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 20, 2026 15:16 Failure
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented May 21, 2026

@remyduthu this pull request is now in conflict 😩

@mergify mergify Bot added the conflict label May 21, 2026
Wraps two CI Insights endpoints into a single batch command:

- `GET /v1/ci/{owner}/repositories/{repo}/search/tests` resolves test
  identities by name (glob-aware) on the default branch. Filters
  (`test_name`, `pipeline_name`, `job_name`, …) travel as repeated
  query parameters; page size travels as `per_page`.
- `GET /v1/ci/{owner}/repositories/{repo}/tests/{test_id}` returns the
  full health/metrics payload for one identity.

The search is a true batch API — pass one or more `<NAME>` positionals
(globs allowed) and one block per match is rendered. `--json` emits a
single `{"tests": [...]}` document; the human renderer hides metadata
lines for absent fields rather than printing placeholders. Exit code
reflects the worst health observed across results (0 = healthy or
unknown, 1 = any flaky, 6 = any broken).

`split_owner_repo` lives in `detector.rs` next to the existing
`owner/repo` validators so callers can interpolate the segments into
request paths without re-escaping. A new `HttpClient::get_with_query`
helper percent-encodes values and preserves repeated keys in caller
order, which the search endpoint relies on for `test_name` repetition.

Also adds a live-smoke case that exercises the search endpoint with a
guaranteed-nonexistent name so the round-trip stays independent of
canary repository state.

Fixes: MRGFY-7166

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Change-Id: Iafe286495b7842079e9c63b437a6305926fc22a5
@remyduthu remyduthu force-pushed the devs/remyduthu/tests-lookup-cli/add-mergify-ci-tests-lookup-cmd--afe28649 branch from fb35e47 to 0419af5 Compare May 21, 2026 14:41
@remyduthu remyduthu temporarily deployed to func-tests-live May 21, 2026 14:42 — with GitHub Actions Inactive
@remyduthu remyduthu temporarily deployed to func-tests-live May 21, 2026 14:42 — with GitHub Actions Inactive
@mergify mergify Bot deployed to Mergify Merge Protections May 21, 2026 14:44 Active
@mergify mergify Bot removed the conflict label May 21, 2026
@mergify mergify Bot requested a review from a team May 21, 2026 15:07
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented May 21, 2026

Merge Queue Status

This pull request spent 17 minutes 59 seconds in the queue, including 17 minutes 24 seconds running CI.

Required conditions to merge

mergify Bot added a commit that referenced this pull request May 21, 2026
@mergify mergify Bot added the queued label May 21, 2026
@mergify mergify Bot merged commit a5a84b9 into main May 21, 2026
36 checks passed
@mergify mergify Bot deleted the devs/remyduthu/tests-lookup-cli/add-mergify-ci-tests-lookup-cmd--afe28649 branch May 21, 2026 15:48
@mergify mergify Bot removed the queued label May 21, 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.

5 participants