Skip to content

[v3-2-test] Breeze: fail fast when building provider sdists from a git worktree (#65771)#65828

Merged
potiuk merged 1 commit into
v3-2-testfrom
backport-ddf3c7a-v3-2-test
Apr 26, 2026
Merged

[v3-2-test] Breeze: fail fast when building provider sdists from a git worktree (#65771)#65828
potiuk merged 1 commit into
v3-2-testfrom
backport-ddf3c7a-v3-2-test

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

  • Breeze: fail fast when building provider sdists from a git worktree

flit's --use-vcs silently produces incomplete sdists when run from a
git worktree add ... directory, because flit.vcs.identify_vcs() checks
(p / ".git").is_dir() and in a worktree .git is a file (gitdir:
pointer). flit then falls back to a minimal sdist that omits docs/,
tests/, provider.yaml and other tracked files, and the resulting
packages fail reproducibility checks against released sdists on
dist.apache.org — with no warning.

breeze release-management prepare-provider-distributions now exits 1
with a clear explanation and a workaround (use a plain checkout, or
pass --distribution-format wheel — wheels are unaffected) when it
detects it is running from a worktree and would build sdists.

Wheels and providers using hatchling with explicit sdist includes are
not affected, so only sdist and both formats trigger the check.

  • Breeze: detect Docker-mounted worktrees in provider-sdist check

When Breeze runs prepare-provider-distributions from a git worktree, the worktree's .git file carries an absolute gitdir: pointer to the main repo's .git/worktrees/ directory. Only the worktree folder is bind-mounted into Breeze's Docker container, so that pointer target is unreachable from inside the build. flit's VCS detection then either fails or silently produces an incomplete sdist.

Expand check_flit_worktree_compatibility to parse .git and branch on the failure mode: read error, unexpected format, missing gitdir target (Docker mount case), or healthy host-side worktree. Tests cover all paths.

  • Link upstream flit issue/PR + tracking issue at the workaround site

Add references to pypa/flit#798 and pypa/flit#799 in the docstring of check_flit_worktree_compatibility, and the Airflow tracking issue #65772 at both the helper and its call site. CLAUDE.md requires the tracking-issue URL to appear at the workaround site in the code so the follow-up work is discoverable from any grep or code review.
(cherry picked from commit ddf3c7a)

Co-authored-by: Jarek Potiuk jarek@potiuk.com

…t worktree (#65771)

* Breeze: fail fast when building provider sdists from a git worktree

flit's --use-vcs silently produces incomplete sdists when run from a
`git worktree add ...` directory, because flit.vcs.identify_vcs() checks
`(p / ".git").is_dir()` and in a worktree `.git` is a file (gitdir:
pointer). flit then falls back to a minimal sdist that omits docs/,
tests/, provider.yaml and other tracked files, and the resulting
packages fail reproducibility checks against released sdists on
dist.apache.org — with no warning.

`breeze release-management prepare-provider-distributions` now exits 1
with a clear explanation and a workaround (use a plain checkout, or
pass `--distribution-format wheel` — wheels are unaffected) when it
detects it is running from a worktree and would build sdists.

Wheels and providers using hatchling with explicit sdist includes are
not affected, so only `sdist` and `both` formats trigger the check.

* Breeze: detect Docker-mounted worktrees in provider-sdist check

When Breeze runs prepare-provider-distributions from a git worktree, the worktree's .git file carries an absolute gitdir: pointer to the main repo's .git/worktrees/<name> directory. Only the worktree folder is bind-mounted into Breeze's Docker container, so that pointer target is unreachable from inside the build. flit's VCS detection then either fails or silently produces an incomplete sdist.

Expand check_flit_worktree_compatibility to parse .git and branch on the failure mode: read error, unexpected format, missing gitdir target (Docker mount case), or healthy host-side worktree. Tests cover all paths.

* Link upstream flit issue/PR + tracking issue at the workaround site

Add references to pypa/flit#798 and pypa/flit#799 in the docstring of check_flit_worktree_compatibility, and the Airflow tracking issue #65772 at both the helper and its call site. CLAUDE.md requires the tracking-issue URL to appear at the workaround site in the code so the follow-up work is discoverable from any grep or code review.
(cherry picked from commit ddf3c7a)

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
@potiuk potiuk force-pushed the backport-ddf3c7a-v3-2-test branch from 16b8c62 to 6770469 Compare April 26, 2026 16:58
@potiuk potiuk merged commit ba05ad6 into v3-2-test Apr 26, 2026
110 checks passed
@potiuk potiuk deleted the backport-ddf3c7a-v3-2-test branch April 26, 2026 19:45
vatsrahul1001 pushed a commit that referenced this pull request Apr 27, 2026
…t worktree (#65771) (#65828)

* Breeze: fail fast when building provider sdists from a git worktree

flit's --use-vcs silently produces incomplete sdists when run from a
`git worktree add ...` directory, because flit.vcs.identify_vcs() checks
`(p / ".git").is_dir()` and in a worktree `.git` is a file (gitdir:
pointer). flit then falls back to a minimal sdist that omits docs/,
tests/, provider.yaml and other tracked files, and the resulting
packages fail reproducibility checks against released sdists on
dist.apache.org — with no warning.

`breeze release-management prepare-provider-distributions` now exits 1
with a clear explanation and a workaround (use a plain checkout, or
pass `--distribution-format wheel` — wheels are unaffected) when it
detects it is running from a worktree and would build sdists.

Wheels and providers using hatchling with explicit sdist includes are
not affected, so only `sdist` and `both` formats trigger the check.

* Breeze: detect Docker-mounted worktrees in provider-sdist check

When Breeze runs prepare-provider-distributions from a git worktree, the worktree's .git file carries an absolute gitdir: pointer to the main repo's .git/worktrees/<name> directory. Only the worktree folder is bind-mounted into Breeze's Docker container, so that pointer target is unreachable from inside the build. flit's VCS detection then either fails or silently produces an incomplete sdist.

Expand check_flit_worktree_compatibility to parse .git and branch on the failure mode: read error, unexpected format, missing gitdir target (Docker mount case), or healthy host-side worktree. Tests cover all paths.

* Link upstream flit issue/PR + tracking issue at the workaround site

Add references to pypa/flit#798 and pypa/flit#799 in the docstring of check_flit_worktree_compatibility, and the Airflow tracking issue #65772 at both the helper and its call site. CLAUDE.md requires the tracking-issue URL to appear at the workaround site in the code so the follow-up work is discoverable from any grep or code review.
(cherry picked from commit ddf3c7a)

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
@vatsrahul1001 vatsrahul1001 added the changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) label May 18, 2026
@vatsrahul1001 vatsrahul1001 added this to the Airflow 3.2.2 milestone May 18, 2026
vatsrahul1001 pushed a commit that referenced this pull request May 20, 2026
…t worktree (#65771) (#65828)

* Breeze: fail fast when building provider sdists from a git worktree

flit's --use-vcs silently produces incomplete sdists when run from a
`git worktree add ...` directory, because flit.vcs.identify_vcs() checks
`(p / ".git").is_dir()` and in a worktree `.git` is a file (gitdir:
pointer). flit then falls back to a minimal sdist that omits docs/,
tests/, provider.yaml and other tracked files, and the resulting
packages fail reproducibility checks against released sdists on
dist.apache.org — with no warning.

`breeze release-management prepare-provider-distributions` now exits 1
with a clear explanation and a workaround (use a plain checkout, or
pass `--distribution-format wheel` — wheels are unaffected) when it
detects it is running from a worktree and would build sdists.

Wheels and providers using hatchling with explicit sdist includes are
not affected, so only `sdist` and `both` formats trigger the check.

* Breeze: detect Docker-mounted worktrees in provider-sdist check

When Breeze runs prepare-provider-distributions from a git worktree, the worktree's .git file carries an absolute gitdir: pointer to the main repo's .git/worktrees/<name> directory. Only the worktree folder is bind-mounted into Breeze's Docker container, so that pointer target is unreachable from inside the build. flit's VCS detection then either fails or silently produces an incomplete sdist.

Expand check_flit_worktree_compatibility to parse .git and branch on the failure mode: read error, unexpected format, missing gitdir target (Docker mount case), or healthy host-side worktree. Tests cover all paths.

* Link upstream flit issue/PR + tracking issue at the workaround site

Add references to pypa/flit#798 and pypa/flit#799 in the docstring of check_flit_worktree_compatibility, and the Airflow tracking issue #65772 at both the helper and its call site. CLAUDE.md requires the tracking-issue URL to appear at the workaround site in the code so the follow-up work is discoverable from any grep or code review.
(cherry picked from commit ddf3c7a)

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:dev-tools changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants