bitbucket-push-and-pull-request-plugin
bitbucket-push-and-pull-request-plugin copied to clipboard
PR Merge and Push causes double-build of branch
Hi,
I've got BBPaPRP installed and running and I ran into an interesting issue that I think is a bug. I've got the plugin set up to build on a PR Create, Update, or Merge (for any branch) and I also have it set up to build on a Push to branch master. I also have the webhook set up to trigger on a Repository Push and a PR Create/Update/Merge. This looked like it was working, but I noticed today that when I merged a PR back into master it built the branch twice.
Not surprisingly, the webhook was called twice, however even though I have the "Bitbucket Cloud Push" trigger configured with none of the checkboxes checked (i.e., "Trigger also if nothing has changed in the repo" is NOT checked), it built the branch with no changes! Strangely, the log claims "SCM changes detected in Test-Repo" however when looking at the build itself, it says "No Changes". The log is below.
Am I doing something wrong? Do I have something misconfigured? Or is this actually a bug?
PS: There is an off-by-one bug. The log says it is triggering build 16, but it's really build 15 (when looking at the build history for the project).
Nov 15, 2021 8:42:06 AM INFO io.jenkins.plugins.bitbucketpushandpullrequest.receiver.BitBucketPPRHookReceiver doIndex
Received POST request over Bitbucket hook
Nov 15, 2021 8:42:06 AM FINEST io.jenkins.plugins.bitbucketpushandpullrequest.receiver.BitBucketPPRHookReceiver
the payload is: {}
Nov 15, 2021 8:42:06 AM INFO io.jenkins.plugins.bitbucketpushandpullrequest.processor.BitBucketPPRPayloadProcessorFactory createProcessor
Create BitBucketPPRRepositoryCloudPayloadProcessor
Nov 15, 2021 8:42:06 AM FINE io.jenkins.plugins.bitbucketpushandpullrequest.observer.BitBucketPPRObserverFactory
Add BitBucketPPRPushCloudObserver for {}
Nov 15, 2021 8:42:06 AM INFO io.jenkins.plugins.bitbucketpushandpullrequest.processor.BitBucketPPRRepositoryCloudPayloadProcessor buildActionForJobs
Instantiate BitBucketPPRRepositoryAction
Nov 15, 2021 8:42:06 AM INFO io.jenkins.plugins.bitbucketpushandpullrequest.action.BitBucketPPRRepositoryAction
Received commit hook notification for branch: master
Nov 15, 2021 8:42:06 AM INFO io.jenkins.plugins.bitbucketpushandpullrequest.action.BitBucketPPRRepositoryAction
Received commit hook type: branch
Nov 15, 2021 8:42:06 AM WARNING io.jenkins.plugins.bitbucketpushandpullrequest.BitBucketPPRJobProbe lambda$triggerMatchingJobs$1
Trigger not set
Nov 15, 2021 8:42:06 AM WARNING io.jenkins.plugins.bitbucketpushandpullrequest.BitBucketPPRJobProbe lambda$triggerMatchingJobs$1
Trigger not set
Nov 15, 2021 8:42:06 AM FINEST io.jenkins.plugins.bitbucketpushandpullrequest.BitBucketPPRTrigger
Called onPost Method for action BitBucketPPRRepositoryAction
Nov 15, 2021 8:42:06 AM INFO io.jenkins.plugins.bitbucketpushandpullrequest.filter.repository.BitBucketPPRRepositoryTriggerMatcher matchesAction
BitBucketPPREvent [bitbucketEventKey = repo:push, event = repo, action = push]
Nov 15, 2021 8:42:06 AM FINE io.jenkins.plugins.bitbucketpushandpullrequest.filter.repository.BitBucketPPRRepositoryTriggerMatcher
1. (Is the trigger filter instance of BitBucketPPRRepositoryPushActionFilter? <<true>> AND does it equal BitBucketPPRConsts.REPOSITORY_PUSH push to bitbucketEvent.getAction() push? <<true>>) OR 2. (Is the trigger filter instance of BitBucketPPRServerRepositoryPushActionFilter? <<false>>AND does it equal BitBucketPPRConsts.REPOSITORY_SERVER_PUSH refs_changed to bitbucketEvent.getAction() push? <<false>>
Nov 15, 2021 8:42:06 AM FINE io.jenkins.plugins.bitbucketpushandpullrequest.BitBucketPPRPollingRunnable
Run method called.
Nov 15, 2021 8:42:06 AM INFO io.jenkins.plugins.bitbucketpushandpullrequest.receiver.BitBucketPPRHookReceiver doIndex
Received POST request over Bitbucket hook
Nov 15, 2021 8:42:06 AM FINEST io.jenkins.plugins.bitbucketpushandpullrequest.receiver.BitBucketPPRHookReceiver
the payload is: {}
Nov 15, 2021 8:42:06 AM INFO io.jenkins.plugins.bitbucketpushandpullrequest.processor.BitBucketPPRPayloadProcessorFactory createProcessor
Create BitBucketPPRRepositoryCloudPayloadProcessor
Nov 15, 2021 8:42:06 AM FINE io.jenkins.plugins.bitbucketpushandpullrequest.observer.BitBucketPPRObserverFactory
Add BitBucketPPRPushCloudObserver for {}
Nov 15, 2021 8:42:06 AM INFO io.jenkins.plugins.bitbucketpushandpullrequest.processor.BitBucketPPRRepositoryCloudPayloadProcessor buildActionForJobs
Instantiate BitBucketPPRRepositoryAction
Nov 15, 2021 8:42:06 AM INFO io.jenkins.plugins.bitbucketpushandpullrequest.action.BitBucketPPRRepositoryAction
Received commit hook notification for branch: null
Nov 15, 2021 8:42:06 AM INFO io.jenkins.plugins.bitbucketpushandpullrequest.action.BitBucketPPRRepositoryAction
Received commit hook type: null
Nov 15, 2021 8:42:06 AM WARNING io.jenkins.plugins.bitbucketpushandpullrequest.BitBucketPPRJobProbe lambda$triggerMatchingJobs$1
Trigger not set
Nov 15, 2021 8:42:06 AM WARNING io.jenkins.plugins.bitbucketpushandpullrequest.BitBucketPPRJobProbe lambda$triggerMatchingJobs$1
Trigger not set
Nov 15, 2021 8:42:06 AM FINEST io.jenkins.plugins.bitbucketpushandpullrequest.BitBucketPPRTrigger
Called onPost Method for action BitBucketPPRRepositoryAction
Nov 15, 2021 8:42:06 AM INFO io.jenkins.plugins.bitbucketpushandpullrequest.filter.repository.BitBucketPPRRepositoryTriggerMatcher matchesAction
BitBucketPPREvent [bitbucketEventKey = repo:push, event = repo, action = push]
Nov 15, 2021 8:42:06 AM FINE io.jenkins.plugins.bitbucketpushandpullrequest.filter.repository.BitBucketPPRRepositoryTriggerMatcher
1. (Is the trigger filter instance of BitBucketPPRRepositoryPushActionFilter? <<true>> AND does it equal BitBucketPPRConsts.REPOSITORY_PUSH push to bitbucketEvent.getAction() push? <<true>>) OR 2. (Is the trigger filter instance of BitBucketPPRServerRepositoryPushActionFilter? <<false>>AND does it equal BitBucketPPRConsts.REPOSITORY_SERVER_PUSH refs_changed to bitbucketEvent.getAction() push? <<false>>
Nov 15, 2021 8:42:06 AM FINE io.jenkins.plugins.bitbucketpushandpullrequest.BitBucketPPRPollingRunnable
Run method called.
Nov 15, 2021 8:42:07 AM INFO io.jenkins.plugins.bitbucketpushandpullrequest.receiver.BitBucketPPRHookReceiver doIndex
Received POST request over Bitbucket hook
Nov 15, 2021 8:42:07 AM FINEST io.jenkins.plugins.bitbucketpushandpullrequest.receiver.BitBucketPPRHookReceiver
the payload is: {}
Nov 15, 2021 8:42:07 AM INFO io.jenkins.plugins.bitbucketpushandpullrequest.processor.BitBucketPPRPayloadProcessorFactory createProcessor
Create BitBucketPPRPullRequestCloudPayloadProcessor
Nov 15, 2021 8:42:07 AM FINE io.jenkins.plugins.bitbucketpushandpullrequest.observer.BitBucketPPRObserverFactory
Add BitBucketPPRPullRequestCloudObserver for {}
Nov 15, 2021 8:42:07 AM WARNING io.jenkins.plugins.bitbucketpushandpullrequest.BitBucketPPRJobProbe lambda$triggerMatchingJobs$1
Trigger not set
Nov 15, 2021 8:42:07 AM WARNING io.jenkins.plugins.bitbucketpushandpullrequest.BitBucketPPRJobProbe lambda$triggerMatchingJobs$1
Trigger not set
Nov 15, 2021 8:42:07 AM FINEST io.jenkins.plugins.bitbucketpushandpullrequest.BitBucketPPRTrigger
Called onPost Method for action BitBucketPPRPullRequestAction
Nov 15, 2021 8:42:07 AM FINE io.jenkins.plugins.bitbucketpushandpullrequest.BitBucketPPRPollingRunnable
Run method called.
Nov 15, 2021 8:42:09 AM INFO io.jenkins.plugins.bitbucketpushandpullrequest.filter.repository.BitBucketPPRRepositoryPushActionFilter shouldTriggerBuild
Should trigger build for the bitbucket action: BitBucketPPRRepositoryAction?
Nov 15, 2021 8:42:09 AM FINE io.jenkins.plugins.bitbucketpushandpullrequest.common.BitBucketPPRUtils
Following allowed branches patterns are set: master
Nov 15, 2021 8:42:09 AM FINE io.jenkins.plugins.bitbucketpushandpullrequest.common.BitBucketPPRUtils
The branchName in action is: master
Nov 15, 2021 8:42:09 AM FINE io.jenkins.plugins.bitbucketpushandpullrequest.common.BitBucketPPRUtils
The environment variables are: null
Nov 15, 2021 8:42:09 AM INFO io.jenkins.plugins.bitbucketpushandpullrequest.common.BitBucketPPRUtils lambda$matches$2
Matched branch: master
Nov 15, 2021 8:42:09 AM FINEST io.jenkins.plugins.bitbucketpushandpullrequest.BitBucketPPRTrigger
Should schedule job: true and (polling result has changes: true or trigger also if there aren't changes: false)
Nov 15, 2021 8:42:09 AM INFO io.jenkins.plugins.bitbucketpushandpullrequest.filter.repository.BitBucketPPRRepositoryPushActionFilter shouldTriggerBuild
Should trigger build for the bitbucket action: BitBucketPPRRepositoryAction?
Nov 15, 2021 8:42:09 AM FINE io.jenkins.plugins.bitbucketpushandpullrequest.common.BitBucketPPRUtils
Following allowed branches patterns are set: master
Nov 15, 2021 8:42:09 AM FINE io.jenkins.plugins.bitbucketpushandpullrequest.common.BitBucketPPRUtils
The branchName in action is: master
Nov 15, 2021 8:42:09 AM FINE io.jenkins.plugins.bitbucketpushandpullrequest.common.BitBucketPPRUtils
The environment variables are: null
Nov 15, 2021 8:42:09 AM INFO io.jenkins.plugins.bitbucketpushandpullrequest.common.BitBucketPPRUtils lambda$matches$2
Matched branch: master
Nov 15, 2021 8:42:10 AM FINE io.jenkins.plugins.bitbucketpushandpullrequest.common.BitBucketPPRUtils
Following allowed branches patterns are set:
Nov 15, 2021 8:42:10 AM FINE io.jenkins.plugins.bitbucketpushandpullrequest.common.BitBucketPPRUtils
The branchName in action is: master
Nov 15, 2021 8:42:10 AM FINE io.jenkins.plugins.bitbucketpushandpullrequest.common.BitBucketPPRUtils
The environment variables are: null
Nov 15, 2021 8:42:10 AM INFO io.jenkins.plugins.bitbucketpushandpullrequest.common.BitBucketPPRUtils lambda$matches$2
Matched branch:
Nov 15, 2021 8:42:10 AM FINEST io.jenkins.plugins.bitbucketpushandpullrequest.BitBucketPPRTrigger
Should schedule job: true and (polling result has changes: true or trigger also if there aren't changes: true)
Nov 15, 2021 8:42:10 AM FINE io.jenkins.plugins.bitbucketpushandpullrequest.common.BitBucketPPRUtils
Following allowed branches patterns are set:
Nov 15, 2021 8:42:10 AM FINE io.jenkins.plugins.bitbucketpushandpullrequest.common.BitBucketPPRUtils
The branchName in action is: master
Nov 15, 2021 8:42:10 AM FINE io.jenkins.plugins.bitbucketpushandpullrequest.common.BitBucketPPRUtils
The environment variables are: null
Nov 15, 2021 8:42:10 AM INFO io.jenkins.plugins.bitbucketpushandpullrequest.common.BitBucketPPRUtils lambda$matches$2
Matched branch:
Nov 15, 2021 8:42:11 AM INFO io.jenkins.plugins.bitbucketpushandpullrequest.filter.repository.BitBucketPPRRepositoryPushActionFilter shouldTriggerBuild
Should trigger build for the bitbucket action: BitBucketPPRRepositoryAction?
Nov 15, 2021 8:42:11 AM WARNING io.jenkins.plugins.bitbucketpushandpullrequest.BitBucketPPRTrigger$1 lambda$onPollSuccess$0
During the polling process an exception was thrown: null.
Nov 15, 2021 8:42:11 AM SEVERE io.jenkins.plugins.bitbucketpushandpullrequest.common.BitBucketPPRUtils$1 print
java.lang.NullPointerException
Nov 15, 2021 8:42:11 AM SEVERE io.jenkins.plugins.bitbucketpushandpullrequest.common.BitBucketPPRUtils$1 print
at io.jenkins.plugins.bitbucketpushandpullrequest.filter.repository.BitBucketPPRRepositoryPushActionFilter.shouldTriggerBuild(BitBucketPPRRepositoryPushActionFilter.java:72)
Nov 15, 2021 8:42:11 AM SEVERE io.jenkins.plugins.bitbucketpushandpullrequest.common.BitBucketPPRUtils$1 print
at io.jenkins.plugins.bitbucketpushandpullrequest.filter.repository.BitBucketPPRRepositoryTriggerFilter.shouldScheduleJob(BitBucketPPRRepositoryTriggerFilter.java:50)
Nov 15, 2021 8:42:11 AM SEVERE io.jenkins.plugins.bitbucketpushandpullrequest.common.BitBucketPPRUtils$1 print
at io.jenkins.plugins.bitbucketpushandpullrequest.BitBucketPPRTrigger.shouldScheduleJob(BitBucketPPRTrigger.java:158)
Nov 15, 2021 8:42:11 AM SEVERE io.jenkins.plugins.bitbucketpushandpullrequest.common.BitBucketPPRUtils$1 print
at io.jenkins.plugins.bitbucketpushandpullrequest.BitBucketPPRTrigger.access$100(BitBucketPPRTrigger.java:73)
Nov 15, 2021 8:42:11 AM SEVERE io.jenkins.plugins.bitbucketpushandpullrequest.common.BitBucketPPRUtils$1 print
at io.jenkins.plugins.bitbucketpushandpullrequest.BitBucketPPRTrigger$1.lambda$onPollSuccess$0(BitBucketPPRTrigger.java:122)
Nov 15, 2021 8:42:11 AM SEVERE io.jenkins.plugins.bitbucketpushandpullrequest.common.BitBucketPPRUtils$1 print
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1384)
Nov 15, 2021 8:42:11 AM SEVERE io.jenkins.plugins.bitbucketpushandpullrequest.common.BitBucketPPRUtils$1 print
at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:647)
Nov 15, 2021 8:42:11 AM SEVERE io.jenkins.plugins.bitbucketpushandpullrequest.common.BitBucketPPRUtils$1 print
at io.jenkins.plugins.bitbucketpushandpullrequest.BitBucketPPRTrigger$1.onPollSuccess(BitBucketPPRTrigger.java:118)
Nov 15, 2021 8:42:11 AM SEVERE io.jenkins.plugins.bitbucketpushandpullrequest.common.BitBucketPPRUtils$1 print
at io.jenkins.plugins.bitbucketpushandpullrequest.BitBucketPPRPollingRunnable.run(BitBucketPPRPollingRunnable.java:65)
Nov 15, 2021 8:42:11 AM SEVERE io.jenkins.plugins.bitbucketpushandpullrequest.common.BitBucketPPRUtils$1 print
at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:121)
Nov 15, 2021 8:42:11 AM SEVERE io.jenkins.plugins.bitbucketpushandpullrequest.common.BitBucketPPRUtils$1 print
at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
Nov 15, 2021 8:42:11 AM SEVERE io.jenkins.plugins.bitbucketpushandpullrequest.common.BitBucketPPRUtils$1 print
at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68)
Nov 15, 2021 8:42:11 AM SEVERE io.jenkins.plugins.bitbucketpushandpullrequest.common.BitBucketPPRUtils$1 print
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
Nov 15, 2021 8:42:11 AM SEVERE io.jenkins.plugins.bitbucketpushandpullrequest.common.BitBucketPPRUtils$1 print
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
Nov 15, 2021 8:42:11 AM SEVERE io.jenkins.plugins.bitbucketpushandpullrequest.common.BitBucketPPRUtils$1 print
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
Nov 15, 2021 8:42:11 AM SEVERE io.jenkins.plugins.bitbucketpushandpullrequest.common.BitBucketPPRUtils$1 print
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
Nov 15, 2021 8:42:11 AM SEVERE io.jenkins.plugins.bitbucketpushandpullrequest.common.BitBucketPPRUtils$1 print
at java.lang.Thread.run(Thread.java:748)
Nov 15, 2021 8:42:18 AM INFO io.jenkins.plugins.bitbucketpushandpullrequest.BitBucketPPRTrigger scheduleJob
SCM changes detected in Test-Repo. Triggering # 16
Nov 15, 2021 8:42:18 AM INFO io.jenkins.plugins.bitbucketpushandpullrequest.observer.BitBucketPPRObservable notifyObservers
Event: BitBucketPPRBuildStarted [context=BitBucketPPREventContext [action=BitBucketPPRRepositoryAction, credentialsId=1bc4d338-adf7-48e8-bedf-90ef3c15709f, filter=io.jenkins.plugins.bitbucketpushandpullrequest.filter.repository.BitBucketPPRRepositoryTriggerFilter@40a1d231, run=null, scmTrigger=hudson.plugins.git.GitSCM@743c1440, [email protected]:myorg/test-repo.git, userRemoteConfig=null => [email protected]:myorg/test-repo.git (null)], handler=null] for observer io.jenkins.plugins.bitbucketpushandpullrequest.observer.BitBucketPPRPushCloudObserver@2733e1f9
Nov 15, 2021 8:42:18 AM WARNING io.jenkins.plugins.bitbucketpushandpullrequest.observer.BitBucketPPRPushCloudObserver setBuildStatusInProgress
Tried to set BB Build Status on 'in progress' using backprogation but This authentication method is not supported by the BB Cloud Rest API.
Nov 15, 2021 8:42:20 AM INFO io.jenkins.plugins.bitbucketpushandpullrequest.observer.BitBucketPPRObservable notifyObservers
Event: BitBucketPPRBuildFinished [context=BitBucketPPREventContext [action=BitBucketPPRRepositoryAction, credentialsId=1bc4d338-adf7-48e8-bedf-90ef3c15709f, filter=io.jenkins.plugins.bitbucketpushandpullrequest.filter.repository.BitBucketPPRRepositoryTriggerFilter@40a1d231, run=Test-Repo #15, scmTrigger=hudson.plugins.git.GitSCM@743c1440, [email protected]:myorg/test-repo.git, userRemoteConfig=null => [email protected]:myorg/test-repo.git (null)], handler=null] for observer io.jenkins.plugins.bitbucketpushandpullrequest.observer.BitBucketPPRPushCloudObserver@2733e1f9
Nov 15, 2021 8:42:20 AM WARNING io.jenkins.plugins.bitbucketpushandpullrequest.observer.BitBucketPPRPushCloudObserver setBuildStatusOnFinished
Tried to set BB Build Status on 'finished' using backprogation but This authentication method is not supported by the BB Cloud Rest API.
Nov 15, 2021 8:42:20 AM INFO io.jenkins.plugins.bitbucketpushandpullrequest.BitBucketPPRTrigger scheduleJob
SCM changes detected in Test-Repo. Triggering # 17
Nov 15, 2021 8:42:20 AM INFO io.jenkins.plugins.bitbucketpushandpullrequest.observer.BitBucketPPRObservable notifyObservers
Event: BitBucketPPRBuildStarted [context=BitBucketPPREventContext [action=BitBucketPPRPullRequestAction, credentialsId=1bc4d338-adf7-48e8-bedf-90ef3c15709f, filter=BitBucketPPRPullRequestTriggerFilter [actionFilter=BitBucketPPRPullRequestMergedActionFilter [getDescriptor()=io.jenkins.plugins.bitbucketpushandpullrequest.filter.pullrequest.cloud.BitBucketPPRPullRequestMergedActionFilter$ActionFilterDescriptorImpl@26283649, getClass()=class io.jenkins.plugins.bitbucketpushandpullrequest.filter.pullrequest.cloud.BitBucketPPRPullRequestMergedActionFilter, hashCode()=1692650365, toString()=io.jenkins.plugins.bitbucketpushandpullrequest.filter.pullrequest.cloud.BitBucketPPRPullRequestMergedActionFilter@64e3cb7d]], run=null, scmTrigger=hudson.plugins.git.GitSCM@743c1440, [email protected]:myorg/test-repo.git, userRemoteConfig=null => [email protected]:myorg/test-repo.git (null)], handler=null] for observer io.jenkins.plugins.bitbucketpushandpullrequest.observer.BitBucketPPRPullRequestCloudObserver@59baf9f0
Nov 15, 2021 8:42:20 AM WARNING io.jenkins.plugins.bitbucketpushandpullrequest.observer.BitBucketPPRPullRequestCloudObserver callClient2
This authentication method is not supported by the BB Cloud Rest API.
Nov 15, 2021 8:42:20 AM INFO io.jenkins.plugins.bitbucketpushandpullrequest.observer.BitBucketPPRObservable notifyObservers
Event: BitBucketPPRBuildFinished [context=BitBucketPPREventContext [action=BitBucketPPRPullRequestAction, credentialsId=1bc4d338-adf7-48e8-bedf-90ef3c15709f, filter=BitBucketPPRPullRequestTriggerFilter [actionFilter=BitBucketPPRPullRequestMergedActionFilter [getDescriptor()=io.jenkins.plugins.bitbucketpushandpullrequest.filter.pullrequest.cloud.BitBucketPPRPullRequestMergedActionFilter$ActionFilterDescriptorImpl@26283649, getClass()=class io.jenkins.plugins.bitbucketpushandpullrequest.filter.pullrequest.cloud.BitBucketPPRPullRequestMergedActionFilter, hashCode()=1692650365, toString()=io.jenkins.plugins.bitbucketpushandpullrequest.filter.pullrequest.cloud.BitBucketPPRPullRequestMergedActionFilter@64e3cb7d]], run=Test-Repo #16, scmTrigger=hudson.plugins.git.GitSCM@743c1440, [email protected]:myorg/test-repo.git, userRemoteConfig=null => [email protected]:myorg/test-repo.git (null)], handler=null] for observer io.jenkins.plugins.bitbucketpushandpullrequest.observer.BitBucketPPRPullRequestCloudObserver@59baf9f0
Nov 15, 2021 8:42:20 AM WARNING io.jenkins.plugins.bitbucketpushandpullrequest.observer.BitBucketPPRPullRequestCloudObserver callClient
This authentication method is not supported by the BB Cloud Rest API.
This could be related to #200, when merging, a branch s deleted and this might be causing the second build to be triggered.
@juanmacoo --
This could be related to #200, when merging, a branch s deleted and this might be causing the second build to be triggered.
Nope. I just tested that case and it didn't make a difference. The steps I took:
- Create Branch in the Repo
- Push a change to Branch -- nothing happens yet
- Create PR -- PR branch gets built
- Merge PR without deleting branch -- master branch gets built twice.
So alas, this has nothing to do with #200 -- instead, I think the issue here is a race condition, where it is testing whether the SCM changed before the previous build is processed (and updates the SCM). I think this because while the logs say "SCM changed" and it queues the build, by the time the queued build happens, Jenkins knows there were no changes (because the second build reports no changes). In other words the "test if SCM has changed" isn't actually testing that properly because (I think) the two build requests are being queued too close together.
Similar issue i am also facing ...
Similar issue here, too!
Same issue here too
Hi @derekatkins. Thank you for reporting. This is actually something wanted, since when doing each of these builds you might have different versions of the code. Imagine you have a pull request with some changes but you haven't merged the changes in master back to the branch. Now, the first build (The PR one) will use the code of your branch while the second build (the push one) will used the merged code.
@julioc-p -- I'm afraid I don't follow. I mean, yes, I understand that a "merge" and a "push" /can/ be different things (e.g. if I push a commit directly into main branch). However, when I'm merging a PR into main, I do NOT expect it to build the resulting code twice from the same commit.
@derekatkins I get your point! We will fix that and introduce a new feature to specify for each pull request event if the source or target branch is wanted
Note: Right now what happens is that the pull request event uses the last commit of the branch from where the pull request is made and the push event uses the merge commit id. So, actually two different commits are being built, but as you said, with the same code!
Thanks. IMHO I think it is self evident that the target branch is what should get built in pretty much every instance. I'm having trouble thinking about when one would not want this to be the case. Regardless, the real issue in my mind is to not build the same commit twice :)