You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "CAOShurong (via GitHub)" <gi...@apache.org> on 2026/08/13 08:10:53 UTC
[PR] Fetch missing Git bundle tracking refs [airflow]
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fetch missing Git bundle tracking refs [airflow]
Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on PR #71535:
URL: https://github.com/apache/airflow/pull/71535#issuecomment-5277760299
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](https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
Here are some useful points:
- Pay attention to the quality of your code (ruff, mypy and type annotations). Our [prek-hooks]( https://github.com/apache/airflow/blob/main/contributing-docs/08_static_code_checks.rst#prerequisites-for-prek-hooks) will help you with that.
- In case of a new feature add useful documentation (in docstrings or in `docs/` directory). Adding a new operator? Check this short [guide](https://github.com/apache/airflow/blob/main/airflow-core/docs/howto/custom-operator.rst) Consider adding an example Dag that shows how users should use it.
- Consider using [Breeze environment](https://github.com/apache/airflow/blob/main/dev/breeze/doc/README.rst) for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
- Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
- Please follow [ASF Code of Conduct](https://www.apache.org/foundation/policies/conduct) for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
- Be sure to read the [Airflow Coding style]( https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#coding-style-and-best-practices).
- Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
Apache Airflow is a community-driven project and together we are making it better 🚀.
In case of doubts contact the developers at:
Mailing List: dev@airflow.apache.org
Slack: https://s.apache.org/airflow-slack
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fetch missing Git bundle tracking refs [airflow]
Posted by "8silvergun (via GitHub)" <gi...@apache.org>.
8silvergun commented on PR #71535:
URL: https://github.com/apache/airflow/pull/71535#issuecomment-5594405254
Following up from #72759, which describes a different way to reach the same failing `checkout`: if a process is killed while a bundle version is being cloned, `versions/<sha>/` is left with a `.git` that has no references and an empty working tree, and it is reused on every later initialization.
Your change looks like it recovers that state too, for a reason it was not written for:
- `_has_version(repo, tracking_ref)` cannot resolve `tracking_ref` in a repository with no refs, so it returns `False` and the fetch runs.
- `git clone` writes the remote before it transfers objects, so a leftover can still have `remote.origin.url` configured, pointing at the bundle's healthy local bare mirror. The fetch is local and repopulates `refs/remotes/origin/*`, after which the checkout resolves.
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 `main` as `tracking_ref`, removes all loose and packed refs from `versions/<sha>/.git`, leaves HEAD pointing at a nonexistent branch, empties the working tree, verifies that `origin` remains configured, then initializes the same version again and asserts that both the expected version and the Dag files are restored. It fails on `main` and should pass with this change.
I have it written against the current `TestGitDagBundle` fixtures and can push it to your branch or post it here as a patch, whichever you prefer. Happy to leave it out if you would rather keep this PR scoped to #71388.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fetch missing Git bundle tracking refs [airflow]
Posted by "CAOShurong (via GitHub)" <gi...@apache.org>.
CAOShurong commented on PR #71535:
URL: https://github.com/apache/airflow/pull/71535#issuecomment-6425885921
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.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org