Repository navigation
Revert "Revert "CI: run the full test suite only when review threads are resolved"" - #130509
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
|
Workflow [PR], commit [de9c1b2] Summary: ✅ AI ReviewSummaryRestores the review-thread CI gate, preserves restrictive label filtering, defers bug-fix validation during limited runs, and stabilizes job digests against host-memory differences. The three previous findings are addressed. One new operational issue remains: failures while establishing the gate expand testing to the full pipeline. Findings
Missing context / blind spots
Final VerdictStatus: |
|
Some people suspected, that resolving a single thread on GitHub reruns the CI. It shouldn't rerun it, instead, it should continue the checks that were previously blocked, if they are now unlocked. Let's make sure it works this way. But I can't fully trust this evidence, so please take care... |
|
@alexey-milovidov Should we add #130491 to this PR? It should fix issues with forks not picking up the re-review correctly |
`BINARY_DOCKER_COMMAND`, `LIMITED_MEM`, `KEEPER_DIND_MEM` and the `CI_DIND_*` budgets put byte counts derived from `Utils.physical_memory` into `run_in_docker`, and the job config (including `run_in_docker`) is hashed into the job digest. The digest is computed in "Config Workflow", whose runner has a slightly different amount of memory from run to run, so every build and most tests got a new digest - a cache miss - even on a rerun of the same commit. Checked by computing the digests of the `PR` workflow with the physical memory differing by 4 MB: 102 of 178 jobs changed before, none after. Example: run 42383050264 (PR #126334), attempt 2 rebuilt all ~30 builds that had succeeded in attempt 1 for the same merge commit, because their digests changed (e.g. `Build (amd_debug)`: `...-a08a` -> `...-3ed4`). Mask byte counts (10+ digits) in `run_in_docker` before hashing. The job still applies the limits computed on its own runner. Related: #130509 (comment) Co-Authored-By: Claude Opus 5.5 <[email protected]>
The jobs of a run are fetched with `--paginate`, so a `PR` run (more than
100 jobs) gives several JSON documents. The `finish_window` filter ran
per document and printed an empty window for the page without
"Finish Workflow", so the window bounds started with a newline and the
`created_at <= $to` comparison never matched the
"Failed: review threads only" marker. Every run held by the
unresolved-review-threads gate was then retried as an infrastructure
failure ("job-level heuristic") - a whole rerun that changes nothing,
because the threads are still unresolved.
Example: run 42383050264 (PR #126334, 7 unresolved threads) was rerun by
the 2026-11-07 16:46 tick although its marker was posted inside the
"Finish Workflow" window. Slurp the pages before selecting the job.
Related: #130509 (comment)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Yes, let's add. |
|
I checked what resolving a thread does. Resolving a thread does not rerun CI. 1. Gated runs were retried as infrastructure failures (fixed in 01ea835)
Example: https://github.com/ClickHouse/ClickHouse/actions/runs/42383050264 (#126334, 7 unresolved threads) was re-run at 2026-11-07 16:46 by the retry tick, although its marker (16:14:51) was inside the 2. A rerun of the same commit misses the cache for builds and most tests (fixed in e682f70, older than this PR, affects all CI caching) The rerun path relies on cached jobs being skipped, but that did not happen. I computed the digests of the Impact while the gate was live (2026-11-07 to 2026-11-10) I looked at all 185 PR-workflow reruns triggered by
Remaining issues, not fixed here
CI status at 01ea835: green. |
With unresolved review threads, `should_skip_job` returned "run" for every allowlisted build and preliminary job before the label rules, so a label that restricts the pipeline was ignored: with `do not test` and a change to `src/Interpreters/Context.cpp`, one unresolved thread grew the run from 1 job to 30 (29 builds), `ci-performance` from 14 to 30, and `no-fast-tests`, `ci-llvm-coverage` and `ci-build` got back the jobs they skip. Let the allowlisted jobs go on to the same decisions as in a full run, so a limited run is the intersection of the allowlist and the full run. This replaces the per-rule exceptions (coverage, `ci-llvm-coverage`, small PRs), and the `notes` parameter of `_coverage_family_decision` they needed. Checked with a throwaway script over all `PR` workflow jobs and eight label sets: before, the limited run had jobs the full run skips; after, none, and nothing outside the allowlist. Related: #130509 (comment)
`commits/<sha>/pulls` returns nothing for a commit that lives in a fork, and
`workflow_run.pull_requests` is empty for fork PRs. So a completed `PR` run of
a fork PR was never reconciled ("No PR associated with the event"), and only
the scheduled poll could re-run the skipped jobs. The same lookup made
`retry_infra_failures.yml` skip fork PRs, and made the shared-head-commit
checks (`shared_sha_prs`, `other_open_prs_on_head`) blind to fork PRs.
Resolve the PR of a run by its head branch instead, and find the other PRs
with a given head commit with a search by the commit as well.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 1e22b7a)
The unresolved-review-threads gate skips the per-arch Bugfix Validation jobs, so for a bug-fix PR with a functional or integration regression test `new_tests_check.check` found no `OK`/`XFAIL` result and failed. Then `Mergeable Check` said `Failed: Workflow Post Hook` instead of `Failed: review threads only`, and `retry_infra_failures.yml` retried the run, which is exactly the pointless rerun the gate exclusion is for. When `KV_PIPELINE_LIMITED` is set, defer this verdict to the full run. The gate keeps the merge blocked until then. The other checks (no new tests at all, the unit validator refuting the test) are unchanged. Related: #130509 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t-114729-ci-gate-on-unresolved-review-threads # Conflicts: # ci/jobs/scripts/workflow_hooks/filter_job.py
| except Exception as e: | ||
| # Fail toward more testing: without the thread state the full suite | ||
| # runs as before. The merge gate in can_be_merged.py re-checks at | ||
| # finish time and fails close there. | ||
| print( | ||
| f"WARNING: failed to fetch the review threads state [{e}] - the full CI suite will run" | ||
| ) | ||
| return |
There was a problem hiding this comment.
[Major] Fail configuration when the gate state cannot be established
Returning successfully here leaves KV_UNRESOLVED_COUNT unset, which should_skip_job interprets as zero. A thread-query failure therefore enables the full pipeline despite unresolved blocking threads. The same expansion happens at lines 275–280 when the marker write fails, even though the hook has already confirmed that blocking threads exist. In a throwaway probe with a change to src/Interpreters/Context.cpp and one blocking thread, either failure made the filter admit 117 jobs instead of 30, including integration, stateless and performance jobs.
This turns a GitHub API failure into an expensive CI run, defeating the gate's resource-saving purpose; failing closed at finish time cannot recover those resources. After the existing API retries are exhausted, propagate the thread-query exception and fail the config hook on a marker-write failure, so a retry can establish the gate before scheduling the test suite.
There was a problem hiding this comment.
It's not a problem. We expect that AI models can be unavailable, and in case of any error, we run the full test suite.
Reverts #130368
Workflow [PR]
Sync PR [sync-upstream/pr/130509]
Version info
26.11.1.2141-master(included in26.11and later)