ci: trigger GitLab pipeline only for branches with open PR - #1861
Merged
Conversation
gytsto
requested review from
Jauler,
LukasPukenis,
asledzinskiy,
jjanowsk,
mathiaspeters,
matislovas,
olekoliinyk and
tomaszklak
as code owners
July 2, 2026 10:46
gytsto
commented
Jul 2, 2026
gytsto
force-pushed
the
ci-gate-gitlab-trigger-on-open-pr
branch
from
July 2, 2026 11:17
8821bef to
6660da6
Compare
Contributor
|
+1 |
Every branch push runs the full codehub pipeline (builds + 9 natlab shards) even with no PR open, taking runner slots from reviewed work. Open a (draft) PR to get CI on a branch; main and release/** still trigger unconditionally.
Picks up the fix cancelling outdated queued (pending/created) pipelines, not only running ones.
gytsto
force-pushed
the
ci-gate-gitlab-trigger-on-open-pr
branch
from
July 7, 2026 06:57
6660da6 to
6aba42c
Compare
Contributor
|
+1.0 |
olekoliinyk
approved these changes
Jul 7, 2026
gytsto
enabled auto-merge
July 7, 2026 09:24
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Jul 7, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Jul 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Every branch push triggers the full internal GitLab pipeline (all builds + 9 parallel natlab shards) even when the branch has no PR — WIP pushes consume constrained natlab runner slots and queue reviewed work for hours.
Solution
Gate the
push-event trigger on an open PR for the branch (check-branch-has-prjob,gh api pulls?head=).main,release/**, merge-queue andlabeledevents trigger unconditionally. To get CI on a WIP branch, open a draft PR.☑️ Definition of Done checklist