fix: improve upstream sync workflow reliability and prevent squash merges - #43
Merged
Conversation
…rges ## Changes ### carto-upstream-sync.yml - Add automatic resolver dispatch after PR creation - Check mergeable status with retries (handles GitHub's async computation) - Trigger resolver workflow when conflicts are detected ### carto-upstream-sync-resolver.yml - Add prominent merge warning at top of resolution PR body - Add warning comment step after resolution PR creation - Warn against squash/rebase merge which destroys upstream history ## Why 1. **Resolver not triggering**: GitHub doesn't fire `pull_request` events when PRs are created by workflows, even with PAT tokens. This adds explicit workflow dispatch as a reliable trigger. 2. **Squash merge prevention**: PR #26 was squash-merged, which lost all upstream commit history (4201 commits). This caused PR #41 to show inflated diff counts. Adding clear warnings to prevent this. Shortcut - Autolink: [sc-521238]
Collaborator
Author
|
/gemini review |
…history The previous approach (checkout carto/main, merge main INTO it) lost upstream commit history because the PR only showed Claude's resolution commits, not the upstream commits. New approach: 1. Checkout main (has all upstream commits) 2. Merge carto/main INTO it (brings CARTO customizations) 3. Resolve conflicts 4. Create PR to carto/main This ensures the resolution PR shows ALL upstream commits + resolution commits, preserving full commit history in carto/main. Also updated Claude's prompt to reflect: - Reversed conflict marker interpretation (HEAD=upstream, theirs=CARTO) - Updated ours/theirs terminology in file-specific rules - Clear explanation of why this approach preserves history
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.
Description
Shortcut
Fixes two issues with the upstream sync workflow:
Resolver workflow not triggering: The
pull_request: openedevent doesn't fire when PRs are created by workflows (even with PAT tokens). Added explicitgh workflow rundispatch after PR creation.Squash merge prevention: PR fix: resolve conflicts for upstream sync PR #24 #26 was squash-merged, which destroyed all upstream commit history (4201 commits). This caused PR 🔄 sync: upstream v1.79.3-stable #41 to show inflated diff counts (1875 files instead of ~300). Added prominent warnings to prevent this in the future.
Changes
carto-upstream-sync.ymlCheck conflicts and trigger resolverstep after PR creationcarto-upstream-sync-resolver.ymlType of change
Acceptance
Basic checklist