git: add contract tests for force-push resilience, error recovery, and edge cases#65750
Merged
potiuk merged 1 commit intoapache:mainfrom Apr 25, 2026
Merged
git: add contract tests for force-push resilience, error recovery, and edge cases#65750potiuk merged 1 commit intoapache:mainfrom
potiuk merged 1 commit intoapache:mainfrom
Conversation
Expand GitDagBundle test coverage with 12 new tests addressing gaps identified during investigation of repeated recloning after tag force-push. Force-push resilience: - Branch force-pushed to unrelated commit follows the new ref - Tag force-pushed to unrelated commit follows the new ref - Tag moved forward then backward across multiple refreshes - Refresh after force-push never triggers Repo.clone_from - Repeated refreshes after force-push remain stable - Re-initialization reuses existing repos (no reclone) Error handling: - Upstream tag deletion does not break refresh (local copy persists) - Failed bare-repo fetch preserves previous working tree - Refresh on versioned bundle raises AirflowException - Corrupted working repo triggers cleanup and retry Edge cases: - Real submodule fixture with ref change and submodule sync - Ambiguous ref (branch+tag same name) documents branch preference
potiuk
approved these changes
Apr 25, 2026
Contributor
Backport successfully created: v3-2-testNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add 12 unit tests to the Git DAG bundle provider, expanding test coverage for force-push resilience, error recovery, and edge cases. The new tests cover previously untested defensive paths.
Context
These tests were motivated by an investigation into repeated recloning behavior observed after force-pushing a tracked tag.
Force-push resilience (6 tests)
test_refresh_tag_force_pushed_to_unrelated_committest_refresh_branch_force_pushed_to_unrelated_committest_refresh_tag_moved_forward_and_backwardtest_refresh_after_force_push_does_not_recloneRepo.clone_fromis never called during refreshtest_repeated_refreshes_after_force_push_stabletest_reinitialize_reuses_repos_after_force_pushError handling (4 tests)
test_refresh_survives_upstream_tag_deletiontest_refresh_failure_preserves_previous_checkouttest_refresh_versioned_bundle_raisesrefresh()on versioned bundle raisesAirflowExceptiontest_clone_repo_invalid_repository_error_retryEdge cases (2 tests)
test_refresh_with_real_submodules_after_ref_changetest_refresh_ambiguous_ref_prefers_branch_over_tagNotable finding
git reset --hardfails when the target tree references a different submodule commit than the current checkout, because the existingmysub/.gitfile triggers git's invalid-path protection (verified on git 2.43). This meansrefresh()withsubmodules=Truecannot handle upstream submodule reference changes. A fix would require deiniting submodules before the reset. This is a pre-existing limitation, not introduced by this PR.Was generative AI tooling used to co-author this PR?
Generated-by: Claude Opus 4.6 and GPT 5.4-Mini following the guidelines
-->
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.