CAOShurong opened a new pull request, #71535: URL: https://github.com/apache/airflow/pull/71535
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 tree` unless local bundle storage is cleared. Fetch the working clone from its local bare origin only when the configured `tracking_ref` cannot 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 on `main`, passes with this change) - `pytest providers/git/tests/unit/git/bundles/test_git.py -q -s --disable-warnings` (`105 passed`) - focused test after installing the built provider wheel (`1 passed`) - `ruff check` and `ruff format --check` for both changed files - `mypy providers/git/src/airflow/providers/git/bundles/git.py` - `uv build --project providers/git --wheel` - `prek run --from-ref b2ee721a2cd30181b2759c00f359d115e2859a8c --stage pre-commit` - `prek run mypy-providers --from-ref b2ee721a2cd30181b2759c00f359d115e2859a8c --stage manual` --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes (OpenAI Codex) Generated-by: OpenAI Codex following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions) --- Drafted-by: OpenAI Codex (no human review before posting) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
