potiuk opened a new pull request, #77134:
URL: https://github.com/apache/airflow/pull/77134
During the fork CI pilot, Iliya Romm pointed out that #74696 was waiting for
a maintainer to approve its CI even though maintainers had already approved its
code three times. He suggested that maintainer approvals should count as
workflow approvals. (#76282 has since removed the reason that particular pull
request waited: `dev/breeze/tests/` no longer counts as CI-defining.)
With this change, `breeze ci approve-workflow-runs` approves a commit's
waiting runs, whatever the other rules say, when a maintainer has approved that
exact commit. In detail:
- **Which review counts:** each reviewer's latest verdict on the pull
request. A later `CHANGES_REQUESTED` or a dismissal withdraws an approval; a
comment does not.
- **Which commit:** the review's `commit_id` must be the pull request's head
commit. An approval of an earlier commit does not cover a later push.
- **Who counts as a maintainer:** someone with `write` or `admin`
permission, read from `GET
/repos/apache/airflow/collaborators/<login>/permission`. Collaborators granted
triage in `.asf.yaml` report `read` and do not count. The review's author
association can't be used for this, because it says `COLLABORATOR` for triagers
too.
- **What still waits for a maintainer:**
- a commit that is the head of several open pull requests;
- runs that started before the pull request was opened or last retargeted.
Labels no longer matter for these runs, because the approval doesn't
depend on how many tests they select.
This is the same kind of rule as the one for trusted stakeholders'
repositories, and it is checked after it. The reasoning: a maintainer who
approved the exact head commit has reviewed every change in it, CI changes
included, which is what approving its runs by hand asks of them.
`dev/breeze/doc/ci/05_workflows.md` ("Approval of pull request runs") and
the contributor section of `contributing-docs/05_pull_requests.rst` describe
the rule.
Tested: `dev/breeze/tests/test_workflow_run_approval.py` passes (179 tests,
16 of them new). The new tests cover the approval checks, the end-to-end
approval of a waiting run, a head commit shared by two pull requests, and the
two new API calls. Static checks pass.
---
##### 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_01NyQq9U7i5HhjDgrQ9qd3gq
--
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]