From 84805b28dd690a8b9b9ec462443b8bb3bf5ed0b0 Mon Sep 17 00:00:00 2001 From: Leonid Borchuk Date: Fri, 20 Nov 2026 11:53:46 +0300 Subject: [PATCH] CI: Do not rerun the build workflows after a merge 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 4730e4c0f35 has the same tree as the pull request head 6c9a5fa2690, 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 --- .github/workflows/README.md | 4 ++-- .github/workflows/build-cloudberry.yml | 10 ++++++++-- .github/workflows/build-dbg-cloudberry.yml | 12 +++++++++--- .github/workflows/build-deb-cloudberry.yml | 12 +++++++++--- 4 files changed, 28 insertions(+), 10 deletions(-) diff --git a/.github/workflows/README.md b/.github/workflows/README.md index a4632b8771c..0444c2a7223 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -32,8 +32,8 @@ This directory contains GitHub Actions workflows for Apache Cloudberry CI/CD. | Workflow | Purpose | Trigger | |----------|---------|---------| -| `build-cloudberry.yml` | Main CI: build, test, create RPMs | Push, PR, Manual | -| `build-dbg-cloudberry.yml` | Debug build with assertions enabled | Push, PR, Manual | +| `build-cloudberry.yml` | Main CI: build, test, create RPMs | Push to REL_2_STABLE, PR, Manual | +| `build-dbg-cloudberry.yml` | Debug build with assertions enabled | Push to REL_2_STABLE, PR, Manual | | `package-convenience-binaries.yml` | Build convenience DEB/RPM packages from an ASF-approved source release | Manual | | `apache-rat-audit.yml` | License header compliance check | Push, PR | | `coverity.yml` | Static code analysis with Coverity | Weekly, Manual | diff --git a/.github/workflows/build-cloudberry.yml b/.github/workflows/build-cloudberry.yml index d41a398b8da..76934d4fbfb 100644 --- a/.github/workflows/build-cloudberry.yml +++ b/.github/workflows/build-cloudberry.yml @@ -75,7 +75,8 @@ # - CPU: Recommended 4+ cores. # # Triggers: -# - Push to `main` or `REL_2_STABLE` branch. +# - Push to `REL_2_STABLE` branch (a push to `main` is a merged pull +# request that was already tested, see the `on:` section). # - Pull requests to `main` or `REL_2_STABLE` branch. # - Manual workflow dispatch. # @@ -103,8 +104,13 @@ name: Apache Cloudberry Build (Rocky Linux) on: + # No push trigger for main. Its branch protection (.asf.yaml) requires + # a pull request to be up to date with main before it is merged, and + # only squash and rebase merges are allowed, so the merged tree is the + # tree this workflow already ran on for the pull request. REL_2_STABLE + # has no such protection, so pushes there are still tested. push: - branches: [main, REL_2_STABLE] + branches: [REL_2_STABLE] pull_request: branches: [main, REL_2_STABLE] types: [opened, synchronize, reopened, edited] diff --git a/.github/workflows/build-dbg-cloudberry.yml b/.github/workflows/build-dbg-cloudberry.yml index 61347b38305..e3c3fa76648 100644 --- a/.github/workflows/build-dbg-cloudberry.yml +++ b/.github/workflows/build-dbg-cloudberry.yml @@ -74,8 +74,9 @@ # - CPU: Recommended 4+ cores. # # Triggers: -# - Push to `main` branch. -# - Pull requests to `main` branch. +# - Push to `REL_2_STABLE` branch (a push to `main` is a merged pull +# request that was already tested, see the `on:` section). +# - Pull requests to `main` or `REL_2_STABLE` branch. # - Manual workflow dispatch. # # Container Images: @@ -101,8 +102,13 @@ name: Apache Cloudberry Build Debug on: + # No push trigger for main. Its branch protection (.asf.yaml) requires + # a pull request to be up to date with main before it is merged, and + # only squash and rebase merges are allowed, so the merged tree is the + # tree this workflow already ran on for the pull request. REL_2_STABLE + # has no such protection, so pushes there are still tested. push: - branches: [main, REL_2_STABLE] + branches: [REL_2_STABLE] pull_request: branches: [main, REL_2_STABLE] types: [opened, synchronize, reopened, edited] diff --git a/.github/workflows/build-deb-cloudberry.yml b/.github/workflows/build-deb-cloudberry.yml index bae145779db..9ee5ee48eae 100644 --- a/.github/workflows/build-deb-cloudberry.yml +++ b/.github/workflows/build-deb-cloudberry.yml @@ -51,8 +51,9 @@ # - CPU: Recommended 4+ cores. # # Triggers: -# - Push to `main` branch. -# - Pull requests to `main` branch. +# - Push to `REL_2_STABLE` branch (a push to `main` is a merged pull +# request that was already tested, see the `on:` section). +# - Pull requests to `main` or `REL_2_STABLE` branch. # - Manual workflow dispatch. # # Container Images: @@ -73,8 +74,13 @@ name: Apache Cloudberry Debian Build on: + # No push trigger for main. Its branch protection (.asf.yaml) requires + # a pull request to be up to date with main before it is merged, and + # only squash and rebase merges are allowed, so the merged tree is the + # tree this workflow already ran on for the pull request. REL_2_STABLE + # has no such protection, so pushes there are still tested. push: - branches: [main, REL_2_STABLE] + branches: [REL_2_STABLE] pull_request: branches: [main, REL_2_STABLE] types: [opened, synchronize, reopened, edited]