Skip to content

feat(freeze): add scheduled freeze CLI commands#993

Open
jd wants to merge 1 commit intomainfrom
devs/jd/worktree-scheduled-freeze/I414d168066f7b5070e75520bdcbb8189d694ad72
Open

feat(freeze): add scheduled freeze CLI commands#993
jd wants to merge 1 commit intomainfrom
devs/jd/worktree-scheduled-freeze/I414d168066f7b5070e75520bdcbb8189d694ad72

Conversation

@jd
Copy link
Member

@jd jd commented Feb 26, 2026

Add mergify freeze command group with list, create, update, and delete
subcommands for managing scheduled merge freezes. Supports both Mergify
application keys and GitHub tokens for authentication, auto-detects
repository from git remote, and provides both table and JSON output.

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

@mergify mergify bot had a problem deploying to Mergify Merge Protections February 26, 2026 19:11 Failure
@jd jd marked this pull request as draft February 26, 2026 19:11
@mergify
Copy link
Contributor

mergify bot commented Feb 26, 2026

Merge Protections

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

🔴 👀 Review Requirements

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

🔴 🔎 Reviews

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

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

🟢 📕 PR description

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

@mergify
Copy link
Contributor

mergify bot commented Feb 26, 2026

🧪 CI Insights

Here's what we observed from your CI run for 389e2f9.

🟢 All jobs passed!

But CI Insights is watching 👀

@jd jd force-pushed the devs/jd/worktree-scheduled-freeze/I414d168066f7b5070e75520bdcbb8189d694ad72 branch from 572ba4a to e5d5b20 Compare February 26, 2026 19:48
@mergify mergify bot had a problem deploying to Mergify Merge Protections February 26, 2026 19:48 Failure
@mergify mergify bot requested a review from a team February 26, 2026 19:51
@jd jd marked this pull request as ready for review March 4, 2026 16:12
Copilot AI review requested due to automatic review settings March 4, 2026 16:12
Copy link

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

Adds a new mergify freeze command group to manage scheduled merge freezes via the Mergify API, along with a dedicated API wrapper and CLI tests.

Changes:

  • Introduces freeze CLI group with list, create, update, and delete subcommands, including table/JSON output.
  • Adds mergify_cli.freeze.api client functions for the scheduled freeze endpoints.
  • Adds a comprehensive respx-based CLI test suite for the new command group.

Reviewed changes

Copilot reviewed 4 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
mergify_cli/freeze/cli.py Implements the freeze click command group, formatting/output, and default token/repo detection.
mergify_cli/freeze/api.py Adds async API calls for list/create/update/delete scheduled freezes.
mergify_cli/cli.py Registers the new freeze command group in the top-level CLI.
mergify_cli/tests/freeze/test_cli.py Adds CLI tests covering list/create/update/delete flows and error paths.
mergify_cli/tests/freeze/__init__.py Adds package marker for freeze tests.
mergify_cli/freeze/__init__.py Adds package marker for freeze module.

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

@jd jd force-pushed the devs/jd/worktree-scheduled-freeze/I414d168066f7b5070e75520bdcbb8189d694ad72 branch from e5d5b20 to 097f802 Compare March 5, 2026 07:10
@mergify mergify bot had a problem deploying to Mergify Merge Protections March 5, 2026 07:10 Failure
@jd jd force-pushed the devs/jd/worktree-scheduled-freeze/I414d168066f7b5070e75520bdcbb8189d694ad72 branch from 097f802 to 9ee9a71 Compare March 5, 2026 07:14
@mergify mergify bot had a problem deploying to Mergify Merge Protections March 5, 2026 07:14 Failure
Add `mergify freeze` command group with list, create, update, and delete
subcommands for managing scheduled merge freezes. Supports both Mergify
application keys and GitHub tokens for authentication, auto-detects
repository from git remote, and provides both table and JSON output.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Change-Id: I414d168066f7b5070e75520bdcbb8189d694ad72
Claude-Session-Id: 77d8be2d-854a-4d80-ac2d-4489fa50e31d
@jd jd force-pushed the devs/jd/worktree-scheduled-freeze/I414d168066f7b5070e75520bdcbb8189d694ad72 branch from 9ee9a71 to 389e2f9 Compare March 5, 2026 08:01
@mergify mergify bot had a problem deploying to Mergify Merge Protections March 5, 2026 08:01 Failure
@jd jd requested a review from Copilot March 5, 2026 08:13
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No error handling on API responses

The API functions (list_freezes, create_freeze, etc.) call .json() on responses without checking status codes first. The check_for_status event hook on the HTTP client will raise on 4xx/5xx, but only after
aread() — if the hook fails to trigger or the client is used differently, you'd get silent failures. This is consistent with the existing codebase pattern though, so it's acceptable.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acknowledged — this follows the existing codebase pattern where check_for_status on the HTTP client event hook handles error responses.

required=True,
help="Matching condition (repeatable, e.g. -c 'base=main')",
)
@click.option(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Users shouldn't need to re-specify every field just to change the end time ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed this would be a better UX. The update API currently requires all fields (it's a full replacement, not a partial patch). We should change the API to support partial updates first, then update the CLI to match.

@mergify mergify bot requested a review from a team March 5, 2026 08:19
Copy link

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

Copilot reviewed 6 out of 8 changed files in this pull request and generated 5 comments.


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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants