potiuk commented on code in PR #76836:
URL: https://github.com/apache/airflow/pull/76836#discussion_r4571432667
##########
dev/breeze/src/airflow_breeze/utils/fork_ci_reconcile.py:
##########
@@ -1445,6 +1465,48 @@ def build_job_statuses(jobs: Iterable[dict[str, Any]])
-> dict[str, tuple[str, s
return statuses
+def find_failed_jobs(jobs: Iterable[dict[str, Any]]) -> list[FailedJob]:
+ """The finished jobs of a fork run that did not pass, by name, leaving out
the jobs every run has."""
+ failed: dict[str, FailedJob] = {}
+ for job in jobs:
+ if job["name"] in UNREPORTED_JOB_NAMES or job.get("status") in
RUNNING_JOB_STATUSES:
+ continue
+ conclusion = job.get("conclusion") or ""
+ if JOB_STATUSES.get(conclusion, ("",))[0] == "failure":
+ failed.setdefault(job["name"], FailedJob(job["name"],
job["html_url"], conclusion))
+ return sorted(failed.values())
Review Comment:
Done. Jobs that share a name now also keep the failed one over a cancelled
one (965d512739).
---
Drafted-by: Claude Code (Opus 5.5); reviewed by `potiuk` before posting
##########
dev/breeze/src/airflow_breeze/utils/fork_ci_reconcile.py:
##########
@@ -1445,6 +1465,48 @@ def build_job_statuses(jobs: Iterable[dict[str, Any]])
-> dict[str, tuple[str, s
return statuses
+def find_failed_jobs(jobs: Iterable[dict[str, Any]]) -> list[FailedJob]:
+ """The finished jobs of a fork run that did not pass, by name, leaving out
the jobs every run has."""
+ failed: dict[str, FailedJob] = {}
+ for job in jobs:
+ if job["name"] in UNREPORTED_JOB_NAMES or job.get("status") in
RUNNING_JOB_STATUSES:
+ continue
+ conclusion = job.get("conclusion") or ""
+ if JOB_STATUSES.get(conclusion, ("",))[0] == "failure":
+ failed.setdefault(job["name"], FailedJob(job["name"],
job["html_url"], conclusion))
+ return sorted(failed.values())
+
+
+# The jobs of fork runs read in this reconciler run, by run id. None records a
read that failed after
+# its retries, so the next reader gives up at once instead of repeating them;
the next run reads again.
+ReadJobs = dict[int, list[dict[str, Any]] | None]
+
+
+def read_failed_jobs(
+ client: GitHubClient,
+ pr: PullRequestSnapshot,
+ fork: ForkObservation,
+ read_jobs: ReadJobs,
+) -> list[FailedJob] | None:
+ """
+ ``find_failed_jobs`` of the pull request's fork run; None when its jobs
cannot be read.
+
+ :param read_jobs: the jobs already read in this reconciler run; a read
made here is recorded too.
+ """
+ if fork.run_id is None or not pr.head_repo:
+ return []
+ if fork.run_id in read_jobs:
Review Comment:
Covered by the `failed_run` marker above: one jobs read per fork run instead
of one per monitor run.
---
Drafted-by: Claude Code (Opus 5.5); reviewed by `potiuk` before posting
##########
dev/AGENTS.md:
##########
@@ -54,9 +54,9 @@ workflow of `apache/airflow` shares (see "Write budget" in
If the budget is exceeded, turn the job statuses off: set `job_statuses =
false` in
`.github/fork-ci-gate.toml`. Signs that it is exceeded are the monitor's Slack
note that job
-statuses "have not fit in the budget" (posted only after three runs in a row
deferred them)
+statuses "have not fit in the budget" (posted only after about 45 minutes of
runs in a row deferred them)
Review Comment:
Applied as suggested.
---
Drafted-by: Claude Code (Opus 5.5); reviewed by `potiuk` before posting
--
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]