fix(git): fetch working copy from bare mirror before checkout to support promoting to a new tracking_ref SHA [fj4WqyCCw3C5ShR1RfB7MoBPTpkRrBFYP1uT35g3MvT] - #71389
Conversation
|
Closing this as part of a cleanup of a large batch of PRs opened in quick succession from this account. 18 PRs have been opened here in the past two weeks and none have merged. Several show signs of being generated and submitted without review: #71432 and #71433 are the same change across the same five files, opened two minutes apart, and several titles carry a leaked agent identifier that other contributors already flagged as garbled text on #70629 and #71322. Airflow is maintained by volunteers. Every PR costs reviewer time and CI capacity, so a high volume of unvetted submissions has a real cost to the project. You are welcome to keep contributing. Please open one change at a time, run it locally against the tests, and read the contributors' guide before submitting. If you think a specific change here is correct, comment with the reasoning and a maintainer can reopen it. |
Closes #71388
Problem
GitDagBundlesupports pinningtracking_refto a full commit SHA (see #69735). Rolling back to an older SHA works reliably, but promoting to a new SHA that was pushed after the bundle's local storage was first populated fails.The working clone lives at a stable path (
self.repo_path), and_clone_repo_if_required()only clones if that path doesn't already exist. On a restart with surviving storage, the stale working clone is reopened, not re-fetched. Only the bare mirror is fetched (_clone_bare_repo_if_required). As a result,self.repo.git.checkout(self.tracking_ref)in_initialize()raisesGitCommandError: fatal: reference is not a tree: <sha>when the new SHA isn't yet an object in the stale working clone.Fix
Fetch the working copy from the bare mirror before the checkout call in
_initialize(). The bare mirror is already up-to-date (fetched earlier in the same method), so this pulls the new SHA into the working clone so the checkout succeeds.Verification
self.repo.remotes.origin.fetch()immediately before the checkout, matching the pattern already used in the versioned path andrefresh().