Repository navigation
Fetch missing Git bundle tracking refs - #71535
CAOShurong wants to merge 1 commit into
Conversation
Promoting a SHA-pinned Dag bundle can reuse a working clone whose object database predates the new commit. Reusing that storage should not require operators to clear it manually.
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide
|
|
Following up from #72759, which describes a different way to reach the same failing Your change looks like it recovers that state too, for a reason it was not written for:
If you agree, would you like a regression test for that path added to this PR? It initializes a versioned bundle with a named branch such as I have it written against the current |
|
Thanks for the detailed follow-up — I agree the same recovery path covers the scenario in #72759, for the reasons you laid out (no resolvable refs -> fetch runs, and the leftover clone still has origin pointing at the local bare mirror). A regression test for that path would be a valuable addition. Please post it here as a patch and I will apply it to this branch and update the PR description to reference #72759 alongside #71388. |
Promoting a SHA-pinned Git Dag bundle can reuse a working clone whose object database predates the new commit, even though the bundle's local bare mirror has already fetched it. The subsequent checkout then fails with
reference is not a treeunless local bundle storage is cleared.Fetch the working clone from its local bare origin only when the configured
tracking_refcannot already be resolved, then continue with the existing checkout flow. This keeps the normal branch and tag paths unchanged and avoids an unconditional extra fetch.The regression test now promotes a second commit into the same local bundle storage and verifies both the resolved version and the newly added file.
closes: #71388
Testing:
pytest providers/git/tests/unit/git/bundles/test_git.py::TestGitDagBundle::test_tracking_ref_commit_sha_promote_without_clearing_storage -xvs(fails onmain, passes with this change)pytest providers/git/tests/unit/git/bundles/test_git.py -q -s --disable-warnings(105 passed)1 passed)ruff checkandruff format --checkfor both changed filesmypy providers/git/src/airflow/providers/git/bundles/git.pyuv build --project providers/git --wheelprek run --from-ref b2ee721a2cd30181b2759c00f359d115e2859a8c --stage pre-commitprek run mypy-providers --from-ref b2ee721a2cd30181b2759c00f359d115e2859a8c --stage manualWas generative AI tooling used to co-author this PR?
Generated-by: OpenAI Codex following the guidelines
Drafted-by: OpenAI Codex (no human review before posting)