Skip to content

CI: give revert pull requests a green light at once - #120767

Merged
alexey-milovidov merged 1 commit into
masterfrom
ci-revert-pr-fast-path
Sep 18, 2026
Merged

alexey-milovidov merged 1 commit into
masterfrom
ci-revert-pr-fast-path

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Sep 18, 2026 •

Copy link
Copy Markdown
Member

A revert restores a state of master that CI has already validated, while the state it replaces is broken, so every minute spent on the revert's own checks is a minute master stays broken. With this change the should_skip_job filter hook skips every job of a revert pull request, which makes the Ready For Merge status green immediately, so the revert can be merged as quickly as possible. The ci-force-all label opts out and runs the whole workflow.

The green light explains itself: the Ready For Merge status description says Skipped: revert PR, CI is bypassed unless labeled 'ci-force-all', the same reason is shown for every skipped job on the report page, and a note on the report page explains it in full. This goes through a small new channel in praktika, Info.set_ready_for_merge_description, which lets a Config Workflow hook set the description of a green Ready For Merge status (a red status keeps describing the failed jobs).

A pull request counts as a revert by its canonical shape only: the title Revert "..." or the anchored Reverts ClickHouse/ClickHouse#<n> line in the body, which is what git revert, the GitHub "Revert" button and the Revert CI regressions job produce. A prose mention of a revert does not count. Pushes to master and release branches are not affected (the hook requires a pull request number), so the revert commit is tested there as usual, and the merge queue still runs its own checks.

Documented in the Continuous Integration page under "Revert pull requests".

Changelog category (leave one):

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

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

...

🤖 Generated with Claude Code


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

A revert restores a state of `master` that CI has already validated, while
the state it replaces is broken, so every minute spent on the revert's own
checks is a minute `master` stays broken. The `should_skip_job` filter hook
now skips every job of a revert pull request, which makes the `Ready For
Merge` status green immediately. The `ci-force-all` label opts out and runs
the whole workflow.

A pull request counts as a revert by its canonical shape only - the title
`Revert "..."` or the anchored `Reverts <owner>/<repo>#<n>` line in the body,
which is what `git revert`, the GitHub "Revert" button and the `Revert CI
regressions` job produce. Pushes to `master` and release branches are not
affected: the revert commit is tested there as usual, and the merge queue
still runs its own checks.

The green status explains itself: a new `Info.set_ready_for_merge_description`
channel (a `JOB_KV_DATA` key) lets a Config Workflow hook set the description
of the `Ready For Merge` commit status for a green workflow, and the hook uses
it together with a workflow note on the report page.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@mintlify

mintlify Bot commented Sep 18, 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 Sep 18, 2026, 10:06 AM

@clickhouse-gh

clickhouse-gh Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [5e39fd3]

Summary: ✅


AI Review

Summary

This PR teaches the PR workflow to treat revert-shaped pull requests as fully skippable, threads a custom green Ready For Merge description through Praktika, and documents the behavior. The status-plumbing itself looks coherent, but the revert detector is too trusting: it accepts author-controlled title/body text as proof that the change is a safe revert, which turns the optimization into a CI-bypass path for arbitrary pull requests.

Findings

❌ Blockers

  • [ci/jobs/scripts/workflow_hooks/filter_job.py:166-174] The contract here is "only real reverts of already-validated code may bypass PR CI", but is_revert_pr accepts any Revert "..." title or Reverts <repo>#<n> body line without verifying that the named PR exists, was merged, or that this patch actually reverts it. In practice that means an unrelated PR can add Reverts ClickHouse/ClickHouse#99999999 to its body, pass pr_body_check.py as Not for changelog, and then skip the entire PR matrix while getting a green Ready For Merge. The same gap also covers conflicted/manual reverts that no longer restore a previously tested tree. Suggested fix: gate the fast path on verifiable evidence from GitHub/history (for example by reusing the verified-claim logic from revert_ci_regressions.py, and not treating a bare title as sufficient for the skip path).
Final Verdict

Status: ❌ Block

Minimum required action: make the revert fast path depend on verifiable evidence that the PR is actually reverting an already-merged change, rather than on title/body markers alone.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Sep 18, 2026
@clickhouse-gh
clickhouse-gh Bot requested review from leshikus and maxknv September 18, 2026 09:37
`Revert "..."` title, or the anchored `Reverts <repo>#<n>` marker line in
the body. See `_REVERT_TITLE_RE` for why only the canonical shapes count.
"""
if _REVERT_TITLE_RE.fullmatch((title or "").strip()):

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.

The invariant for this fast path is "only an actual revert of already-validated code may bypass PR CI". is_revert_pr does not establish that: any contributor can make an unrelated PR look like a revert just by adding a canonical marker such as Reverts ClickHouse/ClickHouse#99999999 (or a matching title). pr_body_check.py already treats that marker as Not for changelog, so this path would skip the whole PR matrix and still make Ready For Merge green even though nothing real was reverted.

Please gate this on verifiable evidence from GitHub/history instead of title/body text alone. At minimum the claimed PR should be checked to exist and be merged before this one; for the CI-bypass path I would also avoid accepting a bare Revert "..." title with no corroborating claim.

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.

Not a problem. We can tolerate that.

@clickhouse-gh clickhouse-gh Bot added the comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). label Sep 18, 2026

@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.

LGTM

@alexey-milovidov alexey-milovidov self-assigned this Sep 18, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Sep 18, 2026
Merged via the queue into master with commit b98cd0f Sep 18, 2026
177 checks passed
@alexey-milovidov
alexey-milovidov deleted the ci-revert-pr-fast-path branch September 18, 2026 11:00
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Sep 18, 2026
@maxknv

maxknv commented Sep 18, 2026

Copy link
Copy Markdown
Member

It skips all jobs for revert-revert :)

@maxknv

maxknv commented Sep 18, 2026

Copy link
Copy Markdown
Member

Style check must not be skipped. It initiates CH Inc Sync on success and also validates the settings history for consistency, which might be broken by a revert.

clickhouse-gh Bot pushed a commit that referenced this pull request Sep 19, 2026
Edited by the nightly changelog CI job following .claude/skills/edit-changelog/SKILL.md.

Changelog-revert: 120763 120477 Revert "Remove stale entries from `parallel_replicas_blacklist.txt`"
Changelog-revert: 120801 120767 Revert "CI: give revert pull requests a green light at once"
Changelog-revert: 120930 118612 Revert "Do not allocate from peer-declared sizes when reading settings from the Native protocol"
Changelog-deleted-entry: 118612 [Bug Fix (user-visible misbehavior in an official stable release)] [raw] * Reading settings from the Native protocol no longer sizes a string from the length a peer declares before the payload arrives, so a Query packet or a server hello can no longer turn a few bytes on the wire into a large memory allocation. This covers `BaseSettings::read`, `BaseSettings::readBinary` and `readQueryParameters`, on the server and in the client. [#118612](#118612) ([Groene AI](https://github.com/groeneai)).
Changelog-deleted-entry: 120767 [NOT FOR CHANGELOG / INSIGNIFICANT] [raw] * CI: give revert pull requests a green light at once. [#120767](#120767) ([Alexey Milovidov](https://github.com/alexey-milovidov)).

This branch was successfully deployed

1 active deployment
staging - docs — 5e39fd3e Deployed Sep 18, 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants