From 02d0592be1c9666cb850a97540d1689ab675c2a6 Mon Sep 17 00:00:00 2001 From: Michael Welles Date: Thu, 6 Aug 2026 10:44:49 -0400 Subject: [PATCH 1/2] ci: run tests and linters on pull requests to any base branch ci-dgraph4j-tests.yml and trunk.yml both filtered their pull_request trigger to base branch main, so a pull request targeting a feature branch ran neither the test suite nor the linters. Only CodeQL ran, because it comes from GitHub default setup rather than a workflow in this repo. That combination is worse than no checks. GitHub reports such a pull request mergeable and CLEAN, because checks that are absent cannot fail, so it reads as validated while nothing has validated it. The gap matters for stacked pull requests, where every entry above the bottom targets the branch below it. GitHub stack merge lands a stack atomically, which is its main draw and which merges those upper entries without the suite ever running on them. A problem would surface only in the post-merge push run against main, after the fact. Drop the branch filter from pull_request in both workflows rather than listing branch prefixes. A pull request deserves the same checks wherever it is aimed, and an allowlist would need editing for every new naming convention. push stays limited to main, so no feature-branch push triggers a build on its own. --- .github/workflows/ci-dgraph4j-tests.yml | 2 -- .github/workflows/trunk.yml | 1 - 2 files changed, 3 deletions(-) diff --git a/.github/workflows/ci-dgraph4j-tests.yml b/.github/workflows/ci-dgraph4j-tests.yml index b67fa3f..5f6642e 100644 --- a/.github/workflows/ci-dgraph4j-tests.yml +++ b/.github/workflows/ci-dgraph4j-tests.yml @@ -10,8 +10,6 @@ on: - reopened - synchronize - ready_for_review - branches: - - main schedule: - cron: 0 0 * * * diff --git a/.github/workflows/trunk.yml b/.github/workflows/trunk.yml index d57563b..fe62794 100644 --- a/.github/workflows/trunk.yml +++ b/.github/workflows/trunk.yml @@ -1,7 +1,6 @@ name: Trunk Code Quality on: pull_request: - branches: main permissions: contents: read From 2991f09c10b65e553dc48c0c4062e564b8e947bc Mon Sep 17 00:00:00 2001 From: Michael Welles Date: Thu, 6 Aug 2026 10:45:53 -0400 Subject: [PATCH 2/2] ci: cancel superseded pull request runs Widening the pull_request trigger means the Dgraph-from-source build now runs on stacked pull requests too, and a chain of N runs it N times. Every push to a branch under review also starts a fresh run while the previous one is still going. Cancel the in-flight run when a pull request is pushed again. The group key uses head_ref for pull requests and falls back to ref elsewhere, and cancel-in-progress is gated on the event being a pull_request, so a main-branch push or the nightly schedule is never cancelled -- those are the runs whose results are worth keeping even when superseded. --- .github/workflows/ci-dgraph4j-tests.yml | 6 ++++++ .github/workflows/trunk.yml | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/.github/workflows/ci-dgraph4j-tests.yml b/.github/workflows/ci-dgraph4j-tests.yml index 5f6642e..387919b 100644 --- a/.github/workflows/ci-dgraph4j-tests.yml +++ b/.github/workflows/ci-dgraph4j-tests.yml @@ -13,6 +13,12 @@ on: schedule: - cron: 0 0 * * * +# Supersede an in-flight run when a pull request is pushed again. Never cancels a +# main-branch or scheduled run. +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + permissions: contents: read diff --git a/.github/workflows/trunk.yml b/.github/workflows/trunk.yml index fe62794..158cfd5 100644 --- a/.github/workflows/trunk.yml +++ b/.github/workflows/trunk.yml @@ -2,6 +2,10 @@ name: Trunk Code Quality on: pull_request: +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + permissions: contents: read actions: write