potiuk opened a new pull request, #77128: URL: https://github.com/apache/airflow/pull/77128
Nothing removes the CI and PROD image packages of a release branch or Python version once CI stops building them. ghcr.io still holds every `airflow/<branch>/(ci|prod)/python<X.Y>` package since `v2-2-test`, and Python 3.6 to 3.10 on `main`: 134 of the 151 image packages, with about 425k of the 532k image versions. Committers cannot delete them: the packages are linked to this repository, and deleting a package or a version needs admin rights on it, so a committer's token gets `404 Package not found` even with `delete:packages`. This adds **Delete retired image packages**, a manually dispatched workflow that deletes them with the workflow token, a whole package per call. - It deletes every image package whose branch is not in `keep-branches` or whose Python version is not in `keep-python`. - `only` narrows a run to the packages matching glob patterns (e.g. `airflow/v2-*`), so one package can be deleted first. `parallel` sets how many are deleted at once. - `dry-run` defaults to true. - The new `update-retired-image-packages-defaults` prek hook keeps the defaults in sync: `keep-branches` lists `main` and every branch with a `scheduled-upgrade-check-<branch>.yml` workflow, and `keep-python` lists `ALLOWED_PYTHON_MAJOR_MINOR_VERSIONS`. A run with the defaults never deletes images that CI still uses. - Documented in `dev/breeze/doc/ci/02_images.md`. After the merge: a dry run, then `only` with one small package, then the rest. The first real run is also what shows whether the workflow token is allowed to delete the packages; if it is not, this goes to ASF Infra with the list. Tested: - Unit tests for the deletion script and the hook (22 passed). - The hook rewrites drifted defaults and passes on the committed workflow. - The package list was checked against ghcr.io with a read-only listing; deleting with a committer token fails with 404, as described above. --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes — Claude Code (Claude Opus 5) Generated-by: Claude Code (Claude Opus 5) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions) 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01NyQq9STgK3cUrmMZrbJtqJ -- 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]
