Skip to content

feat: add mergify stack sync CLI command#1116

Open
jd wants to merge 1 commit intomainfrom
devs/jd/feat/pre-push-hook-intercept/I14bca20f08f8fcd5d265c86ebd5e1fd2eac688c6
Open

feat: add mergify stack sync CLI command#1116
jd wants to merge 1 commit intomainfrom
devs/jd/feat/pre-push-hook-intercept/I14bca20f08f8fcd5d265c86ebd5e1fd2eac688c6

Conversation

@jd
Copy link
Copy Markdown
Member

@jd jd commented Apr 10, 2026

Exposes the smart_rebase algorithm as mergify stack sync, which
fetches trunk, detects merged PRs, drops them, and rebases in one
step. Supports --dry-run to preview what would happen.

Claude-Session-Id: 2d9f4a52-4a1d-4a50-a459-3b57847dec9f

@jd
Copy link
Copy Markdown
Member Author

jd commented Apr 10, 2026

This pull request is part of a stack:

  1. feat: add mergify stack sync CLI command (#1116) 👈
  2. feat: add inline CI, review, and merge status to mergify stack list (#1117)

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Apr 10, 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

or

  • author = dependabot[bot]

or

  • author = mergify-ci-bot

or

  • author = renovate[bot]
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

🟢 🤖 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,})

@jd jd force-pushed the devs/jd/feat/pre-push-hook-intercept/I14bca20f08f8fcd5d265c86ebd5e1fd2eac688c6 branch from f6b1cdf to 82f01a2 Compare April 10, 2026 09:13
@jd jd force-pushed the devs/jd/feat/pre-push-hook-intercept/If517fa97f6ed588bf1f2782aa14a1411936c9379 branch from fdd8a2d to 06101a3 Compare April 10, 2026 09:13
@mergify mergify bot had a problem deploying to Mergify Merge Protections April 10, 2026 09:14 Failure
@jd jd force-pushed the devs/jd/feat/pre-push-hook-intercept/I14bca20f08f8fcd5d265c86ebd5e1fd2eac688c6 branch from 82f01a2 to 6456b6d Compare April 10, 2026 09:24
@mergify mergify bot had a problem deploying to Mergify Merge Protections April 10, 2026 09:24 Failure
@mergify mergify bot requested a review from a team April 10, 2026 09:27
@jd jd force-pushed the devs/jd/feat/pre-push-hook-intercept/I14bca20f08f8fcd5d265c86ebd5e1fd2eac688c6 branch from 6456b6d to 9a98892 Compare April 10, 2026 09:36
@mergify mergify bot had a problem deploying to Mergify Merge Protections April 10, 2026 09:37 Failure
@jd jd marked this pull request as ready for review April 10, 2026 11:09
Copilot AI review requested due to automatic review settings April 10, 2026 11:09
Copy link
Copy Markdown

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 stack sync workflow entrypoint to keep a local stack branch aligned with trunk by leveraging the existing smart_rebase logic (including dropping commits whose PRs have already been merged), plus documentation and integration tests to validate behavior.

Changes:

  • Introduces stack_sync() in mergify_cli/stack/sync.py to fetch trunk, run the smart rebase flow, and print user-facing status (with --dry-run support).
  • Wires a new mergify stack sync Click subcommand into the stack CLI.
  • Adds integration-style tests for sync scenarios (up-to-date, merged commits dropped, all merged, dry-run) and updates the stack workflow skill docs.

Reviewed changes

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

File Description
mergify_cli/stack/sync.py Adds stack_sync() wrapper around fetch + smart_rebase() with user-facing output and --dry-run.
mergify_cli/stack/cli.py Adds mergify stack sync command and forwards basic options to stack_sync().
mergify_cli/tests/stack/test_sync.py Adds integration tests covering the new sync behavior and output.
mergify_cli/stack/skill.md Documents the new mergify stack sync command and recommended usage.

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

Base automatically changed from devs/jd/feat/pre-push-hook-intercept/If517fa97f6ed588bf1f2782aa14a1411936c9379 to main April 10, 2026 13:40
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Apr 10, 2026

@jd this pull request is now in conflict 😩

@mergify mergify bot added the conflict label Apr 10, 2026
sileht
sileht previously approved these changes Apr 10, 2026
@mergify mergify bot requested a review from a team April 10, 2026 13:45
@jd jd force-pushed the devs/jd/feat/pre-push-hook-intercept/I14bca20f08f8fcd5d265c86ebd5e1fd2eac688c6 branch from 9a98892 to 7dc6609 Compare April 10, 2026 13:55
@mergify mergify bot removed the conflict label Apr 10, 2026
@mergify mergify bot dismissed sileht’s stale review April 10, 2026 13:56

Pull request has been modified.

@mergify mergify bot deployed to Mergify Merge Protections April 10, 2026 13:56 Active
JulianMaurin
JulianMaurin previously approved these changes Apr 10, 2026
@mergify mergify bot requested a review from a team April 10, 2026 14:01
kozlek
kozlek previously approved these changes Apr 10, 2026
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Apr 10, 2026

Merge Queue Status

  • Entered queue2026-04-10 18:34 UTC · Rule: default
  • 🚫 Left the queue2026-04-10 18:34 UTC · at 7dc6609fcb8bd456007fe9e49dffb30d6cf0a1e1

This pull request spent 5 seconds in the queue, with no time running CI.

Reason

The pull request conflicts with pull requests ahead in queue: #1133

Hint

There is nothing you can do for now. If the pull request ahead in the queue is merged, this pull request will become conflicting and you'll have to update it.
If the pull request ahead is not merged, you can requeue this pull request with a @mergifyio queue comment.

@mergify mergify bot added the dequeued label Apr 10, 2026
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Apr 10, 2026

@jd this pull request is now in conflict 😩

@mergify mergify bot added the conflict label Apr 10, 2026
@jd jd force-pushed the devs/jd/feat/pre-push-hook-intercept/I14bca20f08f8fcd5d265c86ebd5e1fd2eac688c6 branch from 7dc6609 to 515e148 Compare April 11, 2026 07:16
@mergify mergify bot removed the conflict label Apr 11, 2026
@mergify mergify bot dismissed stale reviews from kozlek and JulianMaurin April 11, 2026 07:17

Pull request has been modified.

@mergify mergify bot removed the dequeued label Apr 11, 2026
@mergify mergify bot had a problem deploying to Mergify Merge Protections April 11, 2026 07:17 Failure
Exposes the smart_rebase algorithm as `mergify stack sync`, which
fetches trunk, detects merged PRs, drops them, and rebases in one
step. Supports --dry-run to preview what would happen.

Change-Id: I14bca20f08f8fcd5d265c86ebd5e1fd2eac688c6
Claude-Session-Id: 2d9f4a52-4a1d-4a50-a459-3b57847dec9f
@jd jd force-pushed the devs/jd/feat/pre-push-hook-intercept/I14bca20f08f8fcd5d265c86ebd5e1fd2eac688c6 branch from 515e148 to f0e7332 Compare April 11, 2026 07:42
@mergify mergify bot had a problem deploying to Mergify Merge Protections April 11, 2026 07:42 Failure
@mergify mergify bot requested a review from a team April 11, 2026 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants