Skip to content

Add hourly workflow to revert PRs merged with broken CI - #97623

Merged
murphy-4o merged 10 commits into
masterfrom
revert-broken-prs-workflow
Mar 25, 2026
Merged

murphy-4o merged 10 commits into
masterfrom
revert-broken-prs-workflow

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Feb 22, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Adds a new scheduled GitHub Actions workflow (.github/workflows/revert_broken_prs.yml) that runs hourly
  • Scans merge commits on master from the last 24 hours for failing CI checks
  • Automatically creates revert PRs for merges where both the merge commit and the original PR's head commit have failures
  • Includes safety measures: max 3 reverts per run, deduplication via existing revert PR search, skips revert PRs to avoid loops, skips on merge conflicts

Test plan

  • Trigger manually via workflow_dispatch and check the logs
  • Verify it correctly identifies commits with red checks
  • Verify it skips commits where PR checks were green (flaky failures)
  • Verify it finds and skips existing revert PRs
  • Verify revert PRs are created with correct title, body, and base branch

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

Version info

  • Merged into: 26.4.1.242

This creates a new scheduled GitHub Actions workflow that runs hourly,
identifies PRs merged to master with failing CI checks in the last 24
hours, and automatically creates revert PRs.

The workflow checks both the merge commit and the original PR's head
commit to distinguish genuine failures from flaky tests. It includes
safety limits (max 3 reverts per run), deduplication (skips if a revert
PR already exists), and skips revert PRs to avoid loops.

### 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):
...

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Feb 22, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [16ddffc]

Summary: ✅


AI Review

Summary

This PR adds .github/workflows/revert_broken_prs.yml to auto-create revert PRs for recently merged commits with consistently failing CI. Per review policy, workflow-only changes under /.github/workflows/* are out of scope for code findings; after checking PR metadata and existing bot inline comments, I found no actionable issues requiring inline comments.

ClickHouse Rules

Item Status Notes
Deletion logging ➖
Serialization versioning ➖
Core-area scrutiny ➖
No test removal ✅
Experimental gate ➖
No magic constants ➖
Backward compatibility ➖
SettingsChangesHistory.cpp ➖
PR metadata quality ✅
Safe rollout ➖
Compilation time ➖

Final Verdict

  • Status: ✅ Approve

alexey-milovidov and others added 9 commits February 22, 2026 16:48
Allow this check to be broken in master without triggering automatic reverts.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
The filters for `Performance Comparison`, `Mergeable Check`, and `PR`
were not working correctly:

1. `Performance Comparison` check-run names include batch suffixes like
   `Performance Comparison (arm_release, release_base, 4/6)`, so exact
   string comparison never matched. Use `startswith` instead.

2. Meta-checks `Mergeable Check` and `PR` are status checks that fail
   derivatively when other checks fail. They should not count as evidence
   of a real test failure. Exclude them from both merge commit and PR
   head filters.

Without this fix, PRs whose only merge-commit failures are Performance
Comparison runs would be wrongly reverted.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
…nly checks

These checks don't run on PRs, so their failures on merge commits
cannot indicate that a PR broke something.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@murphy-4o
murphy-4o added this pull request to the merge queue Mar 25, 2026
Merged via the queue into master with commit 11f4d7d Mar 25, 2026
148 checks passed
@murphy-4o
murphy-4o deleted the revert-broken-prs-workflow branch March 25, 2026 04:02
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-synced-to-cloud The PR is synced to the cloud repo label Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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