Skip to content

CI: run the full test suite only when review threads are resolved - #114729

Merged
alexey-milovidov merged 87 commits into
masterfrom
ci-gate-on-unresolved-review-threads
Nov 6, 2026
Merged

alexey-milovidov merged 87 commits into
masterfrom
ci-gate-on-unresolved-review-threads

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Aug 13, 2026 •

Copy link
Copy Markdown
Member

Closes: #114724

This change limits the PR CI pipeline to builds and preliminary checks while review threads are unresolved, and records the gate in Review Threads and Mergeable Check statuses. The gate re-evaluates at workflow completion and after changes to the ignore-unresolved-threads label. GitHub Actions has no supported review-thread event, so thread changes after a completed workflow require a manual CI re-run; the documentation states that limitation.

A failed pre-hook marker write leaves filtering disabled, so the full suite runs. The final review-thread marker preserves whether a limited pipeline needs replay even when another post-hook fails.

Only blocking threads count: a thread whose first comment starts with a non-blocking severity tag ([Major], [Minor], [Nit], [P2], [P3], Nit:) does not hold the gate.

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Workflow [PR]
Sync PR [sync-upstream/pr/114729]

Version info

  • Merged into: 26.11.1.1576-master (included in 26.11 and later)

While a PR has unresolved review threads, run only builds and the
preliminary checks (`Style check`, `Fast test`, `Code Review`), and
turn the `Mergeable Check` red via the `can_be_merged.py` post-hook.
The per-run verdict is recorded in a new `Review Threads` commit status.

When the threads get resolved (or the new `ignore-unresolved-threads`
label is added), `rerun_on_review_threads.yml` re-runs the last
completed `PR` workflow run for the head commit: previously succeeded
jobs are restored from the CI cache, so only the previously skipped jobs
actually run. Review-thread events on PRs from forks carry a read-only
token, so they are relayed through the trivial `Review Threads Signal`
workflow and handled on its `workflow_run` completion in the trusted
default-branch context. The `Code Review` job keeps running in the
limited pipeline so the AI review can resolve its own addressed threads,
which re-triggers the full suite automatically.

Issue: #114724

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@mintlify

mintlify Bot commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
ClickHouse-docs 🟢 Ready View Preview Nov 6, 2026, 11:31 AM

@clickhouse-gh

clickhouse-gh Bot commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [12aceda]

Summary: ✅


AI Review

Summary

PR #114729 limits CI while blocking review threads remain unresolved and preserves the distinction between skipped testing, review-policy failures, and infrastructure failures. Reviewed the current diff at 12aceda93759e7aa9e0e08817246b5f380ae84ed and all 65 existing threads, including every reply. No new actionable findings in the reviewed code. Eight focused local checks passed for severity handling, finish-time verdicts, live labels, API/status failures, policy markers, and build filtering.

Missing context / blind spots
  • ⚠️ The review skill explicitly excludes .github/workflows/*. Scheduled polling, rerun orchestration, and infrastructure-retry YAML were therefore outside this review; a separate workflow review and a live scheduled cycle would validate those paths.
Final Verdict

✅ Approve for the reviewed Python and documentation changes. No new inline comments or thread changes are needed.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Aug 13, 2026
@clickhouse-gh

clickhouse-gh Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing 40109c6fb with master 38b927aca (stripped binary size, per-symbol sizes and ThinLTO time; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes
Binary Master PR Δ
programs/clickhouse-stripped 710.11 MiB 707.05 MiB -3.06 MiB (-0.43%)

Only the stripped binary is compared: the official master build keeps debug symbols while PR builds strip them, so the other binaries differ by construction.

Compile time of recompiled translation units

6 translation units recompiled, 4 s compile time in total, 6 of them have a recent master baseline.

Job report

Address review feedback on the ci-force-all bypass, limited build allowlist, reconciliation, and infra retries.\n\nPR: #114729
Comment thread ci/praktika/native_jobs.py Resolved
A thread is informational when its first comment starts with a non-blocking
severity tag (`[Major]`, `[Minor]`, `[Nit]`, `[P2]`, `[P3]`, `Nit:`); such
threads no longer hold the full test suite or the merge. The same predicate
is used by every consumer: the config pre-hook, `can_be_merged.py` (both via
`get_unresolved_review_threads_count`) and `rerun_on_review_threads.yml`.
The AI review is asked to tag its inline findings with `[Blocker]` or
`[Major]`, so that its majors do not block.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 @alexey-milovidov, about your two points (833ed57, also merged master):

  • Only blockers have to be resolved: done. A thread is informational when its first comment starts with [Major], [Minor], [Nit], [P2], [P3] or Nit:. Such threads no longer limit the pipeline, block Mergeable Check or prevent a re-run. Every other unresolved thread still blocks, including human comments, untagged comments and [Blocker] findings. The AI review is now asked to tag its inline findings with [Blocker] or [Major]. Its older untagged threads still count as blocking.

  • CI continues as soon as they are resolved: only partly. The full suite resumes automatically (only the skipped jobs run, the rest come from the CI cache) in two cases:

    • the blockers are resolved while a PR run is in flight (the workflow_run completion triggers rerun_on_review_threads.yml);
    • the ignore-unresolved-threads label is added.

    If the last blocker is resolved after the run has finished, nothing re-triggers CI. GitHub Actions has no review-thread event, so someone has to re-run CI by hand. To make this fully automatic, rerun_on_review_threads.yml would need a schedule trigger that polls open PRs whose Review Threads status is red, or an external webhook. Tell me if you want the polling and I will add it.

@alexey-milovidov

Copy link
Copy Markdown
Member Author

If the last blocker is resolved after the run has finished, nothing re-triggers CI. GitHub Actions has no review-thread event, so someone has to re-run CI by hand. To make this fully automatic, rerun_on_review_threads.yml would need a schedule trigger that polls open PRs whose Review Threads status is red, or an external webhook. Tell me if you want the polling and I will add it.

Yes, this is a usability problem.

One option is to add this scheduled run.
Another option, maybe better: - the review will add a label if blocked ("blocked review"), and the author will have to remove this label; we subscribe to label changes.

alexey-milovidov and others added 2 commits October 24, 2026 23:45
…r the run

GitHub Actions has no review-thread event, so resolving the last blocking
thread after a limited `PR` run had finished left the PR blocked until
someone re-ran CI by hand. Add a scheduled `poll` job to
`rerun_on_review_threads.yml`: every ten minutes it lists open PRs whose
`Review Threads` marker (written for the PR itself) is failing on the head
commit, counts their unresolved blocking threads, and for the ones with none
left dispatches this workflow through `workflow_dispatch` with the PR number
and head commit. The `reconcile` job then decides between a status refresh
and a re-run, as for the other events, and the dispatch keys the concurrency
group on the head commit, so it is serialized with label events and `PR`
workflow completions for the same head.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 Re: re-triggering CI when the last blocker is resolved after the run (b06df9c, also merged master): I went with the scheduled poll rather than a "blocked review" label. The label would add a second source of truth that the author has to keep in sync with the threads by hand, and the threads alone already decide the gate.

  • rerun_on_review_threads.yml now has a poll job that runs every ten minutes. It lists open PRs whose Review Threads marker on the head commit is failing and was written for that PR. Fetching this costs about one cheap GraphQL page per 100 open PRs. For each of those PRs it counts the unresolved blocking threads, and when none are left it dispatches the workflow (workflow_dispatch with the PR number and head SHA).
  • The dispatched run goes through the existing reconcile logic, which handles the in-progress run check, shared heads, the attempt cap, and the choice between a status refresh and a re-run. Its concurrency group is keyed on the head SHA, so it is serialized with label events and PR workflow completions for the same head.
  • The CI docs now say that resolving the last blocking thread is picked up automatically within about ten minutes.

I checked the GraphQL candidate query and the jq filter against the live repository and against synthetic data. The scheduled path itself only runs once this is on master.

Resolve the conflict in `filter_job.py`: keep the small-PR rules factored out
into `_small_pr_skip_decision` and place master's Iceberg performance skip
in `should_skip_job` right before the small-PR decision, as on master.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@alexey-milovidov alexey-milovidov left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Now it looks good.

@alexey-milovidov alexey-milovidov self-assigned this Nov 6, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Nov 6, 2026
Merged via the queue into master with commit 5447112 Nov 6, 2026
187 checks passed
@alexey-milovidov
alexey-milovidov deleted the ci-gate-on-unresolved-review-threads branch November 6, 2026 23:52
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 6, 2026

This branch was successfully deployed

1 active deployment
staging - docs — 12aceda9 Deployed Nov 6, 2026 by mintlify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). pr-ci pr-synced-to-cloud The PR is synced to the cloud repo submodule changed At least one submodule changed in this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Optimization for CI: run the full test suite only when review threads are resolved.

4 participants