Skip to content

CI: cancel superseded PR runs and stop rerunning on PR edits - #2352

Merged
tuhaihe merged 3 commits into
apache:mainfrom
tuhaihe:ci-cancel-superseded-pr-runs
Nov 25, 2026
Merged

tuhaihe merged 3 commits into
apache:mainfrom
tuhaihe:ci-cancel-superseded-pr-runs

Conversation

@tuhaihe

@tuhaihe tuhaihe commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

A new push to a PR now cancels the run still going for the old head, instead of letting it finish while the new run waits. This applies to build, build-dbg, behave and build-deb; build-deb had no concurrency group before and gets one. Pushes to main and REL_2_STABLE and manual runs are not cancelled.

Editing a PR's title or description no longer starts the whole test matrix again: drop the "edited" trigger from build, build-dbg, build-deb and sqlancer. It was added so that a CI skip flag put into the PR text later would take effect, but such a skip leaves the required checks unreported and the PR unmergeable.

Changing only a PR's base branch no longer reruns CI; push again or close and reopen the PR.

Fixes #ISSUE_Number

What does this PR do?

Type of Change

  • Bug fix (non-breaking change)
  • New feature (non-breaking change)
  • Breaking change (fix or feature with breaking changes)
  • Documentation update

Breaking Changes

Test Plan

  • Unit tests added/updated
  • Integration tests added/updated
  • Passed make installcheck
  • Passed make -C src/test installcheck-cbdb-parallel

Impact

Performance:

User-facing changes:

Dependencies:

Checklist

Additional Context

CI Skip Instructions


@tuhaihe

tuhaihe commented Nov 18, 2026

Copy link
Copy Markdown
Member Author

This change can also help us save runner quota. Otherwise, we’ll use more of it and have to wait longer to run the tests.

@leborchuk leborchuk left a comment

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.

LGTM, it's really annoying issue, we have an old still running checks after force-push. Last day I killed them manually to free resources but better do it automatically.

@tuhaihe
tuhaihe force-pushed the ci-cancel-superseded-pr-runs branch 2 times, most recently from 93f559c to 1455bc2 Compare November 20, 2026 08:28
@tuhaihe
tuhaihe requested a review from Alena0704 November 20, 2026 08:31
@tuhaihe
tuhaihe enabled auto-merge (squash) November 20, 2026 08:35
@tuhaihe tuhaihe mentioned this pull request Nov 24, 2026
4 of 13 tasks
@tuhaihe

tuhaihe commented Nov 24, 2026

Copy link
Copy Markdown
Member Author

Hi @Alena0704 Can you help to approve this PR? Let's merge it soon to save more CI resources.

@Alena0704 Alena0704 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@tuhaihe

tuhaihe commented Nov 24, 2026

Copy link
Copy Markdown
Member Author

Priority this PR merge queue for saving more resources. FYI

@tuhaihe
tuhaihe force-pushed the ci-cancel-superseded-pr-runs branch from 1455bc2 to 22772e6 Compare November 24, 2026 10:15
@tuhaihe
tuhaihe force-pushed the ci-cancel-superseded-pr-runs branch 2 times, most recently from 76436c8 to 078885b Compare November 24, 2026 23:13
@tuhaihe
tuhaihe disabled auto-merge November 24, 2026 23:20

@MisterRaindrop MisterRaindrop left a comment

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 change looks right to me. Dropping edited is now required, not just nice to have. With cancel-in-progress on for PRs, a title or description edit would start a new run in the same group, and that run would cancel the one testing the code.

One thing to fix before merging: this PR has no real CI result yet. The description contains the literal [skip ci] ("It was added so that a "[skip ci]" put into the PR text later…"). check-skip scans the PR title and body. So on every head so far, including the current 078885bc418, the workflows logged CI Skip flag detected in PR - skipping all checks. and skipped prepare-test-matrix / prepare-test-matrix-deb. #2412 removes check-skip altogether; if it lands first, a rebase of this PR runs the full matrix. Otherwise, remove the text from the description and push again. This PR's own workflows no longer react to edited, so the edit alone does not start a run.

The three red DEB Install Test jobs come from the same skip. In build-deb-cloudberry.yml, the download step has if: needs.check-skip.outputs.should_skip != 'true', but Verify DEB artifacts has no condition, so it runs and fails on the missing .deb. That part is already on main and not caused by this PR, and #2412 removes it with the rest of the skip path.

Nit: the description says pushes to main are not cancelled. Since 0ba1b11, pushes to main no longer trigger the Rocky, Debug and Debian builds at all, and only Behave still runs there. It may be worth updating that sentence before the squash.

@tuhaihe

tuhaihe commented Nov 25, 2026

Copy link
Copy Markdown
Member Author

One thing to fix before merging: this PR has no real CI result yet. The description contains the literal [skip ci] ("It was added so that a "[skip ci]" put into the PR text later…"). check-skip scans the PR title and body. So on every head so far, including the current 078885bc418, the workflows logged CI Skip flag detected in PR - skipping all checks. and skipped prepare-test-matrix / prepare-test-matrix-deb. #2412 removes check-skip altogether; if it lands first, a rebase of this PR runs the full matrix. Otherwise, remove the text from the description and push again. This PR's own workflows no longer react to edited, so the edit alone does not start a run.

The three red DEB Install Test jobs come from the same skip. In build-deb-cloudberry.yml, the download step has if: needs.check-skip.outputs.should_skip != 'true', but Verify DEB artifacts has no condition, so it runs and fails on the missing .deb. That part is already on main and not caused by this PR, and #2412 removes it with the rest of the skip path.

Nit: the description says pushes to main are not cancelled. Since 0ba1b11, pushes to main no longer trigger the Rocky, Debug and Debian builds at all, and only Behave still runs there. It may be worth updating that sentence before the squash.

yes, the skip ci makes these tests skipped. I will update the description. Thanks!

tuhaihe and others added 3 commits November 25, 2026 10:06
A new push to a PR now cancels the run still going for the old head,
instead of letting it finish while the new run waits.  This applies
to build, build-dbg, behave and build-deb; build-deb had no
concurrency group before and gets one.  Pushes to main and
REL_2_STABLE and manual runs are not cancelled.

Editing a PR's title or description no longer starts the whole test
matrix again: drop the "edited" trigger from build, build-dbg,
build-deb and sqlancer.  It was added so that a "[skip ci]" put into
the PR text later would take effect, but such a skip leaves the
required checks unreported and the PR unmergeable.

Changing only a PR's base branch no longer reruns CI; push again or
close and reopen the PR.
Co-authored-by: Alena Rybakina <58230554+Alena0704@users.noreply.github.com>
Apply the group that build-deb now uses to build, build-dbg and
behave too.  PR runs still share one group per PR and cancel
superseded runs.  Pushes to main and REL_2_STABLE and manual runs
each get a group of their own, so a later run no longer drops a
pending one from the queue.
@tuhaihe
tuhaihe force-pushed the ci-cancel-superseded-pr-runs branch from 078885b to 8495ff4 Compare November 25, 2026 02:06
@tuhaihe
tuhaihe enabled auto-merge (squash) November 25, 2026 02:09
@tuhaihe
tuhaihe merged commit 7b2c7ef into apache:main Nov 25, 2026
164 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants