Skip to content

Fork CI reconciler: match recorded runs to a pull request, not only to its fork branch #74906

Closed

Description

@potiuk

The gate tampering check (AIP-120, #74822) attributes apache/airflow runs to a gated pull request by head repository and branch, looking back 6 hours. Two cases are misattributed:

  • A pull request that legitimately ran project CI against a base branch without the gate, then was retargeted to a gated branch within 6 hours, can be closed for tampering on the next reconciler run.
  • Two open pull requests from the same fork branch (for example one to main, one to a release branch) share each other's runs.

Proposed: attribute runs through their recorded pull_requests entry (number and base) where GitHub provides it, and ignore runs recorded before the pull request's last BaseRefChangedEvent. Keep detection across earlier commits of the same pull request. Add tests with simultaneous pull requests from one branch, and with a retarget.

Code: BypassFinder.find in dev/breeze/src/airflow_breeze/utils/fork_ci_reconcile.py.


Drafted-by: Claude Code (Opus 5); reviewed by @potiuk before posting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions