Skip to content

CI: Do not rerun the build workflows after a merge - #2384

Open
leborchuk wants to merge 1 commit into
apache:mainfrom
leborchuk:ci-skip-main-push-rerun
Open

leborchuk wants to merge 1 commit into
apache:mainfrom
leborchuk:ci-skip-main-push-rerun

Conversation

@leborchuk

Copy link
Copy Markdown
Contributor

The Rocky, Debug and Debian build workflows ran on every push to main, so each merged pull request was built and tested a second time. That second run tests nothing new: the main branch protection in .asf.yaml uses strict status checks, so a pull request must be up to date with main before it is merged, and only squash and rebase merges are allowed. The tree that lands on main is therefore the tree the pull request runs were made on. For example, PR #1942 was rebased onto the then-current main, and its merged head 4730e4c has the same tree as the pull request head 6c9a5fa, yet all of these workflows ran on it again for up to almost four hours.

Such reruns only add load on the runners and delay the queue, and a flaky test in them turns main red although the change was already green.

Drop main from the push trigger of these three workflows. Keep it for REL_2_STABLE, which has no required status checks, so pushes there are still tested. Leave the other workflows alone: Behave only runs on pull requests touching management code, so its push run is the only one for other changes, SQLancer fuzzes with random input, and the Rat check is cheap.

One could see the issue in https://github.com/apache/cloudberry/actions?query=is%3Ain_progress page. After merge here we run tests once again. Just spend CPU in a vain )

The Rocky, Debug and Debian build workflows ran on every push to main,
so each merged pull request was built and tested a second time.  That
second run tests nothing new: the main branch protection in .asf.yaml
uses strict status checks, so a pull request must be up to date with
main before it is merged, and only squash and rebase merges are
allowed.  The tree that lands on main is therefore the tree the pull
request runs were made on.  For example, PR apache#1942 was rebased onto the
then-current main, and its merged head 4730e4c has the same tree
as the pull request head 6c9a5fa, yet all of these workflows ran
on it again for up to almost four hours.

Such reruns only add load on the runners and delay the queue, and a
flaky test in them turns main red although the change was already
green.

Drop main from the push trigger of these three workflows.  Keep it for
REL_2_STABLE, which has no required status checks, so pushes there are
still tested.  Leave the other workflows alone: Behave only runs on
pull requests touching management code, so its push run is the only
one for other changes, SQLancer fuzzes with random input, and the Rat
check is cheap.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 20, 2026 15:17

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

There are no active review issues with the CI workflow trigger changes.

No open issues 🎉

What changed in this PR

This PR reduces duplicate CI work by stopping the Rocky Linux, Debug, and Debian build workflows from running again after merges to main.

Changes:

  • Remove main from the three workflows’ push triggers while retaining pushes to REL_2_STABLE, pull requests to both branches, and manual runs.
  • Update workflow comments and README trigger documentation to reflect the change and explain the branch-protection rationale.
File Description
.github/​workflows/​README.md Clarifies push triggers for the main and debug builds.
.github/​workflows/​build-deb-cloudberry.yml Removes Debian builds on pushes to main and updates trigger comments.
.github/​workflows/​build-dbg-cloudberry.yml Removes debug builds on pushes to main and updates trigger comments.
.github/​workflows/​build-cloudberry.yml Removes Rocky Linux builds on pushes to main and updates trigger comments.

Review effort: Balanced

@tuhaihe

tuhaihe commented Nov 21, 2026

Copy link
Copy Markdown
Member

https://infra.apache.org/github-actions-policy.html

  • The average number of minutes a project uses per calendar week MUST NOT exceed the equivalent of 25 full-time runners (250,000 minutes, or 4,200 hours).
  • The average number of minutes a project uses in any consecutive five-day period MUST NOT exceed the equivalent of 30 full-time runners (216,000 minutes, or 3,600 hours).

Last week we used 520,300 minutes (https://github.com/apache/cloudberry/actions/metrics/usage?dateRangeType=DATE_RANGE_TYPE_CURRENT_WEEK), double our quota.

This is mainly because adding more tests to the test matrix is a strong quality gate but also increases runner minutes. Previously, I didn’t want to cancel the push running in main after merging; since we are exceeding our runner quota, I now agree with canceling it.

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.

3 participants