-
Type:
Task
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: Bazel
-
None
-
Build OnDeck
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Long-running parallel Copybara syncs can fail when a GitHub App token expires during the S3 lock destination lookup or the push that fast-forwards a branch to an already-synced commit. This bypasses the existing dry-run/migrate authentication retry handlers, as seen in the v9.0.4 release sync.
Update `acquire_s3_commit_lock_or_skip` in `buildscripts/copybara/sync_repo_with_copybara.py` to refresh tokens during prolonged waits and retry Git authentication failures up to the existing limit. Recreate the temporary destination clone after refresh so `origin` and partial-clone operations use fresh credentials. Pass refreshed tokens and their refresh time between the lock waiter and the commit loop, including when a commit is skipped or the waiter subsequently acquires the lock. Other failures still propagate normally.
Validation: 253 Copybara unit tests passed (one skipped), including regression coverage for clone/fetch/push authentication failures, retry exhaustion, prolonged waits, and token reuse. `bazel --output_base=/tmp/mongo-copybara-format run format` passed; a temporary output directory was used because the default Bazel cache filesystem lacked space for runfiles.