Skip to content

test(skill): port the skill-references test to Rust#1414

Merged
mergify[bot] merged 1 commit into
mainfrom
devs/jd/worktree-rust-port/port-skill-refs-test-rust--7eb5e384
May 20, 2026
Merged

test(skill): port the skill-references test to Rust#1414
mergify[bot] merged 1 commit into
mainfrom
devs/jd/worktree-rust-port/port-skill-refs-test-rust--7eb5e384

Conversation

@jd
Copy link
Copy Markdown
Member

@jd jd commented May 12, 2026

Replaces mergify_cli/tests/queue/test_skill.py with a Rust
integration test in crates/mergify-cli/tests/skill_references.rs.

The test validates two artifacts with no Python in the picture:

  • The skills/mergify-merge-queue/SKILL.md Markdown file
    (frontmatter shape, required sections).
  • The Rust binary's --list-native-commands output (every
    mergify queue <cmd> reference in the skill must resolve to
    a native command).

Keeping the test in pytest meant carrying Python plumbing for a
language-agnostic concern. The Rust port:

  • spawns the binary via CARGO_BIN_EXE_mergify (the artifact
    cargo test just built), so the test always exercises the
    current code rather than whatever mergify happens to be on
    PATH;
  • reads the skill file via CARGO_MANIFEST_DIR-relative
    resolution, so it's robust to the cwd;
  • adds two dev-deps to mergify-cli (regex for the
    frontmatter / reference patterns, serde_yaml_ng for
    frontmatter parsing — already used by mergify-ci).

The mergify_cli/tests/queue/ directory had no other content,
so it goes away entirely; the Python yaml dev-dep stays in
place for now (still used elsewhere).

4 tests, same coverage as before:

  • skill_content_is_readable
  • skill_has_valid_frontmatter
  • skill_has_required_sections
  • skill_references_valid_commands

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

@jd
Copy link
Copy Markdown
Member Author

jd commented May 12, 2026

This pull request is part of a Mergify stack:

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

@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented May 12, 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 marked this pull request as ready for review May 12, 2026 13:35
@mergify mergify Bot requested a review from a team May 12, 2026 13:46
@jd jd force-pushed the devs/jd/worktree-rust-port/port-queue-show-native-rust--6c265303 branch from 72c4bf3 to 9d67b7f Compare May 13, 2026 08:25
@jd jd force-pushed the devs/jd/worktree-rust-port/port-skill-refs-test-rust--7eb5e384 branch from 1c824a4 to c051a4c Compare May 13, 2026 08:25
@jd
Copy link
Copy Markdown
Member Author

jd commented May 13, 2026

Revision history

# Type Changes Reason Date
1 initial 1c824a4 2026-05-13 08:25 UTC
2 rebase 1c824a4 → c051a4c (rebase only) 2026-05-13 08:25 UTC
3 rebase c051a4c → c78e289 (rebase only) 2026-05-18 08:20 UTC
4 rebase c78e289 → f9ee5e7 (rebase only) 2026-05-19 08:07 UTC
5 content f9ee5e7 → 458fec9 2026-05-19 13:04 UTC
6 rebase 458fec9 → a0a4522 (rebase only) 2026-05-19 14:15 UTC
7 rebase a0a4522 → 9b87b7a (rebase only) 2026-05-20 08:42 UTC
8 content 9b87b7a → c228d70 (raw) 2026-05-20 09:05 UTC

@jd jd temporarily deployed to func-tests-live May 13, 2026 08:25 — with GitHub Actions Inactive
@jd jd temporarily deployed to func-tests-live May 13, 2026 08:25 — with GitHub Actions Inactive
@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 13, 2026 08:25 Failure
sileht
sileht previously approved these changes May 18, 2026
@mergify mergify Bot requested a review from a team May 18, 2026 07:50
@jd jd force-pushed the devs/jd/worktree-rust-port/port-queue-show-native-rust--6c265303 branch from 9d67b7f to ceb14f3 Compare May 18, 2026 08:20
@jd jd force-pushed the devs/jd/worktree-rust-port/port-skill-refs-test-rust--7eb5e384 branch from c051a4c to c78e289 Compare May 18, 2026 08:20
@jd jd temporarily deployed to func-tests-live May 18, 2026 08:20 — with GitHub Actions Inactive
@jd jd temporarily deployed to func-tests-live May 18, 2026 08:20 — with GitHub Actions Inactive
@mergify mergify Bot dismissed sileht’s stale review May 18, 2026 08:20

Pull request has been modified.

@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 18, 2026 08:20 Failure
@jd jd force-pushed the devs/jd/worktree-rust-port/port-skill-refs-test-rust--7eb5e384 branch from c78e289 to f9ee5e7 Compare May 19, 2026 08:07
@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 19, 2026 14:15 Failure
Base automatically changed from devs/jd/worktree-rust-port/port-queue-show-native-rust--6c265303 to main May 20, 2026 07:46
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented May 20, 2026

@jd this pull request is now in conflict 😩

@mergify mergify Bot added the conflict label May 20, 2026
Copilot AI review requested due to automatic review settings May 20, 2026 08:42
@jd jd force-pushed the devs/jd/worktree-rust-port/port-skill-refs-test-rust--7eb5e384 branch from a0a4522 to 9b87b7a Compare May 20, 2026 08:42
@jd jd temporarily deployed to func-tests-live May 20, 2026 08:42 — with GitHub Actions Inactive
@jd jd temporarily deployed to func-tests-live May 20, 2026 08:42 — with GitHub Actions Inactive
@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 20, 2026 08:43 Failure
@mergify mergify Bot removed the conflict label May 20, 2026
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

Ports the merge-queue skill validation test from pytest to a Rust integration test, so the checks run directly against the freshly built mergify binary and the repository’s SKILL.md without requiring Python test plumbing.

Changes:

  • Removed the Python test_skill.py and the now-empty mergify_cli/tests/queue/ test package.
  • Added crates/mergify-cli/tests/skill_references.rs to validate SKILL frontmatter/sections and cross-check mergify queue <cmd> references against --list-native-commands.
  • Added Rust dev-dependencies (regex, serde_yaml_ng) for frontmatter parsing and reference extraction.

Reviewed changes

Copilot reviewed 3 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
mergify_cli/tests/queue/test_skill.py Removes the pytest-based skill validation test.
mergify_cli/tests/queue/init.py Removes the now-unused Python test package marker (directory deleted).
crates/mergify-cli/tests/skill_references.rs New Rust integration test that validates SKILL.md and command references via the built binary.
crates/mergify-cli/Cargo.toml Adds dev-dependencies needed by the new Rust integration test.
Cargo.lock Locks new transitive dependencies introduced by the Rust test dev-deps.

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

Comment thread crates/mergify-cli/tests/skill_references.rs Outdated
Comment thread crates/mergify-cli/tests/skill_references.rs
Replaces ``mergify_cli/tests/queue/test_skill.py`` with a Rust
integration test in ``crates/mergify-cli/tests/skill_references.rs``.

The test validates two artifacts with no Python in the picture:

- The ``skills/mergify-merge-queue/SKILL.md`` Markdown file
  (frontmatter shape, required sections).
- The Rust binary's ``--list-native-commands`` output (every
  ``mergify queue <cmd>`` reference in the skill must resolve to
  a native command).

Keeping the test in pytest meant carrying Python plumbing for a
language-agnostic concern. The Rust port:

- spawns the binary via ``CARGO_BIN_EXE_mergify`` (the artifact
  ``cargo test`` just built), so the test always exercises the
  current code rather than whatever ``mergify`` happens to be on
  ``PATH``;
- reads the skill file via ``CARGO_MANIFEST_DIR``-relative
  resolution, so it's robust to the cwd;
- adds two dev-deps to ``mergify-cli`` (``regex`` for the
  frontmatter / reference patterns, ``serde_yaml_ng`` for
  frontmatter parsing — already used by ``mergify-ci``).

The ``mergify_cli/tests/queue/`` directory had no other content,
so it goes away entirely; the Python ``yaml`` dev-dep stays in
place for now (still used elsewhere).

4 tests, same coverage as before:

- ``skill_content_is_readable``
- ``skill_has_valid_frontmatter``
- ``skill_has_required_sections``
- ``skill_references_valid_commands``

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Change-Id: I7eb5e3849dcb4219341be78173717ecd137f2d08
@jd jd force-pushed the devs/jd/worktree-rust-port/port-skill-refs-test-rust--7eb5e384 branch from 9b87b7a to c228d70 Compare May 20, 2026 09:05
@jd jd temporarily deployed to func-tests-live May 20, 2026 09:05 — with GitHub Actions Inactive
@mergify mergify Bot deployed to Mergify Merge Protections May 20, 2026 09:06 Active
@mergify mergify Bot requested a review from a team May 20, 2026 09:18
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented May 20, 2026

Merge Queue Status

  • Entered queue2026-05-20 10:06 UTC · Rule: default
  • Checks skipped · PR is already up-to-date
  • Merged2026-05-20 10:07 UTC · at c228d7088582f479d5c2253490ca665c3998f71a · squash

This pull request spent 1 minute 3 seconds in the queue, including 5 seconds running CI.

Required conditions to merge

@mergify mergify Bot merged commit f95a923 into main May 20, 2026
19 checks passed
@mergify mergify Bot deleted the devs/jd/worktree-rust-port/port-skill-refs-test-rust--7eb5e384 branch May 20, 2026 10:07
@mergify mergify Bot added queued and removed queued labels May 20, 2026
mergify Bot pushed a commit that referenced this pull request May 20, 2026
Pin the URL + auth + JSON-array shape of `freeze list --json`
against the real Mergify API before the upcoming Python → Rust
port. The Python `list_cmd` returns the inner
`scheduled_freezes` array verbatim, so the test asserts that
the `--json` output parses as a JSON array — same contract we
want preserved across both ends of the port.

Uses `live_admin_token` because scheduled-freeze endpoints sit
under the queue-management family and the CI-scoped token is
rejected with 403.

Group-level options (`--token` / `--api-url` / `--repository`)
come before the subcommand — Click requires it on the Python
side, clap accepts both orders.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

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