test(skill): port the skill-references test to Rust#1414
Conversation
|
This pull request is part of a Mergify stack:
|
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🟢 🤖 Continuous IntegrationWonderful, this rule succeeded.
🟢 👀 Review RequirementsWonderful, this rule succeeded.
🟢 Enforce conventional commitWonderful, this rule succeeded.Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
🟢 🔎 ReviewsWonderful, this rule succeeded.
🟢 📕 PR descriptionWonderful, this rule succeeded.
|
72c4bf3 to
9d67b7f
Compare
1c824a4 to
c051a4c
Compare
Revision history
|
9d67b7f to
ceb14f3
Compare
c051a4c to
c78e289
Compare
c78e289 to
f9ee5e7
Compare
|
@jd this pull request is now in conflict 😩 |
a0a4522 to
9b87b7a
Compare
There was a problem hiding this comment.
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.pyand the now-emptymergify_cli/tests/queue/test package. - Added
crates/mergify-cli/tests/skill_references.rsto validate SKILL frontmatter/sections and cross-checkmergify 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.
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
9b87b7a to
c228d70
Compare
Merge Queue Status
This pull request spent 1 minute 3 seconds in the queue, including 5 seconds running CI. Required conditions to merge
|
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
Replaces
mergify_cli/tests/queue/test_skill.pywith a Rustintegration test in
crates/mergify-cli/tests/skill_references.rs.The test validates two artifacts with no Python in the picture:
skills/mergify-merge-queue/SKILL.mdMarkdown file(frontmatter shape, required sections).
--list-native-commandsoutput (everymergify queue <cmd>reference in the skill must resolve toa native command).
Keeping the test in pytest meant carrying Python plumbing for a
language-agnostic concern. The Rust port:
CARGO_BIN_EXE_mergify(the artifactcargo testjust built), so the test always exercises thecurrent code rather than whatever
mergifyhappens to be onPATH;CARGO_MANIFEST_DIR-relativeresolution, so it's robust to the cwd;
mergify-cli(regexfor thefrontmatter / reference patterns,
serde_yaml_ngforfrontmatter parsing — already used by
mergify-ci).The
mergify_cli/tests/queue/directory had no other content,so it goes away entirely; the Python
yamldev-dep stays inplace for now (still used elsewhere).
4 tests, same coverage as before:
skill_content_is_readableskill_has_valid_frontmatterskill_has_required_sectionsskill_references_valid_commandsCo-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com