potiuk opened a new pull request, #67663:
URL: https://github.com/apache/airflow/pull/67663
## Summary
Restrict the reproducible-build `dirty` check in
`airflow-core/hatch_build.py` to paths inside the docker build context
(per `.dockerignore`). Without this, official airflow-core releases
ship with a misleading `git_version = .dev0+<SHA>.dirty` even when
built from a clean tag, because the deny-by-default `.dockerignore`
excludes ~220 tracked top-level files from `COPY . /opt/airflow`,
so `git is_dirty()` inside the container reports them as deletions.
Verified against 3.2.2rc3:
- before fix: `apache_airflow_core` wheel's `airflow/git_version` =
`.dev0+cde4885818be51a6cdcfdf9275e100bf070025de.dirty`
- after fix: `.release:<SHA>`
## Test plan
- [x] Built `apache-airflow-core` wheel via docker on `main` with the fix —
`git_version` is now `.release:<SHA>` (no `.dirty` suffix)
- [x] Dirty detection still fires for genuine in-context changes:
modifying `airflow-core/README.md` → restricted check returns `True`
- [x] Dockerignored-only changes no longer trip dirty:
modifying `.asf.yaml` → restricted check returns `False`
- [x] `prek run mypy-airflow-core` passes
- [x] `ruff format` / `ruff check` clean
- [x] Falls back to `repo.is_dirty()` when `.dockerignore` is missing
or has no `!` entries (preserves prior behavior in unusual contexts)
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes — Claude Code (Opus 4.7)
Generated-by: Claude Code (Opus 4.7) following [the
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
--
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]