Skip to content

Translation sync PRs conflict when multiple upstream PRs modify the same file — 62% failure rate in practice #63

Description

@mmcky

Problem

When two upstream PRs modify the same file and are merged before their corresponding translation sync PRs are reviewed/merged in the target repo, the second translation PR will have merge conflicts with the first.

How it happens

  1. Upstream PR A modifies file.md → merged
  2. Upstream PR B also modifies file.md → merged
  3. Translation sync creates PR X (from A) against target main
  4. Translation sync creates PR Y (from B) also against target main

Both PR X and PR Y are generated against the same target main — without accounting for each other. When PR X is merged first, PR Y conflicts because it was translated from the same base.

Case study

This occurred in QuantEcon/lecture-python-programming.fa:

  • PR #93 synced upstream #521 (modifying numba.md)
  • PR #95 synced upstream #524 (also modifying numba.md)

Both were created against the same target main. After PR #93 was merged, PR #95 had merge conflicts (mergeStateStatus: DIRTY). We had to manually close PR #95 and create a replacement PR #101 with the changes cleanly applied on top of the updated main.

Root cause

action-translation generates each sync PR's translation against the current target main, not against a branch that includes pending unmerged translation PRs. When upstream merges PRs faster than the translation repo reviews/merges them, conflicts are inevitable for files touched by multiple upstream PRs.

Impact

  • Manual intervention required to resolve conflicts or recreate PRs
  • Translation work in the conflicted PR may be partially wasted (re-translated from wrong base)
  • Risk of lost or duplicated translation changes

Possible approaches (for discussion)

  • Detect pending PRs: Before creating a new sync PR, check if there are open translation PRs touching the same file and either queue or rebase
  • Sequential processing: Only create a new sync PR for a file if no open sync PR exists for that file
  • Auto-rebase: Automatically rebase open translation PRs when earlier ones are merged
  • Batch mode: Combine multiple upstream changes to the same file into a single translation PR
  • Document the limitation: At minimum, document the recommended merge cadence for maintainers

No immediate fix is needed — this is a design consideration for future improvement.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions