Currently running build is not stopped by new commit/s for the same PR #222
Replies: 3 comments 1 reply
-
This was never a feature of Jenkins or Bitbucket plugin at any point. You can workaround it by using this code in your Jenkinsfile:
It requires concurrent builds to be allowed. |
Beta Was this translation helpful? Give feedback.
-
More flexible solution. It iterates via all queued jobs and all running jobs and will abort all jobs, which were triggered by BPPR plugin for same branch. To use it just add at the top of Jenkinsfile before pipeline block:
Suppose this script could be simplified with jenkins milestones after jenkinsci/pipeline-milestone-step-plugin#17 would be merged and released. |
Beta Was this translation helpful? Give feedback.
-
use |
Beta Was this translation helpful? Give feedback.
-
Expected Behavior
While an existing build is in progress for the project, triggered by this plugin because of a PR update (new commit) or PR create events, if I submit another commit and bitbucket sends an PR update event, the ongoing build should be cancelled/stopped and a new one should start that will pick the new revision.
Actual Behavior
Current build it is not stopped, it keeps on going; the new build for the new commit is not triggered even though "Execute concurrent builds if necessary" is checked, I understand this is not a setting that belongs to this plugin... however it makes sense to work.
Steps to Reproduce
Provide an unambiguous set of steps to reproduce this bug
Context
This is affecting resource consumption, time consumption, and it can mislead cause it finishing the old build and not builds the second. thus leaving with impression build is successful on the last commit.
Bitbucket payload
usual update PR event. it is quite long,I can provide it if really needed it.
Jenkins Job configuration
we access bitbucket through stored credentials in jenkins
building branch
origin/feature/*
but it is reproing with simpler filters likeorigin/development
Beta Was this translation helpful? Give feedback.
All reactions