Skip to content

Feat incremental#4

Merged
renan-alm merged 8 commits into
masterfrom
feat-incremental
Nov 11, 2025
Merged

Feat incremental#4
renan-alm merged 8 commits into
masterfrom
feat-incremental

Conversation

@renan-alm
Copy link
Copy Markdown
Owner

@renan-alm renan-alm commented Nov 11, 2025

This pull request introduces significant improvements and refactoring to the Gerrit synchronization logic and branch utilities. The changes enhance branch and tag syncing reliability, improve error handling, and reduce code duplication by centralizing shared logic. The most important changes are grouped below by theme.

Branch Utilities and Constants

  • Added a new branch-utils.js module to centralize shared branch operations such as listing source/destination branches and selecting fallback branches, reducing duplication across the codebase.
  • Created a new constants.js module to store configuration values, magic strings, error/info/debug messages, and patterns for Gerrit detection, improving maintainability and clarity.

Gerrit Branch Sync Logic

  • Refactored Gerrit branch sync to check for destination branch modifications and whether the source is ahead before pushing, preventing accidental overwrites and ensuring safe pushes. Force-push is now only used when necessary (e.g., new branches or no common history). [1] [2] [3] [4]
  • Improved multi-branch sync by mapping source branches to destination branches and handling branch renames or new branches gracefully. The sync now fails fast if any branch cannot be synced, ensuring consistency.

Tag Sync Reliability

  • Updated tag syncing to attempt a standard push first and only retry with force if a conflict occurs, minimizing unnecessary force pushes and improving safety. Per-tag sync also retries with force only on failure. [1] [2]

@renan-alm renan-alm merged commit 8abe1cd into master Nov 11, 2025
2 checks passed
@renan-alm renan-alm deleted the feat-incremental branch November 11, 2025 13:02
renan-alm added a commit that referenced this pull request Nov 26, 2025
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.

1 participant