Skip to content

Report fork CI to pull requests sooner and with failing jobs - #76836

Merged
potiuk merged 4 commits into
fork-ci-startup-failure-and-statusfrom
fork-ci-status-latency-and-detail
Nov 14, 2026
Merged

potiuk merged 4 commits into
fork-ci-startup-failure-and-statusfrom
fork-ci-status-latency-and-detail

Conversation

@potiuk

@potiuk potiuk commented Nov 10, 2026

Copy link
Copy Markdown
Member

Why

Fork CI reaches a pull request only when the scheduled monitor runs: the fork run is in another
repository, so nothing in apache/airflow is triggered when it starts or ends. At a 15-minute
cadence plus GitHub's scheduling delay, a fork run's start, failure or success showed up 10-20
minutes late on #76536, and so did CI run started, which every pull request waits for before
merging. When a run failed, the state comment only said "failed", so authors had to open the
fork run to see which jobs broke.

What

  • The fork CI monitor runs every 5 minutes. The per-run write budgets and the
    runs-before-Slack-note thresholds are derived from MONITOR_INTERVAL, so their hourly totals
    are unchanged; a test keeps it in sync with the workflow cron. Runs never overlap (the
    workflow's concurrency group queues one and skips further ticks).
  • The state comment of a failed fork run lists the jobs that failed, timed out or were cancelled
    (up to 10), each linking the job in the fork. It reuses the jobs the job statuses already read,
    and a read that failed is not repeated in the same run.

Rate limits

The monitor uses GITHUB_TOKEN, whose quota (15,000 REST calls and 10,000 GraphQL points an
hour) is shared by every workflow in apache/airflow. Measured on 8 monitor runs on 2026-11-10
with 37 gated pull requests:

Per hour Every 15 min Every 5 min
Monitor REST reads ~170 ~500, up to ~740 with failed-job reads
Writes <= ~230 <= ~230 (unchanged)
GraphQL points ~40 ~120
Monitor share of the REST quota ~2-3% ~5%

All other workflows used up to ~4,750 REST calls in the busiest sampled hour, so the repository
stays around 35% of the quota. Reads grow by about one call per gated pull request per run: with
~500 gated pull requests (fork CI for all external contributors) the monitor would need ~6,600
calls an hour at this cadence, which is tight. Before that rollout the per-PR reads need
batching, or the cadence goes back to 10-15 minutes. The monitor logs the quota it has left on
every run and reports 30 minutes of rate limiting to Slack.

Depends on #76835.

related: https://lists.apache.org/thread/5603zwgpj7pgj6j979hbgpr72xsjbbws


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 5)

Generated-by: Claude Code (Opus 5) following the guidelines

🤖 Generated with Claude Code

@Andrushika Andrushika left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks :) really need this

@shahar1 shahar1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Faster cadence with hourly budgets derived from MONITOR_INTERVAL and the cron-sync test reads well, and the failed-job list is properly escaped. One minor gap: when the jobs read keeps failing, the state comment can stay stale. The rest are nits, all inline.

Project CI has not run on this layer: only CI passed (project CI not run) and bot checks are green. Locally at 6eb5a48923b, uv run --project dev/breeze pytest dev/breeze/tests/test_fork_ci_reconcile.py dev/breeze/tests/test_fork_ci_messages.py passes (425 tests). GitHub shows the PR as conflicting with its base, but fork-ci-startup-failure-and-status (30d87fba593) is an ancestor of the head and merges cleanly, so that flag looks stale.

Smaller observations (all inline)

  • fork_ci_reconcile.py:849 (minor): holding the state comment on a failed jobs read never ends while the read keeps failing, with no alert when job_statuses = false.
  • fork_ci_reconcile.py:1477 (nit): sort real failures before cancelled jobs, so the cap of 10 doesn't hide them.
  • fork_ci_reconcile.py:1498 (nit): failed PRs re-read their jobs every run; a candidate for the batching follow-up.
  • dev/AGENTS.md:57, :59 (nit): wording.

A second automated reviewer (Copilot) also read the diff and found nothing more.


This review was drafted by an AI-assisted tool and
confirmed by an Apache Airflow maintainer. The findings
below are observations, not blockers; an Apache Airflow
maintainer — a real person — will take the next look at the
PR. If you think a finding is mis-applied, please reply on
the PR and a maintainer will weigh in.

More on how Apache Airflow handles maintainer review:
Contributing guide.

Drafted-by: Claude Code (Opus 5.5); reviewed by shahar1 before posting

Comment thread dev/AGENTS.md Resolved
Comment thread dev/AGENTS.md Resolved
@potiuk
potiuk force-pushed the fork-ci-status-latency-and-detail branch from 965d512 to 428b2bd Compare November 14, 2026 04:28
@potiuk

potiuk commented Nov 14, 2026

Copy link
Copy Markdown
Member Author

Rebased on current main, together with #76835, which this PR builds on. All review comments are addressed:

  • The failed-job list is read once per fork run instead of on every monitor run. The marker records the run and attempt it belongs to (failed_run), so this also works with job_statuses = false.
  • If the jobs can't be read, the state comment is kept only when it already shows this head as failed. Otherwise the failed state is posted without the list.
  • Failed jobs are listed before timed-out and cancelled ones, also when jobs share a name.
  • The dev/AGENTS.md wording is fixed.

The rebase also picked up the new use project ci budget from main. That budget is now scaled by the 5-minute cadence like the others (20 an hour).

Looking for approvals on this PR and on #76835, which needs to merge first.


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

@potiuk
potiuk enabled stacked auto-merge (squash) November 14, 2026 04:56
When the fork run of a gated pull request failed, the state comment only
said "failed" and linked the run, so the author and reviewers had to open
the fork's run to see what broke, and with job statuses turned off or
deferred by the write budget the pull request showed nothing more.

The state comment of a failed run now lists the jobs that failed, timed
out or were cancelled, linking each job in the fork (at most 10). The jobs
are reused from the job statuses when they were read in the same run, and
a failed read leaves the comment for the next run instead of dropping the
list.

Generated-by: Claude Opus 5
Fork CI reaches a pull request only when the monitor runs: the fork run is
in another repository, so no event in apache/airflow reports its start or
end. At a 15-minute cadence plus GitHub's delay of scheduled workflows, the
start, failure or success of a fork run showed up on the pull request 10 to
20 minutes late, and so did `CI run started`, which every pull request
waits for before it can merge.

The monitor now runs every 5 minutes. The per-run write budgets and the
number of runs before a Slack note are derived from MONITOR_INTERVAL, so
their hourly totals stay as they were; a test checks that the interval
matches the workflow's cron. Unchanged pull requests cost no writes; the
cost is about three times the monitor's runner time and reads.

Generated-by: Claude Opus 5
…them

The state comment's marker records the fork run and attempt its failed-job
list belongs to, so later monitor runs do not read the same jobs again while
the comment would stay unchanged. When the jobs cannot be read, the comment
is held only if it already shows this head commit as failed; otherwise the
failed state is posted without the list. Failed jobs are listed before
timed-out and cancelled ones, so the cap of 10 does not hide them.

Generated-by: Claude Opus 5
When a cancelled or timed-out job came before a failed one of the same
name, the state comment linked the cancelled one and sorted it after the
real failures.

Generated-by: Claude Opus 5
@potiuk
potiuk force-pushed the fork-ci-status-latency-and-detail branch from 428b2bd to 5f13dab Compare November 14, 2026 08:06
@potiuk
potiuk merged commit 433ef3e into main Nov 14, 2026
177 of 178 checks passed
@potiuk
potiuk deleted the fork-ci-status-latency-and-detail branch November 14, 2026 08:46
potiuk added a commit that referenced this pull request Nov 15, 2026
* [v3-4-test] Sync fork CI changes from main

Several fork CI changes merged to main since the last sync never reached
v3-4-test, and the fork CI monitor reads the gate configuration of a pull
request's base branch, so pull requests to v3-4-test were still closed
after 7 days and missed ten pilot participants. The fork CI modules, their
tests, the design document and its diagrams, the monitor workflow, the
gate configuration checks and the contributor documentation now match
main, taking in #75814, #75696, #76272, #76316, #76327, #76510, #76538,
#76677, #76681, #76835, #76836, #76837, #76839, #76841, #76866, #76267 and
#77100.

The pilot participants new to this branch join at 2026-11-16 00:00 UTC
rather than at their main dates, as the gate configuration check requires
a future instant for an entry that is new on the base branch.

Generated-by: Claude Opus 5

* [v3-4-test] Say the fork CI monitor runs every 5 minutes in the CI tasks doc

The sentence changed with #76836 on main and was missed by the sync.

Generated-by: Claude Opus 5

* [v3-4-test] Bring the fork CI GitHub client tests in line with main

The tests for the smaller job listing pages (#76327) were missed by the
sync; the client code they cover is already in it.

Generated-by: Claude Opus 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants