Skip to content

fix(git): fetch working copy from bare mirror before checkout to support promoting to a new tracking_ref SHA [fj4WqyCCw3C5ShR1RfB7MoBPTpkRrBFYP1uT35g3MvT] - #71389

Closed
waterWang wants to merge 1 commit into
apache:mainfrom
waterWang:fix/gitdagbundle-fetch-before-checkout
Closed

fix(git): fetch working copy from bare mirror before checkout to support promoting to a new tracking_ref SHA [fj4WqyCCw3C5ShR1RfB7MoBPTpkRrBFYP1uT35g3MvT]#71389
waterWang wants to merge 1 commit into
apache:mainfrom
waterWang:fix/gitdagbundle-fetch-before-checkout

Conversation

@waterWang

Copy link
Copy Markdown

Closes #71388

Problem

GitDagBundle supports pinning tracking_ref to 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() raises GitCommandError: 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

  • Confirmed the failing code path: checkout runs before the working copy is refreshed in the no-version path.
  • The fix adds self.repo.remotes.origin.fetch() immediately before the checkout, matching the pattern already used in the versioned path and refresh().

@kaxil

kaxil commented Aug 11, 2026

Copy link
Copy Markdown
Member

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.

@kaxil kaxil closed this Aug 11, 2026
@kaxil kaxil added the AI Spam label Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GitDagBundle: promoting a SHA-pinned tracking_ref can fail with 'reference is not a tree' if local storage isn't cleared

2 participants