Skip to content

fix(ci): resolve modify/delete conflicts in sync conflict PRs - #110

Merged
riderx merged 1 commit into
plusfrom
cursor/fix-sync-conflict-pr-6b17
Aug 20, 2026
Merged

fix(ci): resolve modify/delete conflicts in sync conflict PRs#110
riderx merged 1 commit into
plusfrom
cursor/fix-sync-conflict-pr-6b17

Conversation

@riderx

@riderx riderx commented Aug 20, 2026

Copy link
Copy Markdown
Member

What

  • Fix Create PR for conflicts in sync-branches.yml when upstream sync hits modify/delete conflicts (e.g. .github/workflows/ci.yml deleted on plus, modified upstream).
  • Refetch upstream objects before merge to reduce promisor lazy-fetch errors during merge.

Why

Run 32394290222 shows PR #109 fixed the promisor crash and correctly detected merge conflicts, but the job still failed at Create PR for conflicts:

  • git merge upstream/main -X theirs auto-resolved content conflicts
  • modify/delete on .github/workflows/ci.yml stayed unmerged
  • Step exited 1 → no conflict PR created

How

  • Added merge_upstream_preferred() in .github/scripts/sync-gh-helpers.sh: runs -X theirs, then for remaining unmerged paths runs git checkout --theirs + git add (covers modify/delete), then commits.
  • Both sync-main-branch and sync-plus-branch conflict PR steps use the helper.
  • Added git fetch --refetch --no-filter upstream main after initial upstream fetch.
  • Conflict PR branches now checkout from origin/plus / origin/main.

Testing

  • Reproduced failure signature from run 32394290222 logs.
  • Locally simulated partial clone + upstream merge; helper completes merge when only modify/delete conflict remains on ci.yml.

Not Tested

  • Full GitHub Actions re-run after merge (please re-run Sync Branches from Upstreamplus).

Notes

Open in Web Open in Cursor 

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Review in cubic

Summary by CodeRabbit

  • Bug Fixes
    • Improved automated branch synchronization by preferring upstream changes during merges.
    • Added handling for unresolved conflicts, including selecting or removing upstream files where appropriate.
    • Ensured failed conflict resolution restores the affected branch to a clean state.
  • Maintenance
    • Improved upstream refetching to ensure complete branch data is available during synchronization.

- Add merge_upstream_preferred helper for -X theirs plus modify/delete
- Refetch upstream objects before merge to reduce promisor lazy-fetch errors
- Checkout conflict PR branches from origin/{main,plus}

Co-authored-by: Martin DONADIEU <martindonadieu@gmail.com>
@github-actions

Copy link
Copy Markdown

Beta npm build

Maintainers can publish one Capacitor Plus workspace package from this PR to npm for fast testing.

Comment /publish-beta <package> after the PR checks are green.

Examples:

/publish-beta core
/publish-beta cli
/publish-beta @capacitor-plus/core

If exactly one workspace package changed, /publish-beta without a package will use that package.

Packages:

  • core (@capacitor-plus/core)
  • cli (@capacitor-plus/cli)
  • android (@capacitor-plus/android)
  • ios (@capacitor-plus/ios)

The workflow will:

  • publish a prerelease package on the beta tag
  • update this comment with the install command

Security note: beta publish is only enabled for branches inside this repository.

@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: b4540ef6-5eb6-4340-948f-c86739b2b364

📥 Commits

Reviewing files that changed from the base of the PR and between 1fa7eee and ab6f3a3.

📒 Files selected for processing (2)
  • .github/scripts/sync-gh-helpers.sh
  • .github/workflows/sync-branches.yml

📝 Walkthrough

Walkthrough

The change adds shared upstream-preferred merge handling and updates both branch-sync jobs to refetch upstream objects, use origin-based conflict branches, and apply consistent failure cleanup.

Changes

Upstream synchronization

Layer / File(s) Summary
Upstream-preferred merge helper
.github/scripts/sync-gh-helpers.sh
Adds merge_upstream_preferred to merge upstream changes, resolve remaining file conflicts, verify the index, and commit the merge.
Branch sync workflow integration
.github/workflows/sync-branches.yml
Both jobs refetch upstream objects. Conflict branches use origin references and shared merge handling. Failed resolution aborts or resets to the matching origin branch.

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

Sequence Diagram(s)

sequenceDiagram
  participant SyncWorkflow
  participant merge_upstream_preferred
  participant GitRepository
  SyncWorkflow->>merge_upstream_preferred: request upstream merge
  merge_upstream_preferred->>GitRepository: merge with theirs preference
  merge_upstream_preferred->>GitRepository: select or delete upstream files
  merge_upstream_preferred->>GitRepository: verify conflicts and commit merge
Loading
sequenceDiagram
  participant SyncWorkflow
  participant UpstreamRemote
  participant GitRepository
  SyncWorkflow->>UpstreamRemote: refetch upstream objects
  SyncWorkflow->>GitRepository: create conflict branch from origin/main or origin/plus
  SyncWorkflow->>GitRepository: invoke merge_upstream_preferred
  GitRepository-->>SyncWorkflow: merged or unresolved result
  SyncWorkflow->>GitRepository: abort merge or reset to origin reference on failure
Loading
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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

@riderx
riderx merged commit 5c29fb9 into plus Aug 20, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants