Skip to content

ci: add workflow to auto-sync feature branch with main - #1302

Merged
LalatenduMohanty merged 1 commit into
python-wheel-build:mainfrom
LalatenduMohanty:auto-update-new-resolver-config
Aug 11, 2026
Merged

ci: add workflow to auto-sync feature branch with main#1302
LalatenduMohanty merged 1 commit into
python-wheel-build:mainfrom
LalatenduMohanty:auto-update-new-resolver-config

Conversation

@LalatenduMohanty

@LalatenduMohanty LalatenduMohanty commented Aug 11, 2026

Copy link
Copy Markdown
Member

Summary

Adds a GitHub Actions workflow that automatically keeps the new-resolver-config feature branch in sync with main, replacing the need for manual merge/rebase cycles during the feature's development.

Closes #1295

What it does

  • Auto-merge on push to main: every push to main triggers a merge of main into the feature branch, preventing conflict debt from accumulating.
  • Conflict detection with file listing: if the merge fails, the workflow opens a GitHub issue with the sync-conflict label listing the specific conflicting files so the team knows exactly what to resolve.
  • Duplicate issue prevention: checks for an existing open sync-conflict issue before creating a new one.
  • Auto-close resolved issues: when a subsequent sync succeeds (after manual conflict resolution), any open sync-conflict issue for that branch is automatically closed.
  • Reusable: the target branch is configurable via workflow_dispatch for use with future long-lived branches.

🤖 Generated with Claude Code

@LalatenduMohanty
LalatenduMohanty requested a review from a team as a code owner August 11, 2026 05:09
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a GitHub Actions workflow that synchronizes a configurable feature branch with main after pushes to main or manual dispatch. The workflow checks out the target branch, performs a non-interactive merge, pushes successful merges, reports branches that are already current, and aborts conflicted merges. For conflicts, it checks for an existing open sync-conflict issue, creates the label when needed, and opens one issue with manual resolution commands and the workflow run link.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the workflow that automatically synchronizes a feature branch with main.
Description check ✅ Passed The description directly explains the workflow, synchronization behavior, conflict handling, and configurable branch support.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mergify mergify Bot added the ci label Aug 11, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/sync-feature-branch.yaml:
- Around line 16-18: Add a job-level concurrency configuration to sync-branch
using inputs.target_branch || 'new-resolver-config' as the group and set
cancel-in-progress to false, ensuring runs targeting the same branch execute
serially.
- Around line 34-38: Update the Configure git step to stop interpolating
GH_TOKEN into git remote URLs. Set GH_TOKEN only for the gh auth setup-git
command, then configure origin with a token-free repository URL while preserving
persist-credentials: false.
- Around line 68-73: Update the conflict issue lookup that sets EXISTING to
generate the expected issue title once, request issue titles from gh issue list,
and use an exact title comparison rather than the broad in:title
${TARGET_BRANCH} search. Preserve counting only open issues whose title exactly
matches the generated conflict title.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: f61ad798-6114-4d53-8b9b-02c49d7ff1ba

📥 Commits

Reviewing files that changed from the base of the PR and between 6a93242 and f1f7177.

📒 Files selected for processing (1)
  • .github/workflows/sync-feature-branch.yaml

Comment thread .github/workflows/sync-feature-branch.yaml
Comment thread .github/workflows/sync-feature-branch.yaml Outdated
Comment thread .github/workflows/sync-feature-branch.yaml Outdated
@LalatenduMohanty
LalatenduMohanty force-pushed the auto-update-new-resolver-config branch from f1f7177 to 7780192 Compare August 11, 2026 05:18
Adds a GitHub Actions workflow that merges main into the
new-resolver-config feature branch on every push to main.
If merge conflicts arise, it opens a GitHub issue listing
the conflicting files with the sync-conflict label. When a
subsequent sync succeeds, any open sync-conflict issue for
that branch is automatically closed. The branch name is
configurable via workflow_dispatch for reuse with future
long-lived branches.

Closes: python-wheel-build#1295
Co-Authored-By: Claude <claude@anthropic.com>
Signed-off-by: Lalatendu Mohanty <lmohanty@redhat.com>

@rd4398 rd4398 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks good!

@mergify

mergify Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@mergify

mergify Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

queue

⚠️ Configuration not compatible with a branch protection setting

Details

The branch protection setting Require branches to be up to date before merging is not compatible with draft PR checks. To keep this branch protection enabled, update your Mergify configuration to enable in-place checks: set merge_queue.max_parallel_checks: 1, set every queue rule batch_size: 1, and avoid two-step CI (make merge_conditions identical to queue_conditions). Otherwise, disable this branch protection.

@LalatenduMohanty
LalatenduMohanty merged commit cf4dc21 into python-wheel-build:main Aug 11, 2026
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add CI check to detect mainnew-resolver-config merge conflicts

2 participants