Repository navigation
[Fix][CI] Keep the mirrored Build check accurate for re-runs and timeouts - #12473
Conversation
…outs - When the fork run is re-run, the Build check is already completed and GitHub keeps it completed even though the updater PATCHes it to in_progress, so the PR showed the previous attempt's result for the whole re-run. Start a new Build check run instead (once per attempt) and always update the newest one. A workflow-level concurrency group keeps overlapping ticks from racing. - A job that hits timeout-minutes ends as cancelled and GitHub reports the run as cancelled even when other jobs failed. Report failure when a job failed and timed_out when a cancelled job carries the timeout annotation. - Skip PRs whose Build check already holds the final result of the run, and stop comparing details_url when deciding whether to patch. GitHub never stores the fork URL on these check runs, so every Build check was re-patched on every tick.
DanielLeens
left a comment
There was a problem hiding this comment.
What Problem Does This PR Solve?
The workflow that mirrors each fork's Build run onto the PR's own Build check (.github/workflows/update_build_status.yml) has three field-observed bugs: (1) a re-run of a completed fork run keeps showing the previous attempt's stale result for the whole duration of the re-run, because GitHub silently ignores a PATCH that tries to move a completed check run back to in_progress; (2) a job that hits timeout-minutes ends as cancelled, and GitHub then reports the whole run as cancelled, so a genuine timeout/failure is mislabeled as "someone stopped the run"; (3) shouldSkipPatch compared details_url, which GitHub always keeps pointing at the check run itself, so the comparison never matched and 97% of the 10,708 PATCHes sent over an 80-run sample were pure no-ops. This PR fixes all three by (a) creating a second Build check run for the same head SHA when a completed check's underlying fork run is re-running, and letting later ticks track whichever check is newest; (b) inspecting job/annotation data to re-derive failure/timed_out out of a raw cancelled conclusion; (c) dropping the details_url comparison from shouldSkipPatch and adding a completed_at-based short-circuit (isCheckFinalForRun) so finished PRs cost near-zero API calls on subsequent ticks. A workflow-level concurrency group also prevents two ticks from racing to create duplicate check runs.
1. Code Change Review
1.1 Core Logic Analysis
Single file changed: .github/workflows/update_build_status.yml (+140/-6), one embedded github-script (Node) block. Critical path is processPullRequest() (.github/workflows/update_build_status.yml:306-479), which for each active PR: fetches the newest Build check run, resolves the underlying fork workflow run, decides whether to skip / create a new check / patch the existing one.
Before (shouldSkipPatch, pre-PR):
function shouldSkipPatch(checkRun, workflowRun) {
const sameStatus = checkRun.status === workflowRun.status;
const sameConclusion = ...;
const sameDetailsUrl = checkRun.details_url === workflowRun.details_url;
return sameStatus && sameConclusion && sameDetailsUrl;
}After (.github/workflows/update_build_status.yml:120-129):
function shouldSkipPatch(checkRun, workflowRun) {
// details_url is not compared: GitHub keeps it pointing at the check run itself ...
const sameStatus = checkRun.status === workflowRun.status;
const sameConclusion = ...;
return sameStatus && sameConclusion;
}New re-run detection and check-run creation (.github/workflows/update_build_status.yml:398-435):
const runStartedAt = Date.parse(workflowRun.run_started_at || '');
const hasCheckForCurrentAttempt = buildCheckRuns.some(
(checkRun) => checkRun.conclusion !== 'action_required'
&& !Number.isNaN(runStartedAt)
&& Date.parse(checkRun.started_at || '') >= runStartedAt
);
if (buildCheckRun.status === 'completed'
&& normalizedWorkflowRun.status !== 'completed'
&& !hasCheckForCurrentAttempt) {
// POST a new "Build" check run carrying the same {owner, repo, run_id} pointer
...
return;
}New cancelled-conclusion refinement (.github/workflows/update_build_status.yml:219-258), invoked from normalizeWorkflowRun at :268-273 and :292-297.
Key Findings
- The normal path (every 15-minute scheduled tick, for every "active" open PR) reaches all of this new code — it is not a rare recovery branch, it runs on every tick for every PR with a
Buildcheck. - The three motivating scenarios (stale re-run status, mislabeled timeout, no-op over-patching) are each concretely fixed for the "typical" case, backed by real production log evidence quoted in the PR description.
- This is a precise, evidence-driven fix for the three stated defects, not a blanket workaround — the author instrumented the actual production logs first and reverse-engineered GitHub's real Check Runs semantics (e.g., "PATCH accepted but ignored for
completed → in_progress"). - Two of the PR's own building blocks — creating a second same-named check run, and the check run's default
started_aton creation — depend on GitHub API behavior that is explicitly not verified live, because this workflow only runs onapache/seatunnel's own schedule and can't be exercised by fork CI. This is honestly disclosed in the PR body's "Not verified before merge" section, but it means the mechanism's core assumption is unconfirmed. - There is a remaining, non-hypothetical gap: when a same-
run_idre-run both starts and finishes inside a single ~15-minute tick gap and its conclusion happens to match the previous attempt's conclusion,shouldSkipPatch(now comparing only status/conclusion) will treat it as a no-op and never refreshdetails_url/completed_at— see Issue 1 below. This is a narrower recurrence of exactly the bug this PR sets out to fix.
In-depth correctness analysis
- Works correctly when: a re-run is observed by at least one tick while still
in_progress/queued(the overwhelmingly common case for SeaTunnel's multi-hour matrix build) — the new check-run-creation branch fires, and later ticks correctly track the new check by sortingbuildCheckRunsnewest-first byid(:331-338). - Fails to refresh state when: the whole re-run attempt completes between two ticks with an identical final conclusion to the prior attempt (Issue 1) — the check silently keeps the stale
details_url/completed_atforever, since the "already matches" skip becomes permanent (the normalized state never changes on subsequent ticks either). - Fails to distinguish
cancelledfromfailurewhen: the only failing job in an otherwise-cancelled/timed-out run isdead-link(.github/workflows/backend.yml:126-129,continue-on-error: true) —refineCancelledConclusion'sjobs.some(job => job.conclusion === 'failure' ...)check (:224-230) does not exclude jobs whose failure is meant to be ignored, so a run that only timed out will be reported asfailurepurely because the known-flaky, intentionally-non-blockingDead linksjob also failed. The author explicitly flags this in the PR body as a "Known limitation," which is commendable transparency, but it is a real, currently-unaddressed gap in exactly the function this PR introduces to fix problem #2. - Depends on: GitHub actually surfacing the newest of multiple same-named
Buildcheck runs as the one used for the PR's combined status / branch-protection required check. The author only has indirect evidence for this (the pre-existingreopened→notify_test_workflow.ymldual-check-run precedent), not a direct confirmation for the "schedule-created second check run" case introduced here.
Runtime-path trace (this PR does not touch seatunnel-engine/seatunnel-api/checkpoint/serialization/Source-Transform-Sink flow, so the engine-specific trace format doesn't literally apply; the equivalent CI-runtime trace is given instead):
cron "*/15 * * * *" (.github/workflows/update_build_status.yml:23-24)
-> concurrency group "update-build-status" serializes ticks (:26-29)
-> searchActivePullRequests() (:54-82) -- GH search API, 7-day window
-> processInBatches() -> processPullRequest(pr) per PR, 10 at a time (:481-489)
-> GET pulls/{n} (:310-316)
-> GET commits/{sha}/check-runs?per_page=100 (:321-329)
-> sort Build checks newest-first by id (:332-334)
-> pick buildCheckRun (:335-338)
-> resolve workflowRun via check output.text OR
findWorkflowRunForPullRequest() (action_required path) (:345-378)
-> isCheckFinalForRun(buildCheckRun, workflowRun) (:380-385, def :196-211)
-> true => return (no further calls)
-> false => continue
-> normalizeWorkflowRun(workflowRunParams, workflowRun) (:387-396, def :260-304)
-> if raw status 'completed' && conclusion 'cancelled'
-> listWorkflowJobs() (:271, def :170-194)
-> refineCancelledConclusion() (:269-272, def :219-258)
-> up to 10x GET check-runs/{job_id}/annotations (:238-246)
-> compute hasCheckForCurrentAttempt (:398-404)
-> if buildCheckRun completed && new run not completed && !hasCheckForCurrentAttempt
-> POST check-runs (create new "Build" check, same run_id pointer) (:417-433)
-> else if shouldSkipPatch(buildCheckRun, normalizedWorkflowRun) (:437-442, def :120-129)
-> return (no PATCH) <-- Issue 1 lives here
-> else PATCH check-runs/{id} (status/conclusion/completed_at/details_url) (:444-475)
1.2 Compatibility Impact
Fully compatible. No user-facing config option, API, protocol, or serialization format changes; the author correctly marks "Does this PR introduce any user-facing change? No." The only externally visible effect is that a PR's Build check can, for the duration of a re-run, show as two check runs with the same name instead of one being silently stuck — this is a display/consistency improvement, not a contract change, and mirrors an existing precedent in notify_test_workflow.yml's reopened handling (also unchanged by this PR).
1.3 Performance / Side-Effect Analysis
- Removing the
details_urlcomparison fromshouldSkipPatch(:120-129) plus the newisCheckFinalForRunshort-circuit (:196-211, used at:380-385) together cut the reported ~130 no-op PATCH calls/tick down to near zero once a PR's check is final — a clear net reduction in GitHub API write load and audit-log noise. - New reads are bounded and conditional:
listWorkflowJobs(:170-194) and up toMAX_TIMEOUT_LOOKUPS = 10annotation GETs (:44-47,:232-246) fire only when a run's raw conclusion iscancelled, which the PR's own evidence shows is rare (2 of 80 sampled runs). No unconditional new per-tick cost for the common (success/failure) case. - The new
concurrency: { group: update-build-status, cancel-in-progress: false }(:26-29) correctly prevents two ticks from concurrently creating duplicate "second" check runs for the same re-run — verified there is no other workflow reusing this literal group name (group names are repo-scoped, not workflow-scoped, so a collision would have been a real risk).cancel-in-progress: falsemeans a slow tick queues the next one rather than dropping it, which is the right choice for correctness but means a tick that grows expensive (e.g., many concurrentlycancelledruns) could back up the queue over time — worth watching, not a blocker. - No new secrets/tokens/permissions:
checks: writewas already granted at job level and is sufficient for the newPOST check-runscall. - Idempotency: the "create new check" branch is explicitly guarded by
hasCheckForCurrentAttemptto create at most one new check run per re-run attempt, contingent on thestarted_atdefault assumption in Issue 4 below.
1.4 Error Handling and Logging
Error containment is solid and consistent with the pre-existing pattern: every new call (refineCancelledConclusion's awaits, the new POST) executes inside processPullRequest's existing outer try { ... } catch (error) { console.error(...) } (:306-479), or inside the already-guarded normalizeWorkflowRun call site (:387-396), so a failure for one PR cannot crash processInBatches's Promise.all (:481-489) or abort the whole tick. No sensitive data (tokens, credentials) is logged — only PR numbers, check-run/run IDs, and status strings.
- Issue 1 (High) —
.github/workflows/update_build_status.yml:120-129interacting with:405-442: when a same-run_idre-run both starts and completes inside a single tick window and its final conclusion matches the prior attempt's,shouldSkipPatchsilently treats it as unchanged and the check'scompleted_at/details_urlare never refreshed — a narrower recurrence of the exact "re-run keeps showing stale result" bug (problem #1) this PR sets out to fix. The signal needed to detect this (hasCheckForCurrentAttempt, already computed at:398-404) is currently only used to gate check-run creation, not to force a patch-through when the observed completed run belongs to an attempt no existing check has ever recorded. - Issue 2 (Medium) —
.github/workflows/update_build_status.yml:219-230, corroborated by.github/workflows/backend.yml:126-129(dead-linkjob,continue-on-error: true,timeout-minutes: 150):refineCancelledConclusion's "any job failed ⇒ failure" check does not exclude the intentionally-non-blockingDead linksjob, so a run whose only failure is this known-flaky job (while everything else only timed out/cancelled) will be reported asfailureinstead oftimed_out/cancelled. Self-disclosed by the author as a "Known limitation," but it is a real, currently-uncovered gap in the exact function meant to fix problem #2. - Issue 3 (High) —
.github/workflows/update_build_status.yml:405-435, and the PR body's own "Not verified before merge" paragraph: the entire "create a second Build check run" strategy assumes GitHub treats the newest same-named check run on a head SHA as authoritative for the PR's combined status / branch-protection required check. This is inferred only from an unrelated precedent (reopenedPR dual-check case innotify_test_workflow.yml), not confirmed for this exact code path, and cannot be exercised by fork CI. If the assumption is wrong, this fix could leave a PR's requiredBuildstatus permanently reflecting the old, now-irrelevant check instead of the current re-run — silently worse than doing nothing. - Issue 4 (Medium) —
.github/workflows/update_build_status.yml:417-433used by:398-404: the newPOST check-runscall omitsstarted_at, relying on GitHub defaulting it to "now." This is a reasonable assumption but is explicitly unverified per the PR body. If wrong (e.g., GitHub defaults it to something other than the request time, or requires it),hasCheckForCurrentAttemptwould never see a check "for the current attempt," and a newBuildcheck run would be created on every single tick for the duration of a re-run (check-run spam, not data corruption — the failure is caught by the existing outertry/catcheither way).
2. Code Quality Assessment
2.1 Coding Standards
Good. Every new nontrivial function has an explanatory comment describing why, not just what: isCheckFinalForRun (:196-197), refineCancelledConclusion (:219-222), the shouldSkipPatch rationale for dropping details_url (:121-123), and the new-check-run branch's rationale (:410-413). jobDurationMs (:213-217) is trivial/self-explanatory and correctly left uncommented. One minor nit (non-blocking): the "longest-duration-first" heuristic for cancelledJobs.sort(...).slice(0, MAX_TIMEOUT_LOOKUPS) (:232-235) is explained in the PR description but not in an inline comment at the sort call itself — a one-line comment there would help a future maintainer who only reads the code, not the PR body.
2.2 Test Coverage and Test Stability
This PR adds no test files (there is no src/test for .github/workflows scripts in this repo). The author instead extracted the embedded script and ran it under Node 20 against a 13-scenario mocked github.request, showing 4/13 scenarios pass on dev vs. 13/13 on this branch — a genuinely rigorous, scenario-driven validation approach for CI-infra code, and far better than "I read the diff and it looks right."
That said, this harness is not persisted anywhere in the repository — it lives only in the PR description as prose. There is no committed test for a future change to this workflow to run against, so a later edit could silently regress any of these 13 behaviors with nothing catching it before the next real 429/timeout incident happens in production. Issue 5 (Low): recommend committing the mock-github.request harness (e.g., a small Node script under .github/scripts/ runnable via node --test or similar) as a persisted regression test.
Flakiness rating: Stable. There is no test code in this diff to apply the mandatory flaky-test checklist to (no hard sleeps, no shared static state, no timing races are introduced — the workflow's own polling interval is a deliberate design constant, not a test artifact). This rating applies to "does this change introduce flaky automated tests," which it does not, since it adds none.
2.3 Documentation Updates
Not applicable — this is CI-only status-reporting infrastructure with no user-facing behavior, consistent with the author's own PR-template answer ("Does this PR introduce any user-facing change? No."). docs/en/docs/zh correctly untouched.
3. Architectural Soundness
3.1 Elegance of the Solution
Precise fix, scoped tightly to the existing polling architecture rather than a rewrite. The author correctly ruled out the more "obvious" alternative (PATCH the same completed check back to in_progress) with direct evidence that GitHub silently ignores it, and pivoted to creating a second check run instead — a reasonable, minimal-footprint choice within the current design's constraints.
3.2 Maintainability
Good. Functions are small, single-purpose, and well-named (isCheckFinalForRun, refineCancelledConclusion, hasCheckForCurrentAttempt). The main residual maintainability risk is the annotation-message string match (TIMEOUT_ANNOTATION = 'exceeded the maximum execution time', :46) — this depends on undocumented GitHub wording that could change without notice; a wording change degrades gracefully to the pre-PR cancelled label rather than throwing, which is an acceptable soft-failure design, but worth a one-line comment noting the fallback behavior if the string ever stops matching.
3.3 Extensibility
Reasonable. refineCancelledConclusion is generic over "any cancelled job list," so it would extend cleanly if more nuanced conclusion derivation is needed later. The hard-coded Dead links exclusion suggested in Issue 2, when added, should be done by job name/id rather than a broader structural change.
3.4 Historical-Version Compatibility
Not applicable in the usual "old task JSON / checkpoint" sense — this is CI infrastructure with no persisted user data or task state to migrate. The one relevant continuity point is that the {owner, repo, run_id} JSON pointer format embedded in check.output.text (:426-430) is unchanged, so any in-flight check run created by the old script before this PR merges will still be readable by the new script after merge, and vice versa — confirmed by inspection, no format change.
4. Issue Summary
| # | Issue | Location (path:line) | Severity |
|---|---|---|---|
| 1 | shouldSkipPatch misses a same-tick full re-run cycle whose conclusion matches the prior attempt's, leaving stale completed_at/details_url permanently |
.github/workflows/update_build_status.yml:120-129, :398-442 |
High |
| 2 | refineCancelledConclusion doesn't exclude the intentionally non-blocking dead-link (continue-on-error) job, so its failures cause failure to be reported instead of cancelled/timed_out (self-disclosed by author) |
.github/workflows/update_build_status.yml:219-230; .github/workflows/backend.yml:126-129 |
Medium |
| 3 | Unverified assumption that GitHub uses the newest same-named Build check run for combined/required status; cannot be tested via fork CI (self-disclosed by author) |
.github/workflows/update_build_status.yml:405-435 |
High |
| 4 | Unverified default started_at on the newly created check run, relied on by the re-run dedup logic (self-disclosed by author) |
.github/workflows/update_build_status.yml:417-433, :398-404 |
Medium |
| 5 | The author's own 13-scenario mock-github.request test harness is not committed to the repo as a persisted regression test |
N/A (whole file / PR description) | Low |
| 6 | MAX_TIMEOUT_LOOKUPS = 10 "longest-duration-first" heuristic could theoretically miss the real timed-out job in a matrix with >10 concurrently cancelled jobs |
.github/workflows/update_build_status.yml:44-47, :232-235 |
Low |
5. Merge Recommendation
Conclusion: Ready to merge after fixes
-
Blockers — must be fixed:
- Issue 1 (High) — Extend the skip decision to also force a patch when the observed completed run belongs to an attempt that has never had a check created/patched for it (the
hasCheckForCurrentAttemptsignal is already computed at:398-404and can be reused here), so a fast, same-conclusion re-run cycle still refreshescompleted_at/details_urlinstead of silently staying stale forever. This is a narrow but realistic recurrence of the PR's own headline bug (the PR's own motivating example is a repeated infra failure — exactly the "same conclusion twice" case). - Issue 3 (High) — Before merging, get a direct confirmation (not just the
reopened-precedent inference) that GitHub's combined-status/required-check evaluation picks the newest of two same-named check runs on one head SHA. This is cheaply testable on the author's own fork (create two "Build"-named check runs with different conclusions on the same test commit and queryGET /repos/{owner}/{repo}/commits/{ref}/statusor the PR'smergeStateStatus) without needing to touchapache/seatunnelitself. If confirmed, this stops being a blocker; if not, the whole "second check run" mechanism needs rethinking. - Issue 2 (Medium, but tied to problem #2's own stated goal) — Exclude the
dead-linkjob (by name, since it's the onlycontinue-on-errorjob inbuild_main.yml's dependency chain) fromrefineCancelledConclusion's failure check, so a run that only timed out doesn't get mislabeled asfailurepurely because of a job that was deliberately made non-blocking.
- Issue 1 (High) — Extend the skip decision to also force a patch when the observed completed run belongs to an attempt that has never had a check created/patched for it (the
-
Recommended fixes — non-blocking:
- Issue 4 (Medium) — Not fixable by more code (it depends on live GitHub behavior); recommend the author's own proposed post-merge log monitoring (
Create Build check run for PR #…appearing repeatedly for the same PR/attempt would reveal a wrongstarted_atassumption quickly, and is easily reverted since this is pure workflow config). - Issue 5 (Low) — Commit the mock-
github.requesttest harness so future edits to this script have something to run against, rather than relying on manual re-verification each time. - Issue 6 (Low) — Document the "longest-duration-first, top 10" trade-off inline; not worth complicating the logic for SeaTunnel's current matrix sizes.
- Issue 4 (Medium) — Not fixable by more code (it depends on live GitHub behavior); recommend the author's own proposed post-merge log monitoring (
Overall assessment: This is a well-evidenced, appropriately-scoped fix for three real, log-documented CI reliability bugs, and it is a strict improvement over dev's current behavior (4/13 → 13/13 on the author's own mock scenarios) even accounting for the gaps above — none of the new issues make anything worse than today except in the specific narrow paths identified. The author has been unusually transparent about the two GitHub-API assumptions that can't be tested pre-merge (Issues 3 and 4), which is exactly the right way to disclose residual risk in infrastructure that can't get real CI coverage. Issue 1 and Issue 2, however, are concrete, in-scope gaps in the new code itself (not pre-existing/unrelated) that are cheap to close now rather than after another multi-day production log investigation.
Alternative implementations considered:
- Option A (this PR): Keep the polling architecture; create a second check run per re-run attempt. Pros: minimal footprint, no new trust boundary. Cons: depends on the two unverified GitHub behaviors above, and check runs accumulate per re-run (checks-tab clutter over multiple retries).
- Option B (reset the existing check run): Empirically ruled out by the author with direct evidence — GitHub accepts but ignores a PATCH moving a
completedcheck back toin_progress. Correctly not pursued. - Option C (longer-term, out of scope here): Move from 15-minute polling to an event-driven model where the fork's own run completion pushes status back (e.g., via a GitHub App or scoped cross-repo token reacting to the fork's
workflow_runcompletion) instead of a base-repo cron job discovering state after the fact. This would eliminate the whole "did a tick miss the transient state" family of bugs (including Issue 1) at the root, but requires a new cross-repo trust/permission model and is a materially larger change — reasonable to leave for a follow-up rather than block this incremental, well-tested fix on it.
… in the status mirror - Create a completed Build check when a re-run started and finished between two ticks, instead of skipping it as unchanged. - Set started_at on created checks to the attempt's run_started_at. - List Build checks with check_name and filter 'all' and use the newest one. - Leave the continue-on-error Dead links job out when deriving or refining the run's conclusion. - Comment the timeout annotation fallback and the longest-first lookup limit.
…consistent - Read every page of Build check runs for the head SHA, and skip the PR for the tick if fewer than total_count were listed, so a missed newest check cannot lead to a new check on every tick. - When only the non-blocking Dead links job was cancelled, report what the other jobs concluded, as the queued-parent path already does. - Keep the new check-runs query parameters apart from the ref/per_page lines.
… is unfinished Only derive the result from the other jobs when every blocking job has completed, as the queued-parent path does, so an unfinished job with no conclusion yet can never turn a cancelled run into a success. Also cap the Build check-run listing at 10 pages per PR and tick.
|
Thanks for the review. Addressed in the latest commits:
|
DanielLeens
left a comment
There was a problem hiding this comment.
Thanks for the very thorough follow-up, and for pushing back with concrete evidence on every point instead of just saying "fixed" — that's exactly the kind of response that makes re-review easy. I re-read the entire current file from scratch (not just the delta) and re-traced the full runtime path. Here is the complete re-review of the latest head (36fda01).
What Problem Does This PR Solve?
- User pain point: contributors and maintainers rely on the PR's own
Buildcheck to know whether the fork's CI actually passed. The mirroring workflow that keeps that check in sync with the fork's realbuild_main.ymlrun had three field-observed bugs: a re-run of a completed fork run kept showing the previous attempt's stale result for the whole duration of the re-run; a job that hittimeout-minutesended up reported ascancelled(looking like someone manually stopped the run) instead offailure/timed_out; and a staledetails_urlcomparison inshouldSkipPatchmade ~97% of PATCH calls no-ops, wasting API quota. - Fix approach: create a second
Buildcheck run for the same head SHA whenever a completed check's underlying fork run turns out to be re-running (or has already re-run and finished) so a stale check is never left in place; re-derivefailure/timed_outfrom job/annotation data instead of trusting a rawcancelledconclusion; and stop comparingdetails_urlinshouldSkipPatchso finished PRs cost near-zero API calls on later ticks. - One-sentence summary: this makes the mirrored
Buildcheck on a PR actually reflect what the fork's CI is doing right now, instead of occasionally freezing on stale or mislabeled state.
1. Code Change Review
1.1 Core Logic Analysis
Single file, .github/workflows/update_build_status.yml (unchanged since my last review). Since that review, 4 new commits landed that directly respond to Issues 1–4 and the two Low nits (old Issues 5–6). I re-read the whole 574-line script end to end; below is what changed and why it matters.
Issue 1 fix (stale check on a fast, same-conclusion re-run) — update_build_status.yml:454-467:
Before (what I reviewed last time):
const hasCheckForCurrentAttempt = buildCheckRuns.some(
(checkRun) =>
checkRun.conclusion !== 'action_required'
&& !Number.isNaN(runStartedAt)
&& Date.parse(checkRun.started_at || '') >= runStartedAt
);
if (
buildCheckRun.status === 'completed'
&& normalizedWorkflowRun.status !== 'completed'
&& !hasCheckForCurrentAttempt
) { /* create new check */ }This only created a new check when the observed run was still in progress. If a re-run both started and finished between two ticks with the same final conclusion as the prior attempt, shouldSkipPatch treated it as unchanged and the stale completed_at/details_url never refreshed — a narrower recurrence of the exact bug being fixed.
After:
const isCheckFromEarlierAttempt =
Date.parse(buildCheckRun.completed_at || '') < runStartedAt;
if (
buildCheckRun.status === 'completed'
&& (normalizedWorkflowRun.status !== 'completed' || isCheckFromEarlierAttempt)
&& !hasCheckForCurrentAttempt
) { /* create new check, now also setting status/conclusion/completed_at directly if already completed */ }I traced this through the exact scenario from the PR's own motivating example (a repeated infra failure with the same conclusion twice): if the previously-recorded check's completed_at predates the current attempt's run_started_at, a brand-new check run is created carrying the current attempt's real result, even when that attempt already finished by the time the tick observes it. That correctly closes the gap.
Issue 2 fix (Dead links, continue-on-error, mislabeled as failure) — update_build_status.yml:52-54, 226-251:
const NON_BLOCKING_JOB_NAMES = ['Run / Dead links'];
...
async function refineCancelledConclusion(workflowRunParams, allJobs) {
const jobs = allJobs.filter((job) => !isNonBlockingJob(job));
if (jobs.some((job) => job.conclusion === 'failure' || job.conclusion === 'startup_failure')) {
return 'failure';
}
if (jobs.every((job) => job.status === 'completed') && !jobs.some((job) => job.conclusion === 'cancelled')) {
return deriveCompletedConclusion(jobs, 'cancelled');
}
...
}I verified the exact job-name string against source rather than taking it on faith: build_main.yml:28-33 defines the reusable-workflow-calling job as name: Run invoking ./.github/workflows/backend.yml, and backend.yml:127-128 defines dead-link with name: Dead links and continue-on-error: true — the only continue-on-error job in that whole chain (confirmed by scanning every job in backend.yml). GitHub's "<caller job name> / <called job name>" naming convention for reusable-workflow jobs means the real job name is exactly Run / Dead links, matching the hardcoded constant. This is correctly scoped and factually accurate today.
Issue 3 (unverified "GitHub picks the newest same-named check run" assumption) — update_build_status.yml:345-394:
The author reports a live-fork test confirming the PR rollup shows only the newest of two same-named Build checks, and cites the existing production precedent on #12372. On top of that, this round also adds something more concretely verifiable purely from source: the check-runs GET call now explicitly passes check_name: 'Build' and filter: 'all', plus full pagination up to MAX_CHECK_RUN_PAGES, with a defensive skip if the listing can't be completed. This matters independently of the "which check wins" question: GitHub's own docs for this endpoint state filter defaults to latest, and (per long-standing, widely-relied-upon behavior of this endpoint) that default returns only the single most recent check run per check name — meaning the previous version I reviewed, which called this endpoint without filter, could have had checkRuns.data.check_runs silently capped to one "Build" entry per tick regardless of how many check runs actually existed, undermining its own re-run bookkeeping. That was a latent, previously-unflagged risk in the version I already approved-with-blockers; this round's filter: 'all' change closes it as a side effect, independent of whether the fork test result generalizes to the base repo.
Issue 4 fix (unverified default started_at on the new check) — update_build_status.yml:496-498:
if (!Number.isNaN(runStartedAt)) {
createParams.started_at = workflowRun.run_started_at;
}This removes the reliance on the POST endpoint's undocumented default entirely by setting started_at explicitly from a real, returned API field. Good fix — but see Issue 1 below, because it shifts the open question from "what does POST default started_at to" onto "does run_started_at itself reset to the current attempt's start time on a re-run."
Key Findings
- The normal path (every 15-minute tick, every active open PR) still reaches all of this code — not a rare recovery branch.
- All three originally-reported production scenarios, plus the two Low nits, are addressed with source-verifiable changes; two of the three previously-High assumptions (Issues 3 and 4) are now either directly tested by the author or converted from "trust an undocumented default" into "trust a real API field," which is a strictly stronger position than before.
- This remains a precise, evidence-driven fix, not a workaround — and the author's iterative response actually surfaced and fixed an additional, previously-unflagged issue (the
filter/check_namegap) beyond what was asked. - There is one new, non-hypothetical assumption introduced by the Issue 1/4 fixes together: the entire "is this check stale relative to the current attempt" comparison at
:454-467now pivots onrun_started_atmoving forward on every re-run. GitHub's REST docs for the workflow-run object only describe this field as a date-time string with no statement about rerun behavior — see Issue 1 below for why this matters and how cheaply it can be closed. - Current implementation blind spot: none of the logic distinguishes "attempt N was re-run because the previous attempt genuinely failed/timed out" from "attempt N is a manual re-run of a run that already succeeded" — both are handled identically (a new check reflecting whatever the current attempt's real conclusion is), which is the correct, desired behavior in both cases, so this is not a gap, just confirming the design handles both uniformly.
In-depth correctness analysis
- Works correctly when: a re-run is observed while still
in_progress/queued(the common case for SeaTunnel's multi-hour matrix build) — new-check-run branch fires as before. Now also works correctly when: the whole re-run attempt completes between two ticks with an identical final conclusion to the prior attempt —isCheckFromEarlierAttemptcatches this and forces a fresh check run instead of a silent skip. - Still depends on:
run_started_atactually advancing on rerun. If it does not,isCheckFromEarlierAttemptandhasCheckForCurrentAttemptboth evaluate against the original attempt's start time forever,shouldSkipPatchwould once again treat a same-conclusion fast re-run as a no-op, and the original Issue 1 bug would silently reappear for exactly the "same infra failure happens twice" scenario the PR was written to fix. This is the one item I'd want closed (or empirically confirmed the same way Issue 3 was) before merge — see Issue 1. - The
Dead linksexclusion inrefineCancelledConclusionis now correctly scoped and only changes behavior inside the already-narrow "raw conclusion was cancelled" branch; it does not touch the commonsuccess/failurepath, where GitHub's own run-level conclusion already accounts forcontinue-on-errornatively.
Runtime-path trace (CI-infra, not engine/API, so the text-flow format is used):
cron "*/15 * * * *" (:23-24)
-> concurrency group "update-build-status" serializes ticks (:26-29)
-- confirmed unique repo-wide: scanned every other workflow file in .github/workflows, no other group reuses this name
-> searchActivePullRequests() (:61-89)
-> processInBatches() -> processPullRequest(pr), 10 at a time (:551-559)
-> GET pulls/{n} (:334-340)
-> GET commits/{sha}/check-runs, check_name=Build, filter=all, paginated up to MAX_CHECK_RUN_PAGES (:345-387)
-> incomplete listing after MAX_CHECK_RUN_PAGES -> skip PR this tick (:382-387)
-> buildCheckRuns sorted newest-first by id; buildCheckRun = buildCheckRuns[0] (:389-394)
-> resolve workflowRun via check output.text OR findWorkflowRunForPullRequest() (action_required path) (:401-434)
-> isCheckFinalForRun(buildCheckRun, workflowRun) (:436-441, def :205-218)
-> true => return (no further calls)
-> normalizeWorkflowRun(...) (:443-452, def :283-328)
-> raw status completed && conclusion cancelled -> refineCancelledConclusion (:291-296, def :234-281)
-> filters out NON_BLOCKING_JOB_NAMES jobs first (:235)
-> all blocking jobs completed, none cancelled -> derive real conclusion from them, ignoring Dead Links (:243-251)
-> otherwise -> up to MAX_TIMEOUT_LOOKUPS annotation GETs, longest-running cancelled jobs first (:253-278)
-> runStartedAt = Date.parse(workflowRun.run_started_at) (:454)
-> hasCheckForCurrentAttempt / isCheckFromEarlierAttempt (:455-463) <-- Issue 1 lives here
-> if buildCheckRun completed && (workflow not completed || isCheckFromEarlierAttempt) && !hasCheckForCurrentAttempt
-> POST new "Build" check run, started_at = workflowRun.run_started_at, conclusion/completed_at set if already completed (:464-504)
-> else if shouldSkipPatch(buildCheckRun, normalizedWorkflowRun) (:507-512, def :127-136)
-> return (no PATCH)
-> else PATCH check-runs/{id} (:514-545)
1.2 Compatibility Impact
Fully compatible. No user-facing config, API, protocol, or serialization-format change; correctly marked "No" for user-facing change. The only externally visible effect remains that a PR's Build check can briefly show as two check runs with the same name during a re-run instead of one being silently stuck — a display/consistency improvement, mirroring the pre-existing notify_test_workflow.yml reopened precedent.
1.3 Performance / Side-Effect Analysis
- The added pagination in the check-runs listing (
:359-380) is bounded (MAX_CHECK_RUN_PAGES = 10,per_page: 100, i.e. up to 1000 Build check runs per PR per tick) and only loops past page 1 when a PR has actually accumulated that many re-runs — a busy but realistic upper bound, not a new unconditional cost for the common case. refineCancelledConclusion's new job-filtering (:235) and early-return (:243-251) are pure in-memory operations on data already fetched bylistWorkflowJobs; no new network calls added by the Issue 2 fix itself.- Net API-call profile is unchanged from what I already assessed favorably last round: no unconditional new per-tick cost for the common
success/failurecase, and theisCheckFinalForRunshort-circuit still keeps a finished PR's steady-state cost near zero. - No new secrets/tokens/permissions introduced this round.
1.4 Error Handling and Logging
Still solid and consistent with the pre-existing pattern: every new call sits inside processPullRequest's outer try { ... } catch (error) { console.error(...) } (:333-548), so one PR's failure can't abort the whole tick's Promise.all (:551-559). No sensitive data logged — only PR numbers, run/check IDs, and status strings. The new pagination skip path (:382-387) fails safe (skips the PR rather than acting on an incomplete check-run list) and logs a clear, actionable message.
Issue 1 (Medium) — .github/workflows/update_build_status.yml:454-467: the fix for the "fast, same-conclusion re-run" gap depends on workflow_run.run_started_at resetting to the current attempt's start time on every re-run. GitHub's REST API documentation for the workflow-run object does not state this behavior either way (I checked the current published schema description, which only says it is a date-time field). If run_started_at instead stays pinned to the very first attempt forever, isCheckFromEarlierAttempt and hasCheckForCurrentAttempt both silently degrade back to comparing against the original attempt, and the exact bug this fix targets — a same-conclusion re-run leaving a stale check — reappears for precisely the scenario in the PR's own motivating example. Potential risk: silent recurrence of the PR's headline bug in the one case (fast, same-conclusion re-run) most likely to actually happen in production, with no error or log signal that the safeguard didn't fire. Best improvement: Option A (recommended, cheap, removes the assumption entirely) — workflow_run.run_attempt is already fetched and already logged at :475; store it in the check's output.text JSON next to {owner, repo, run_id} when a new check is created, and compare that exact integer against the current workflowRun.run_attempt instead of inferring "new attempt" from timestamps. This needs no live-GitHub-behavior verification at all, since run_attempt is a definitionally-incrementing counter. Option B — do the same 5-minute empirical check on your fork that you already did for the check-rollup question (re-run an actual workflow twice and diff run_started_at between the two GET .../actions/runs/{run_id} responses) and report the result in the PR description. Either resolves this before merge. Severity: Medium — I'm not raising this to High because it can't make anything worse than dev's current behavior (which has no re-run tracking at all), the failure mode is narrow and already-adjacent to a previously-disclosed limitation, and the fix is a one-line, no-redesign change — but given this script gates the required Build check for every PR in the repository, I'd like to see it closed rather than left as a live assumption. Raised by another reviewer: No.
Issue 2 (Low) — .github/workflows/update_build_status.yml:52-54: NON_BLOCKING_JOB_NAMES = ['Run / Dead links'] is verified accurate against current source (see 1.1 above), but it hardcodes a string that depends on two independent, unrelated naming choices in build_main.yml and backend.yml. A future rename of either job's name: (with no reason for whoever edits backend.yml to know this workflow depends on that exact string) would make isNonBlockingJob() silently stop matching, quietly reintroducing the original "Dead links mislabeled as failure" bug with no error signal — the same graceful-but-silent-degradation pattern already accepted for TIMEOUT_ANNOTATION. Best improvement: add a one-line comment at the constant's declaration cross-referencing the two exact source locations it depends on (build_main.yml:32, backend.yml:128), mirroring the comment already added for TIMEOUT_ANNOTATION at :46-47. Severity: Low. Raised by another reviewer: No.
Issue 3 (Low) — .github/workflows/update_build_status.yml:359-387: the pagination-completeness guard compares listedCheckRuns.length against checkRuns.data.total_count. This is correct only if total_count reflects the count after the check_name: 'Build' filter is applied server-side; GitHub's published docs for this endpoint don't explicitly confirm whether total_count is filtered or unfiltered. If it turns out to be unfiltered (i.e., counts every check run on the SHA regardless of name), a PR with many non-Build checks (labeler, notify-test-workflow, etc.) could trip the "incomplete listing, skip this tick" branch far more often than intended, purely as a availability/freshness degradation (not incorrect data — worst case is the check falls behind for a tick or two). Best improvement: log the raw total_count alongside the "Skip PR" message at :383-385 for one deploy cycle so this can be confirmed or ruled out from real production logs, the same evidence-driven approach already used elsewhere in this PR. Severity: Low. Raised by another reviewer: No.
Issue 4 (Low, carryover from my previous review's Issue 5, still open) — the author's reply confirms the 33-scenario mock-github.request test harness (now 33/33 on this branch vs. 9/33 on dev, per the latest reply) is still not committed to the repository, deferred to a follow-up PR since the script is inline YAML with nothing in-repo to run it against today. This remains a reasonable, disclosed trade-off, not a regression — I'd just encourage prioritizing that follow-up soon, since this file now has zero committed test coverage of any kind and every future edit relies entirely on manual re-verification. Severity: Low. Raised by another reviewer: No.
2. Code Quality Assessment
2.1 Coding Standards
Good, and improved since last round. Every new/changed nontrivial function or constant now has an explanatory comment describing why: TIMEOUT_ANNOTATION (:46-47), MAX_CHECK_RUN_PAGES (:50), NON_BLOCKING_JOB_NAMES (:52-54, though see Issue 2 for a suggested addition), the cancelled-jobs sort rationale (:253-254), and the re-run/new-check-run branch (:469-473). Both Low documentation nits from my previous review are now resolved.
2.2 Test Coverage and Test Stability
No test files exist or are added (there is no src/test equivalent for .github/workflows scripts in this repo, consistent with the rest of this directory). As before, the author's validation approach (extracting the script and running it against a mocked github.request with a growing scenario suite — 13 scenarios last round, 33 this round, 9/33 passing on dev vs 33/33 on this branch) is a genuinely rigorous, scenario-driven approach for CI-infra code. It is still not persisted in the repository (Issue 4 above).
Stability rating: Stable. There is no test code in this diff to apply the flaky-test checklist to — no hard sleeps, no shared static state, no timing races introduced by this change. This rates "does this change add flaky automated tests," which it does not, since it adds none.
2.3 Documentation Updates
Not applicable — CI-only status-reporting infrastructure with no user-facing behavior, correctly reflected in the author's "No" answer to the user-facing-change question. docs/en/docs/zh correctly untouched.
3. Architectural Soundness
3.1 Elegance of the Solution
Precise fix, still tightly scoped to the existing polling architecture. The additional filter: 'all'/pagination change and the isCheckFromEarlierAttempt refinement are both narrow, targeted responses to concrete gaps rather than a broader rewrite — consistent with how the PR was originally framed.
3.2 Maintainability
Good, and the added comments meaningfully help here. The main residual maintainability risks are the two string/format dependencies flagged in Issues 2 and 3 (job-name string, total_count filter semantics) plus the new run_started_at reset assumption in Issue 1 — all three degrade gracefully (skip or stale-but-not-wrong behavior) rather than crashing, which is the right failure mode for this kind of best-effort mirroring job, but each is worth a comment or a log line so a future reader doesn't have to rediscover the dependency from scratch.
3.3 Extensibility
Reasonable. refineCancelledConclusion and isNonBlockingJob are generic enough to extend if a second non-blocking job is ever added — just append to NON_BLOCKING_JOB_NAMES.
3.4 Historical-Version Compatibility
Not applicable in the usual persisted-state sense. The {owner, repo, run_id} JSON pointer format embedded in check.output.text is unchanged this round, so in-flight check runs created before this PR merges remain readable by the new script and vice versa.
4. Issue Summary
| # | Issue | Location (path:line) | Severity |
|---|---|---|---|
| 1 | Re-run staleness fix depends on the undocumented assumption that run_started_at resets to the current attempt's start time on rerun; if wrong, the PR's headline bug silently reappears for the "fast, same-conclusion re-run" case |
.github/workflows/update_build_status.yml:454-467 |
Medium |
| 2 | NON_BLOCKING_JOB_NAMES hardcodes a job-name string coupled to unrelated job labels in two other files, with no cross-reference comment |
.github/workflows/update_build_status.yml:52-54 |
Low |
| 3 | Pagination-completeness guard assumes total_count is filtered by check_name; unconfirmed by GitHub's public docs |
.github/workflows/update_build_status.yml:359-387 |
Low |
| 4 | Carryover: the author's 33-scenario mock-github.request test harness is still not committed as a persisted regression test (deferred to follow-up) |
N/A (whole file / PR description) | Low |
5. Merge Recommendation
Conclusion: Ready to merge after fixes
-
Blockers — must be fixed:
- Issue 1 (Medium) — Close the
run_started_at-reset assumption before merge, either by switching to therun_attempt-based comparison (recommended — cheap, removes the assumption entirely, andrun_attemptis already fetched and logged) or by empirically confirming the reset behavior on your fork the same way you already confirmed the check-rollup ordering, and noting the result in the PR description. Given this script gates the requiredBuildcheck for every open PR in the repository, I'd rather see this closed than merged as a live assumption — but the fix itself is small and does not require touching anything else in this PR.
- Issue 1 (Medium) — Close the
-
Recommended fixes — non-blocking:
- Issue 2 (Low) — Add a one-line comment cross-referencing
build_main.yml:32andbackend.yml:128at theNON_BLOCKING_JOB_NAMESdeclaration. - Issue 3 (Low) — Log
total_countalongside the pagination-skip message for one deploy cycle to confirm the filter-scope assumption from real data. - Issue 4 (Low) — Commit the mock-
github.requestharness in the follow-up you already have planned.
- Issue 2 (Low) — Add a one-line comment cross-referencing
Overall assessment: This is a strong, responsive update. All three of my previous High/Medium blockers (Issues 1, 2, and 3 from the last round) are addressed with source-verifiable evidence — I independently confirmed the Run / Dead links job-name fix against build_main.yml and backend.yml, and the author's live-fork test plus the newly-added filter: 'all'/check_name fix meaningfully de-risk the check-rollup assumption beyond what I asked for last time. The Issue 4 fix (explicit started_at) is also a clean improvement. The one new item I'm flagging (Issue 1) is a direct, honest consequence of fixing the original bug well — it's the same class of "unverified GitHub behavior" the author has already been transparent about twice, and it has the same cheap remedy (a fork test, or better, removing the need for one by using run_attempt). None of the Low items block merge.
CI status: the Build check on this PR itself is green, but that only exercises build_main.yml's normal compile/test pipeline against this branch's code — it does not and cannot exercise update_build_status.yml's own logic, since that workflow only runs on a schedule against apache/seatunnel's own base-repo context and can't be triggered from a fork PR. So CI passing here is uninformative about the correctness of the change itself; my conclusion above is based entirely on static analysis and the author's disclosed manual/fork testing, exactly as it was last round.
Alternative implementations considered: unchanged from my previous review — Option A (this PR, second check run per re-run) remains the right minimal-footprint choice; Option B (reset the existing check) was already empirically ruled out by the author; Option C (event-driven status push instead of polling) remains a reasonable, larger follow-up that would eliminate this whole family of bugs at the root, but is out of scope for this incremental fix.
Purpose of this pull request
Related: #11513 (status reporting track). This does not overlap #11515. That PR's remaining
update_build_status.ymlchange bumpsgithub-scriptto v7 and addsper_page: 100to the check-runs call. This PR makes the sameper_page: 100edit, keeps its other changes to that call away from those lines, and leaves thegithub-scriptversion alone. A trial merge with the head of #11515 merges this file cleanly.update_build_status.ymlmirrors each forkBuildrun onto the PR'sBuildcheck. The mirror logs from 80 consecutive runs (2026-09-22 05:42Z to 2026-09-23 05:50Z) and two fork runs show three problems.1. A re-run keeps showing the previous attempt's result.
Fork run https://github.com/goutamadwant/seatunnel/actions/runs/35673416231 (PR #12360):
During those 23 hours, the updater logged
Patch PR #12360 check run 106574782200: completed -> in_progress73 times without error. The check stayedcompleted/failurethe whole time. GitHub accepts the PATCH but does not move a completed check run back toin_progress. The check turnedsuccessonly when attempt 2 finished, and itscompleted_atstill reads 01:55:20Z.In the same 24 hours, 14 PRs hit this (185 such patches).
2. Real failures are reported as
cancelled.A job that reaches
timeout-minutesends ascancelled, and GitHub then concludes the whole run ascancelled. Example: https://github.com/goutamadwant/seatunnel/actions/runs/35958838421.transform-v2-it-part-1(JDK 8) andall-connectors-it-7(JDK 8 and 11).Buildcheck showscancelled, which looks as if someone stopped the run.3. Every Build check is re-patched on every tick.
shouldSkipPatchcomparesdetails_urlwith the fork run URL. GitHub keepsdetails_urlof these check runs pointing at the check run itself (e.g.https://github.com/apache/seatunnel/runs/106574782200), so the two never match. Across the 80 runs, the updater sent 10,708 PATCH requests. The skip branch was never taken, and 10,434 of those requests (97%) changed nothing (completed/failure -> completed/failure,in_progress -> in_progress, …).Changes:
check_name: 'Build',filter: 'all'andper_page: 100, reading every page, and the newest one is used. The default filter returns only one check run per name. If fewer check runs are listed thantotal_count, the PR is skipped for that tick.Buildcheck run for the same head SHA. It carries the same{owner, repo, run_id}pointer, and later ticks update it. This also covers a check left inaction_required, which is a completed state too.run_started_at), the updater creates a new, already completedBuildcheck with the attempt's result instead of skipping it as unchanged. The same applies to anaction_requiredcheck created before the run started.started_atset to the attempt'srun_started_atrather than relying on GitHub's default.cancelled, the updater lists its jobs. Thecontinue-on-errorDead linksjob is left out. The result isfailureif any other job failed. Otherwise it istimed_outif a cancelled job has the timeout annotation (at most 10 annotation lookups, longest jobs first). Otherwise it stayscancelled. IfDead linkswas the only cancelled job, the result is what the other jobs concluded. The same refinement applies when the queued-parent path derivescancelledfrom the job list, and that path also leavesDead linksout when it derives the result.action_required) and itscompleted_atis at or after the run'supdated_at, the PR is skipped: nothing is fetched or patched. Completing patches now setcompleted_at, so this holds from the next tick.shouldSkipPatchcompares only status and conclusion.concurrencygroup (update-build-status, no cancel-in-progress) keeps two ticks from running at once.Risk controls:
Buildcheck is completed, it does not cover the current attempt (the fork run is running again, or the check was completed before the attempt started), and it is not a non-action_requiredcheck that started at or after the attempt'srun_started_at. Together with the concurrency group, that means one new check per re-run attempt. After that, the newest check is the active one, so later ticks patch it. If GitHub ignored the givenstarted_at, it would default to the creation time, which is also afterrun_started_at, so the result is the same.cancelled, and only until the Build check holds the final result. After that, the PR costs the same PR and check-run reads as today. Dropping the no-op PATCHes removes about 130 write calls per tick (10,434 over the 80 sampled ticks).cancelledrefinement above. No change to the search window or batching.notify_test_workflow.ymlis untouched.Does this PR introduce any user-facing change?
No. CI status reporting only.
How was this patch tested?
github.request. The mock lists one check run per name unlessfilter: 'all'is passed, and applies PATCHes the way GitHub does (a completed check stays completed). It has 33 scenarios:action_required, a repeat tick on an already-final check of a cancelled run (no job or annotation lookups, no write), a completed check already existing for the current attempt, two consecutive ticks after a re-run starts (exactly one create);started_at(still one check over three ticks);Dead linksfailed: only a timeout otherwise (timed_out), cancelled by a user (cancelled), a real job failed too (failure);started_aton the created check, and a re-run finishing after its check was created;action_requirednext to an older normal one, the queued-parent path with onlyDead linksfailed, anaction_requiredcheck from before the run started when GitHub keeps the oldcompleted_at(one write in total), a missingrun_started_at(falls back to patching), and a newestaction_requiredcheck next to an older in-progress one while the run is in progress (one new check);Buildcheck runs with the newest on page 2 (no new check), a listing shorter thantotal_count(PR skipped), and a run where onlyDead linkswas cancelled (success).dev: 9 of 33 behave as expected. The first revision of this PR: 21 of 33. This branch: 33 of 33.cancelled(neversuccess), and the check-run listing reads at most 10 pages per PR and tick, skipping the PR beyond that.git diff --check.Fork CI on this branch: https://github.com/goutamadwant/seatunnel/actions/runs/36140937054. It was queued when this PR was opened, and only the gate jobs run for this change.
Two check runs with the same name on one commit, checked on my fork: a throwaway workflow created them with
GITHUB_TOKENon its own head commit (run https://github.com/goutamadwant/seatunnel/actions/runs/36252742486; the branch has since been deleted). Both runs landed in the same check suite. The commit's status rollup and the default check-runs listing showed only the newer one in each case:completed/failure, newerin_progress;success.The same probe showed that
started_atandcompleted_atgiven on create are kept, that a PATCH ofcompleted_aton a completed check run is applied, and that a PATCH back toin_progressis ignored.The existing apache cases with two
Buildcheck runs on one head SHA match this: #12372, #12440, #12458 and #12462, created bynotify_test_workflow.yml, for example afterreopened. On #12372 the older one is stillqueuedand does not show up in the rollup.Not verified before merge: this workflow runs only on the schedule of
apache/seatunnel, so a fork run cannot exercise it on real PRs. No ruleset was set up on the fork, so required-check evaluation was not exercised directly. After merge, the updater logs should show:Create Build check run for PR #…once per re-run attempt;Buildcheck for each PR whose fork run was already re-run within the 7-day search window (for example [Test][CDC] Cover checkpoint offsets around fetcher failure #12360), because its check was completed before that attempt started. This is expected;Skip PR #…: … is already final …or… already matches …for unchanged PRs;Patch PRlines per tick.Check list
New License Guide
incompatible-changes.mdto describe the incompatibility caused by this PR.