Repository navigation
Avoid unnecessary localization branch rebases - #64910
Open
Jake Bailey (jakebailey) wants to merge 2 commits into
Open
Jake Bailey (jakebailey) wants to merge 2 commits into
Jake Bailey (jakebailey) wants to merge 2 commits into
Conversation
Daily localization updates were rewriting the bot branch whenever main advanced, even when the localization files had not changed. This adds unrelated commits to force-pushes and creates unnecessary review churn.
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
History reconstruction and force-push behavior need automated scenario coverage and human validation.
1 open issue
What changed in this PR
Reduces localization review churn by preserving the existing PR base when safe instead of rebasing whenever main advances.
Changes:
- Adds merge-tree checks to preserve history, with fallback to the generated commit.
- Updates the pipeline to fetch full history and push the selected commit with an explicit lease.
| File | Description |
|---|---|
| tools/scripts/preserve-localization-base.mjs | Selects a history-preserving localization commit when safe. |
| tools/pipelines/localization-update.yml | Integrates commit selection and explicit push protection. |
Review effort: Balanced
Comment on lines
+13
to
+17
| function prepareUpdate() { | ||
| const generated = git("rev-parse", "HEAD"); | ||
| const main = git("rev-parse", `${generated}^`); | ||
| const previousHead = git("rev-parse", "--verify", `${previous}^{commit}`); | ||
| const base = git("merge-base", main, previousHead); |
This branch has not been deployed
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.

Daily localization updates were rewriting the bot branch whenever main advanced, even when the localization files had not changed. This adds unrelated commits to force-pushes and creates unnecessary review churn.
Fix that by being a bit more clever.