feat(rust): port freeze create/update/delete to native Rust#1437
Open
jd wants to merge 2 commits into
Open
Conversation
Member
Author
|
This pull request is part of a Mergify stack:
|
This was referenced May 19, 2026
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.
|
be2b24a to
f0eb260
Compare
Member
Author
Revision history
|
f0eb260 to
56f3cf1
Compare
414a70b to
8106d1c
Compare
56f3cf1 to
50fcb0d
Compare
fa07747 to
955e497
Compare
f322a06 to
7aefa73
Compare
7aefa73 to
622f895
Compare
1ac4b0d to
a8fc711
Compare
622f895 to
032f043
Compare
032f043 to
fcc43ed
Compare
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
Round-trip the three remaining freeze mutations: - `freeze create` — `POST /v1/repos/<r>/scheduled_freeze` with the Python `CreateScheduledFreezePayload` shape: `start`/`end` always present (null for open-ended emergency freezes), `matching_conditions`/`exclude_conditions` keys omitted when the user passed no `-c`/`-e` flags. When `--timezone` is left off, falls back to `iana-time-zone::get_timezone()` — same role as Python's `tzlocal.get_localzone_name()`. - `freeze update` — `PATCH /v1/repos/<r>/scheduled_freeze/<id>` with skip-if-none on every field so PATCH semantics work correctly: a flag the user didn't pass doesn't touch the stored field. - `freeze delete` — `POST /v1/repos/<r>/scheduled_freeze/<id>/delete` with `delete_reason` in the body only when supplied (the API requires it for active freezes; the CLI lets the server reject a missing reason rather than pre-validating). Adds `Client::patch` on the core HTTP client, a shared `mergify-freeze::common` module (wire-format struct, naive-DT parser, system-timezone detection, per-freeze human printer used by `create` and `update`), and `iana-time-zone` as a new dependency. The Python implementation of each command is left in place but no longer reachable via the binary, since clap now dispatches the whole freeze group natively. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Change-Id: I653dbf47080f439f8c3500a7a526e46d707fc639
fcc43ed to
a2bd0dd
Compare
d82958d to
8f0b96b
Compare
Base automatically changed from
devs/jd/worktree-rust-port/add-live-smoke-test-freeze-create-update-delete--9a7b270e
to
main
May 21, 2026 14:50
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.
Round-trip the three remaining freeze mutations:
freeze create—POST /v1/repos/<r>/scheduled_freezewiththe Python
CreateScheduledFreezePayloadshape:start/endalways present (null for open-ended emergency freezes),
matching_conditions/exclude_conditionskeys omitted whenthe user passed no
-c/-eflags. When--timezoneis leftoff, falls back to
iana-time-zone::get_timezone()— samerole as Python's
tzlocal.get_localzone_name().freeze update—PATCH /v1/repos/<r>/scheduled_freeze/<id>with skip-if-none on every field so PATCH semantics work
correctly: a flag the user didn't pass doesn't touch the
stored field.
freeze delete—POST /v1/repos/<r>/scheduled_freeze/<id>/deletewith
delete_reasonin the body only when supplied (the APIrequires it for active freezes; the CLI lets the server
reject a missing reason rather than pre-validating).
Adds
Client::patchon the core HTTP client, a sharedmergify-freeze::commonmodule (wire-format struct, naive-DTparser, system-timezone detection, per-freeze human printer
used by
createandupdate), andiana-time-zoneas a newdependency. The Python implementation of each command is left
in place but no longer reachable via the binary, since clap now
dispatches the whole freeze group natively.
Co-Authored-By: Claude Opus 4.7 noreply@anthropic.com
Depends-On: #1436