test(freeze): add live smoke test for freeze create/update/delete#1436
Open
jd wants to merge 4 commits into
Open
test(freeze): add live smoke test for freeze create/update/delete#1436jd wants to merge 4 commits into
jd wants to merge 4 commits into
Conversation
Member
Author
|
This pull request is part of a Mergify stack:
|
This was referenced May 19, 2026
Contributor
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🔴 👀 Review RequirementsWaiting for
This rule is failing.
🔴 🔎 ReviewsWaiting for
This rule is failing.
🟢 ⛓️ Depends-On RequirementsWonderful, this rule succeeded.Requirement based on the presence of
🟢 🤖 Continuous IntegrationWonderful, this rule succeeded.
🟢 Enforce conventional commitWonderful, this rule succeeded.Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
🟢 📕 PR descriptionWonderful, this rule succeeded.
|
f77ec67 to
414a70b
Compare
Member
Author
Revision history
|
This was referenced May 19, 2026
414a70b to
8106d1c
Compare
078f0e6 to
fca204c
Compare
8106d1c to
fa07747
Compare
fa07747 to
955e497
Compare
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
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> Change-Id: I51b653702c10e184daff5f450f1edc4f3c581433
`mergify freeze list` is now handled by the Rust binary: a single `GET /v1/repos/<repo>/scheduled_freeze` with `--json` passthrough of the inner `scheduled_freezes` array or a human-readable table (ID / Reason / Start / End / Conditions / Status). The active-vs-scheduled flag is best-effort against UTC `now` — same approximation as Python's `_is_active`, with the same wrong-timezone caveat. New crate `mergify-freeze` mirrors the per-group layout used by `mergify-queue` and `mergify-ci`. Wired into the CLI via a new `freeze` clap group with global `--token` / `--api-url` / `--repository` options. Non-ported subcommands (`create` / `update` / `delete`) continue to fall through to the Python shim — they are not in `NATIVE_COMMANDS`, so `looks_native` rejects them and the fallback path runs unchanged. CRUD ports follow. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Change-Id: I40ca436a13dde8b5d725ef2fc023d35f7b66340e
Pin `POST` + `PATCH` + `POST .../{id}/delete` against the real
Mergify API as a single round-trip. The freeze is scheduled far
in the future (2099) so the server treats it as `scheduled` (no
active-freeze delete reason needed) and the test repo's queue
isn't disturbed. The delete runs from `finally` so cleanup is
guaranteed even when an assertion in the middle fails.
Uses `live_admin_token` because scheduled-freeze endpoints sit
under the queue-management family; the CI-scoped token is
rejected with 403. Each run picks a unique `func-tests-live-
smoke-<ts>` reason so concurrent or repeated runs don't fight
over the same row.
The freeze ID is parsed out of the create command's human
output (the same `_print_freeze` block the Rust port mirrors),
so the regex pins the per-freeze output format across both ends
of the port.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Change-Id: I9a7b270e04b86ca1bf71985b92350bee29d26f80
955e497 to
1ac4b0d
Compare
Base automatically changed from
devs/jd/worktree-rust-port/port-freeze-list-native-rust--40ca436a
to
main
May 20, 2026 17:00
Contributor
|
@jd this pull request is now in conflict 😩 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pin
POST+PATCH+POST .../{id}/deleteagainst the realMergify API as a single round-trip. The freeze is scheduled far
in the future (2099) so the server treats it as
scheduled(noactive-freeze delete reason needed) and the test repo's queue
isn't disturbed. The delete runs from
finallyso cleanup isguaranteed even when an assertion in the middle fails.
Uses
live_admin_tokenbecause scheduled-freeze endpoints situnder the queue-management family; the CI-scoped token is
rejected with 403. Each run picks a unique
func-tests-live- smoke-<ts>reason so concurrent or repeated runs don't fightover the same row.
The freeze ID is parsed out of the create command's human
output (the same
_print_freezeblock the Rust port mirrors),so the regex pins the per-freeze output format across both ends
of the port.
Co-Authored-By: Claude Opus 4.7 noreply@anthropic.com
Depends-On: #1435