Repository navigation
Description
Background
PR #65771 adds check_flit_worktree_compatibility to dev/breeze/src/airflow_breeze/prepare_providers/provider_distributions.py. The check refuses to build provider sdists when the source tree is a git worktree, because two related things go wrong otherwise and no warning is emitted:
- flit worktree detection bug.
flit.vcs.identify_vcsonly checks.git.is_dir(), missing the.git-as-file pointer that git uses for worktrees and submodules. flit silently falls back to a non-VCS sdist that omits tracked files (docs/,tests/,provider.yaml, anything declared in[tool.flit.sdist] include), and the resulting packages fail reproducibility checks against the released sdists on dist.apache.org. - Breeze Docker-mount case. Even once flit is fixed, when Breeze runs the build inside Docker only the worktree directory is bind-mounted — the absolute
gitdir:path baked into the worktree's.gitfile references the main repo's.git/worktrees/<name>directory on the host, which is not reachable from the container.git ls-filesthen fails or misbehaves.
Upstream flit tracking:
- Issue: flit sdist silently drops tracked files when built from a git worktree pypa/flit#798
- PR: Detect git worktrees and submodules in identify_vcs pypa/flit#799
What to do when this issue is actioned
Once both of the following hold:
- The flit fix (Detect git worktrees and submodules in identify_vcs pypa/flit#799) is merged and released.
- Airflow's constraints pin to a flit release that contains the fix, and the Breeze Docker image is rebuilt to include that version.
…and the Docker-mount case has been addressed (either by mounting the main repo's .git/worktrees/<name> directory alongside the worktree, or by rewriting the gitdir: pointer when sources are staged into the container, or by deciding the Docker-mount path is not supported from worktrees), remove:
check_flit_worktree_compatibilityindev/breeze/src/airflow_breeze/prepare_providers/provider_distributions.py- Its call site in
dev/breeze/src/airflow_breeze/commands/release_management_commands.py - Its tests in
dev/breeze/tests/test_provider_distributions.py
If only the flit fix lands but the Docker-mount case is still broken, the check must stay (or be narrowed to the Docker case only) — the silent-incomplete-sdist failure is severe enough that we should not let a release train run into it unguarded.
Acceptance criteria
- Provider sdists built from a
git worktree add ...directory viabreeze release-management prepare-provider-distributions --distribution-format sdistmatch byte-for-byte with sdists built from a plaingit checkoutof the same commit. - The same command run inside Breeze's Docker container from a worktree either succeeds with matching sdists or produces a clear, explicit error (not a silent incomplete tarball).
-
check_flit_worktree_compatibilityremoved and PR Breeze: fail fast when building provider sdists from a git worktree #65771's test coverage deleted along with it.
Related
- PR Breeze: fail fast when building provider sdists from a git worktree #65771 — where the workaround lives.
Activity
Link upstream flit issue/PR + tracking issue at the workaround site
Breeze: fail fast when building provider sdists from a git worktree (#…
[v3-2-test] Breeze: fail fast when building provider sdists from a gi…
[v3-2-test] Breeze: fail fast when building provider sdists from a gi…
[v3-2-test] Breeze: fail fast when building provider sdists from a gi…
[v3-2-test] Breeze: fail fast when building provider sdists from a gi…
[v3-2-test] Breeze: fail fast when building provider sdists from a gi…
Breeze: fail fast when building provider sdists from a git worktree (…