Skip to content

test(freeze): add live smoke test for freeze create/update/delete#1436

Open
jd wants to merge 4 commits into
mainfrom
devs/jd/worktree-rust-port/add-live-smoke-test-freeze-create-update-delete--9a7b270e
Open

test(freeze): add live smoke test for freeze create/update/delete#1436
jd wants to merge 4 commits into
mainfrom
devs/jd/worktree-rust-port/add-live-smoke-test-freeze-create-update-delete--9a7b270e

Conversation

@jd
Copy link
Copy Markdown
Member

@jd jd commented May 19, 2026

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

Depends-On: #1435

@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 19, 2026 08:20 Failure
@jd
Copy link
Copy Markdown
Member Author

jd commented May 19, 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 19, 2026

Merge Protections

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

🔴 👀 Review Requirements

Waiting for

  • #approved-reviews-by>=2
This rule is failing.
  • any of:
    • #approved-reviews-by>=2
    • author = dependabot[bot]
    • author = mergify-ci-bot
    • author = renovate[bot]

🔴 🔎 Reviews

Waiting for

  • #review-requested = 0
This rule is failing.
  • #review-requested = 0
  • #changes-requested-reviews-by = 0
  • #review-threads-unresolved = 0

🟢 ⛓️ Depends-On Requirements

Wonderful, this rule succeeded.

Requirement based on the presence of Depends-On in the body of the pull request

🟢 🤖 Continuous Integration

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

🟢 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)(?:\(.+\))?:

🟢 📕 PR description

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

@mergify mergify Bot requested a review from a team May 19, 2026 08:37
@jd jd marked this pull request as ready for review May 19, 2026 08:53
@jd jd force-pushed the devs/jd/worktree-rust-port/add-live-smoke-test-freeze-create-update-delete--9a7b270e branch from f77ec67 to 414a70b Compare May 19, 2026 08:56
@jd jd temporarily deployed to func-tests-live May 19, 2026 08:56 — with GitHub Actions Inactive
@jd
Copy link
Copy Markdown
Member Author

jd commented May 19, 2026

Revision history

# Type Changes Reason Date
1 initial f77ec67 2026-05-19 08:56 UTC
2 content f77ec67 → 414a70b (raw) 2026-05-19 08:56 UTC
3 rebase 414a70b → 8106d1c (rebase only) 2026-05-19 13:04 UTC
4 rebase 8106d1c → fa07747 (rebase only) 2026-05-19 14:15 UTC
5 rebase fa07747 → 955e497 (rebase only) 2026-05-20 08:42 UTC
6 rebase 955e497 → 1ac4b0d (rebase only) 2026-05-20 09:05 UTC

@jd jd temporarily deployed to func-tests-live May 19, 2026 08:56 — with GitHub Actions Inactive
@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 19, 2026 08:56 Failure
@jd jd force-pushed the devs/jd/worktree-rust-port/add-live-smoke-test-freeze-create-update-delete--9a7b270e branch from 414a70b to 8106d1c Compare May 19, 2026 13:04
@jd jd temporarily deployed to func-tests-live May 19, 2026 13:04 — with GitHub Actions Inactive
@jd jd temporarily deployed to func-tests-live May 19, 2026 13:04 — with GitHub Actions Inactive
@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 19, 2026 13:04 Failure
@jd jd force-pushed the devs/jd/worktree-rust-port/port-freeze-list-native-rust--40ca436a branch from 078f0e6 to fca204c Compare May 19, 2026 14:14
@jd jd force-pushed the devs/jd/worktree-rust-port/add-live-smoke-test-freeze-create-update-delete--9a7b270e branch from 8106d1c to fa07747 Compare May 19, 2026 14:14
@jd jd temporarily deployed to func-tests-live May 19, 2026 14:15 — with GitHub Actions Inactive
@jd jd temporarily deployed to func-tests-live May 19, 2026 14:15 — with GitHub Actions Inactive
@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 19, 2026 14:15 Failure
@jd jd force-pushed the devs/jd/worktree-rust-port/add-live-smoke-test-freeze-create-update-delete--9a7b270e branch from fa07747 to 955e497 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
jd and others added 4 commits May 20, 2026 11:04
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
@jd jd force-pushed the devs/jd/worktree-rust-port/add-live-smoke-test-freeze-create-update-delete--9a7b270e branch from 955e497 to 1ac4b0d 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 had a problem deploying to Mergify Merge Protections May 20, 2026 09:06 Failure
Base automatically changed from devs/jd/worktree-rust-port/port-freeze-list-native-rust--40ca436a to main May 20, 2026 17:00
@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

1 participant