Skip to content

test(queue): add live smoke test for queue show#1408

Merged
mergify[bot] merged 1 commit into
mainfrom
devs/jd/worktree-rust-port/add-live-smoke-test-queue-show--944234ba
May 19, 2026
Merged

test(queue): add live smoke test for queue show#1408
mergify[bot] merged 1 commit into
mainfrom
devs/jd/worktree-rust-port/add-live-smoke-test-queue-show--944234ba

Conversation

@jd
Copy link
Copy Markdown
Member

@jd jd commented May 11, 2026

Pins the contract for mergify queue show 404 handling
before the Rust port lands on top. Same test exercises Python
at this PR's CI and Rust on the port commit's rebase.

Uses a PR number far above the test repo's actual PR count to
force the 404 path. That's robust against the test repo's queue
state (PR #1 may or may not be queued at any given moment) and
exercises the parts that would silently break on URL or schema
drift: endpoint reachability, auth, and 404 → MERGIFY_API_ERROR
exit code (6) mapping with the not in the merge queue message.

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

@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 11, 2026 12:06 Failure
@jd jd had a problem deploying to func-tests-live May 11, 2026 12:06 — with GitHub Actions Failure
@jd
Copy link
Copy Markdown
Member Author

jd commented May 11, 2026

This pull request is part of a Mergify stack:

# Pull Request Link
1 test(queue): add live smoke test for queue show #1408 👈
2 feat(rust): port queue show to native Rust #1399
3 test(skill): port the skill-references test to Rust #1414
4 test(freeze): add live smoke test for freeze list #1434
5 feat(rust): port freeze list to native Rust #1435
6 test(freeze): add live smoke test for freeze create/update/delete #1436
7 feat(rust): port freeze create/update/delete to native Rust #1437
8 refactor(rust): dedupe emit-helper boilerplate across command crates #1438
9 refactor(rust): share test scaffolding via mergify-test-support crate #1439
10 refactor(core): introduce CommandContext for the queue+freeze prelude #1441
11 refactor(ci): consolidate the CI-env scrubber into a shared testing module #1442
12 refactor: drop stale Phase X.Y doc markers and one inline color branch #1443
13 refactor(tui): share StyledGlyph across queue show/status renderers #1444
14 refactor(queue): drop indexmap, group_by_scope returns a Vec<(K, V)> #1445
15 refactor(ci): swap uuid for getrandom in the GHA heredoc delimiter #1446
16 refactor(config): standardize the workspace on serde_yaml_ng for YAML parsing #1447

@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented May 11, 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,})

@jd jd force-pushed the devs/jd/worktree-rust-port/add-live-smoke-test-queue-show--944234ba branch from 80f3f59 to 4ceec24 Compare May 11, 2026 12:19
@jd jd had a problem deploying to func-tests-live May 11, 2026 12:19 — with GitHub Actions Failure
@jd
Copy link
Copy Markdown
Member Author

jd commented May 11, 2026

Revision history

# Type Changes Reason Date
1 initial 80f3f59 2026-05-11 12:19 UTC
2 rebase 80f3f59 → 4ceec24 2026-05-11 12:19 UTC
3 rebase 4ceec24 → 9712abd 2026-05-11 14:08 UTC
4 content 9712abd → ca322fe 2026-05-11 14:59 UTC
5 content ca322fe → bea6443 2026-05-11 15:05 UTC
6 rebase bea6443 → 2d08ea5 2026-05-11 20:59 UTC
7 rebase 2d08ea5 → 9bbe2bc (rebase only) 2026-05-12 07:44 UTC
8 rebase 9bbe2bc → 85a46d3 (rebase only) 2026-05-13 08:25 UTC
9 rebase 85a46d3 → 77ebbfc (rebase only) 2026-05-18 08:20 UTC
10 rebase 77ebbfc → f15a0d7 (rebase only) 2026-05-19 08:07 UTC
11 rebase f15a0d7 → ede38fd (rebase only) 2026-05-19 13:04 UTC
12 rebase ede38fd → c86649e (rebase only) 2026-05-19 14:15 UTC

@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 11, 2026 12:19 Failure
@mergify mergify Bot requested a review from a team May 11, 2026 12:34
@jd jd force-pushed the devs/jd/worktree-rust-port/add-live-smoke-test-queue-show--944234ba branch from 4ceec24 to 9712abd Compare May 11, 2026 14:07
@jd jd had a problem deploying to func-tests-live May 11, 2026 14:08 — with GitHub Actions Failure
@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 11, 2026 14:08 Failure
@jd jd force-pushed the devs/jd/worktree-rust-port/derive-native-queue-cmds-binary-hardcoded-list--74502fe8 branch from 5f46f32 to fe2d5a6 Compare May 11, 2026 14:59
@jd jd force-pushed the devs/jd/worktree-rust-port/add-live-smoke-test-queue-show--944234ba branch from 9712abd to ca322fe Compare May 11, 2026 14:59
@jd jd had a problem deploying to func-tests-live May 11, 2026 14:59 — with GitHub Actions Failure
@jd jd had a problem deploying to func-tests-live May 11, 2026 14:59 — with GitHub Actions Failure
@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 11, 2026 15:00 Failure
@jd jd force-pushed the devs/jd/worktree-rust-port/add-live-smoke-test-queue-show--944234ba branch from ca322fe to bea6443 Compare May 11, 2026 15:05
@jd jd temporarily deployed to func-tests-live May 11, 2026 15:05 — with GitHub Actions Inactive
@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 11, 2026 15:06 Failure
@jd jd force-pushed the devs/jd/worktree-rust-port/derive-native-queue-cmds-binary-hardcoded-list--74502fe8 branch from 04d5e60 to 8c3dfb2 Compare May 11, 2026 20:59
Pins the contract for ``mergify queue show`` 404 handling
before the Rust port lands on top. Same test exercises Python
at this PR's CI and Rust on the port commit's rebase.

Uses a PR number far above the test repo's actual PR count to
force the 404 path. That's robust against the test repo's queue
state (PR #1 may or may not be queued at any given moment) and
exercises the parts that would silently break on URL or schema
drift: endpoint reachability, auth, and 404 → ``MERGIFY_API_ERROR``
exit code (6) mapping with the ``not in the merge queue`` message.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Change-Id: I944234ba2d22d99b410f4b8c91e56f0d8a49a9f7
@jd jd force-pushed the devs/jd/worktree-rust-port/add-live-smoke-test-queue-show--944234ba branch from ede38fd to c86649e Compare May 19, 2026 14:14
@jd jd temporarily deployed to func-tests-live May 19, 2026 14:15 — with GitHub Actions Inactive
@mergify mergify Bot deployed to Mergify Merge Protections May 19, 2026 14:15 Active
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented May 19, 2026

Merge Queue Status

  • Entered queue2026-05-19 15:33 UTC · Rule: default
  • Checks skipped · PR is already up-to-date
  • Merged2026-05-19 15:33 UTC · at c86649e5a4d04a7704d95e9e489ffd168f264ec5 · squash

This pull request spent 16 seconds in the queue, including 3 seconds running CI.

Required conditions to merge

@mergify mergify Bot added the queued label May 19, 2026
@mergify mergify Bot merged commit ec257db into main May 19, 2026
19 checks passed
@mergify mergify Bot deleted the devs/jd/worktree-rust-port/add-live-smoke-test-queue-show--944234ba branch May 19, 2026 15:33
@mergify mergify Bot removed the queued label May 19, 2026
mergify Bot pushed a commit that referenced this pull request May 20, 2026
The Rust binary now serves ``mergify queue show <PR_NUMBER>``
natively. The Python implementation
(``mergify_cli/queue/cli.py:show`` plus the eight rendering
helpers it depended on, plus ``mergify_cli/queue/api.py``) is
removed in the same PR — the port-and-delete rule keeps a single
live copy of every command.

This is the last command in the ``queue`` group, so the whole
``mergify_cli/queue/`` Python package goes away. Closes the gap
noted in #1380's commit message: ``mergify queue --help`` now
lists ``show`` alongside ``pause`` / ``unpause`` / ``status``.

``mergify queue show <PR_NUMBER> [-v] [--json] [-r REPO]
[-t TOKEN] [-u URL]``:

1. Resolves repository / token / API URL via the shared
   ``mergify_core::auth`` resolver.
2. Fetches ``GET /v1/repos/<repo>/merge-queue/pull/<pr_number>``
   through the new ``HttpClient::get_if_exists`` helper. On 404
   the command exits with ``MERGIFY_API_ERROR`` and the message
   ``PR #<n> is not in the merge queue``, matching the Python
   implementation. Other 4xx/5xx surface as normal API errors.
3. With ``--json``: pretty-prints the raw response. Schema is the
   Mergify API contract, so unknown fields survive verbatim.
4. Without ``--json``: renders the metadata block (position /
   priority / queue rule / queued / ETA), then a CI-state line
   and a checks section, then a conditions section.
   ``--verbose`` switches the checks summary to a full table and
   the conditions summary to a tree (``├── └── │   ``) instead
   of the compact ``N/M met`` summary with bullet-listed
   failures.

New plumbing in ``mergify-core::http``:

- ``Client::get_if_exists<T>(&path) -> Result<Option<T>, _>`` —
  GET that returns ``None`` on 404. Mirrors
  ``delete_if_exists`` for read-only endpoints where "not found"
  is a meaningful caller branch rather than a server failure.
  Reuses the same retry policy, bearer-auth injection, and
  flavor-aware error mapping as ``get`` / ``post`` / ``put``.

Tests:

- 7 new unit tests in ``crates/mergify-queue/src/show.rs``:
  compact metadata + checks summary + failing-conditions block;
  verbose checks table + conditions tree; JSON passthrough with
  a synthetic ``future_field`` to verify unknown fields survive;
  404 → ``MergifyApi`` error with the right message; missing
  ``mergeability_check`` falls through to "Waiting for
  mergeability check..."; condition-group summarization (two
  labels joined with ``or``; truncation at 3+ labels);
  aggregator recursion (``any of`` / ``all of`` / ``not`` falls
  through to the first leaf).

Wiring:

- ``crates/mergify-cli/src/main.rs``: adds ``Show(ShowCliArgs)``
  to ``QueueSubcommand``, dispatch to
  ``mergify_queue::show::run``. Adds ``("queue", "show")`` to
  ``NATIVE_COMMANDS``. ``ShowCliArgs`` carries the positional
  ``pr_number: u64`` plus ``--verbose`` and ``--json`` flags.

Python deletions:

- ``mergify_cli/queue/__init__.py`` / ``cli.py`` / ``api.py``:
  removed entirely. The whole package goes away — all four
  ``queue`` subcommands are now Rust-native.
- ``mergify_cli/cli.py``: drops the
  ``from mergify_cli.queue import cli as queue_cli_mod`` import
  and the ``cli.add_command(queue_cli_mod.queue)`` call.
- ``mergify_cli/tests/queue/test_cli.py``: deleted entirely (it
  only covered ``_relative_time``, which lives in
  ``mergify-tui::time`` now).
- ``mergify_cli/tests/queue/test_show.py``: deleted entirely.
- ``mergify_cli/tests/queue/test_skill.py``: drops the click
  import; the skill-reference check now consults the binary
  alone (no parallel click-command list to merge).

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

Depends-On: #1408
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