shahar1 opened a new pull request, #76656: URL: https://github.com/apache/airflow/pull/76656
### Why The `Generate constraints` job runs on every PR that builds the CI image. Many of these PRs do not use its output. The data comes from `Tests (AMD)` PR runs from 2026-10-16 to 2026-11-05. There were 5177 runs. I sampled 15 runs per day, 308 runs in total. | Measurement | Value | |---|---| | Runs that execute the job | 60% | | Jobs per day | About 149 | | Runner time per day | About 24 hours | | Part of all job-minutes | 2.0% | | Jobs on `ubuntu-22.04` | 91% | | Runs that execute the job but do not build the PROD image | 46% | | `pypi.org` JSON requests per job | 108 | | `pypi.org` JSON requests per day | About 16,000 | | Packages resolved per job | 725 | In the 46% of runs without a PROD image, no job reads the output. The job also causes failures that are not related to the PR. I read the logs of all 51 jobs that failed in this period: | Cause | Jobs | |---|---| | Network errors (`pypi.org` 36, `nodejs.org` 3, `api.github.com` 1) | 40 | | Provider downgrade check on backports, caused by release candidate pins | 7 | | PyPI did not serve a pinned version (`common-compat==1.22.0`) | 1 | | Errors caused by the PR | 3 | 38 of the 51 failures are on PRs that do not change dependency files. Two of the 3 PR errors are on PRs that change dependency files (#74696, #76317). These PRs still run the job after this change. The third PR (#76548) also failed `React UI tests` and `Static checks`. ### How This PR adds two selective-check outputs: | Output | Value is true when | |---|---| | `generate-pypi-constraints` | The CI image is built and one of these conditions is true: a `pyproject.toml` file changed, `uv.lock` changed, full tests are necessary, the run is a canary, or the PR has the `upgrade to newer dependencies` label | | `generate-constraints` | `generate-pypi-constraints` is true, or the PROD image is built | Full tests are necessary when the job's workflow or script changes. Thus, a change to these files still runs the PyPI step. `ci-amd.yml` and `ci-arm.yml` use these outputs to control the job. The PROD image build reads only the `constraints-source-providers` file. When `generate-pypi-constraints` is false and the PROD image is built, the job makes only that file. It does not build the provider, Airflow and Task SDK wheels, and it does not run the PyPI step. The other workflows that call `generate-constraints.yml` set their own inputs. This PR does not change them. ### Expected result The job does not run on PRs that do not build the PROD image and do not change dependencies. These runs used 43% of the job's minutes in the sample. The steps removed from the other runs used 29%. The maximum saving is 72% of the job's minutes, about 17 runner hours per day. The real saving is smaller because PRs that change dependencies still run the job. I did not measure the number of these PRs. ### Risk A PR can break the PyPI resolution or the wheel builds without a change to dependency files. This job does not find that error on the PR after this change. The canary runs find it instead. AMD and ARM canaries each run two times per day. This type of failure did not occur in the 21 days of data. ### Verification | Check | Result | |---|---| | `test_selective_checks.py` and `test_verification_plan.py` | 443 passed, including the new `test_generate_constraints` cases | | `prek`, pre-commit stage | Passed, except `lychee-docker` | | `prek`, manual stage | Passed | | All tests in `dev/breeze/tests` | 2491 passed, 1 failed, 16 errors | `lychee-docker` did not start because the local Docker proxy refused the bind mount. The documentation changes do not add links. The 16 errors are `botocore.exceptions.MissingDependencyException` in `test_release_management_commands.py`. They come from the local AWS credential setup. The failed test is `test_reproducible_build_matches_svn`. This PR does not change the code of these tests. I did not run them on the base commit. The workflow changes have not run in CI. The CI run of this PR must confirm them. --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes — Claude Code (Opus 5.5) Generated-by: Claude Code (Opus 5.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_01BVx6g6v9hW7wi1tV4bqvrp -- 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]
