[JIRA] (JENKINS-40456) First time builds are not reporting to Bitbucket

26 views
Skip to first unread message

ethan@skuid.com (JIRA)

unread,
Dec 14, 2016, 4:11:01 PM12/14/16
to jenkinsc...@googlegroups.com
Ethan Rogers created an issue
 
Jenkins / Bug JENKINS-40456
First time builds are not reporting to Bitbucket
Issue Type: Bug Bug
Assignee: Antonio Mansilla
Components: bitbucket-build-status-notifier-plugin
Created: 2016/Dec/14 9:10 PM
Priority: Minor Minor
Reporter: Ethan Rogers

I'm using this plugin with a Multibranch Pipeline for reporting the status of a build to Bitbucket. The issue I'm seeing is that the first time a branch is built, the status is not being sent. I can see in the log that it does call the plugin, but the log that says that posting the status succeeded does not show up. Each time a build is run after the first run works as expected.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

antonio.mansilla@flagbit.de (JIRA)

unread,
Jan 11, 2017, 12:10:01 PM1/11/17
to jenkinsc...@googlegroups.com
Antonio Mansilla commented on Bug JENKINS-40456
 
Re: First time builds are not reporting to Bitbucket

Could you please add what is logged in case of error as you described and which version of the plugin are you using, so I'll be able to reproduce easily the error.

Thanks and best regards

antonio.mansilla@flagbit.de (JIRA)

unread,
Jan 11, 2017, 12:11:01 PM1/11/17
to jenkinsc...@googlegroups.com
Antonio Mansilla started work on Bug JENKINS-40456
 
Change By: Antonio Mansilla
Status: Open In Progress

feather.rw@gmail.com (JIRA)

unread,
Feb 14, 2017, 10:53:01 AM2/14/17
to jenkinsc...@googlegroups.com
Ryan Feather updated an issue
 
Change By: Ryan Feather
Attachment: screenshot-1.png

feather.rw@gmail.com (JIRA)

unread,
Feb 14, 2017, 10:55:02 AM2/14/17
to jenkinsc...@googlegroups.com
Ryan Feather updated an issue
Change By: Ryan Feather
Attachment: screenshot-2.png

feather.rw@gmail.com (JIRA)

unread,
Feb 14, 2017, 10:55:02 AM2/14/17
to jenkinsc...@googlegroups.com
Ryan Feather commented on Bug JENKINS-40456
 
Re: First time builds are not reporting to Bitbucket

Same issue here. Using mutlibranch and calling bitbucketstatusnotify within the pipeline.

First build

Second build

feather.rw@gmail.com (JIRA)

unread,
Feb 14, 2017, 10:57:01 AM2/14/17
to jenkinsc...@googlegroups.com
Ryan Feather edited a comment on Bug JENKINS-40456
Same issue here. Using mutlibranch and calling bitbucketstatusnotify within the pipeline. Plugin version 1.3.1, jenkins version 2.39. It seems to be failing silently as far as I can tell.

First build
!screenshot-1.png|thumbnail!

Second build
!screenshot-2.png|thumbnail!

antonio.mansilla@flagbit.de (JIRA)

unread,
Feb 15, 2017, 8:43:02 AM2/15/17
to jenkinsc...@googlegroups.com

Hi Ethan Rogers, that a weird behaviour, since I'm as well using multibranch pipeline jobs and the build status is being reported to Bitbucket properly. Can you please post here the part relative to this plugin of your current Jenkinsfile, so I can find better the problem?

I'll close this issue since I guess the problem is a misconfiguration o error on the Jenkinsfile and will reopen in case the error is still persisting.

antonio.mansilla@flagbit.de (JIRA)

unread,
Feb 15, 2017, 8:43:02 AM2/15/17
to jenkinsc...@googlegroups.com
Antonio Mansilla stopped work on Bug JENKINS-40456
 
Change By: Antonio Mansilla
Status: In Progress Open

antonio.mansilla@flagbit.de (JIRA)

unread,
Feb 15, 2017, 8:44:02 AM2/15/17
to jenkinsc...@googlegroups.com
Antonio Mansilla closed an issue as Cannot Reproduce
 
Change By: Antonio Mansilla
Status: Open Closed
Resolution: Cannot Reproduce

pszczekutowicz@gmail.com (JIRA)

unread,
Feb 24, 2017, 3:39:02 PM2/24/17
to jenkinsc...@googlegroups.com
Paweł Szczekutowicz commented on Bug JENKINS-40456
 
Re: First time builds are not reporting to Bitbucket

Hi Antonio Mansilla

I have same issue. I'm using multibranch pipeline projects with latest plugins. Notifications are sent inside node block but not in any stage block. INPROGRESS is sent after checkout stage with checkout scm step. SUCCESSFUL and FAILED are sent inside node but outside stage blocks too. All notifications are sent with same buildKey. First build is not notified with any state, second and next ones are notified.

hello@adriancarriger.com (JIRA)

unread,
Mar 22, 2017, 6:57:01 PM3/22/17
to jenkinsc...@googlegroups.com

Hi Antonio Mansilla, thanks for the awesome plugin! I'm also experiencing the issue and have created a minimal repo to demonstrate what I'm experiencing.

Steps to reproduce

  1. Create a mutlibranch Jenkins (v2.51) project with a Jenkinsfile like this
  2. Create a branch, publish it, make a commit
    • This does not post to Bitbucket
  3. Make another change on the branch
    • This does post to Bitbucket

No Error Message

In the Jenkins log for the build that does not post to Bitbucket there is no error message and there is no success message.

Log

Here is the log for the build that does not post to Bitbucket
Branch indexing
> git rev-parse --is-inside-work-tree # timeout=10
Setting origin to g...@bitbucket.org:dt-acarriger/bitbucket-build-status-notifier-plugin-issue.git
> git config remote.origin.url g...@bitbucket.org:dt-acarriger/bitbucket-build-status-notifier-plugin-issue.git # timeout=10
Fetching origin...
Fetching upstream changes from origin
> git --version # timeout=10
using GIT_ASKPASS to set credentials Bitbucket Notify
> git fetch --tags --progress origin +refs/heads/:refs/remotes/origin/
Seen branch in repository origin/issue-example
Seen branch in repository origin/master
Seen 2 remote branches
Obtained Jenkinsfile from be3deb74d3c0f1f489c64e76827606ece518131b
[Pipeline] node
Running on master in /Users/acarriger/.jenkins/workspace/tifier-plugin_issue-example-7CIO4G3WKWGDSZ73ZRBWZTTA265YQQSKAEKGOJOPCLK5RW635WYQ
[Pipeline] {
[Pipeline] checkout
Cloning the remote Git repository
Cloning repository g...@bitbucket.org:dt-acarriger/bitbucket-build-status-notifier-plugin-issue.git
> git init /Users/acarriger/.jenkins/workspace/tifier-plugin_issue-example-7CIO4G3WKWGDSZ73ZRBWZTTA265YQQSKAEKGOJOPCLK5RW635WYQ # timeout=10
Fetching upstream changes from g...@bitbucket.org:dt-acarriger/bitbucket-build-status-notifier-plugin-issue.git
> git --version # timeout=10
using GIT_ASKPASS to set credentials Bitbucket Notify
> git fetch --tags --progress g...@bitbucket.org:dt-acarriger/bitbucket-build-status-notifier-plugin-issue.git +refs/heads/:refs/remotes/origin/
> git config remote.origin.url g...@bitbucket.org:dt-acarriger/bitbucket-build-status-notifier-plugin-issue.git # timeout=10
> git config --add remote.origin.fetch +refs/heads/:refs/remotes/origin/ # timeout=10
> git config remote.origin.url g...@bitbucket.org:dt-acarriger/bitbucket-build-status-notifier-plugin-issue.git # timeout=10
Fetching upstream changes from g...@bitbucket.org:dt-acarriger/bitbucket-build-status-notifier-plugin-issue.git
using GIT_ASKPASS to set credentials Bitbucket Notify
> git fetch --tags --progress g...@bitbucket.org:dt-acarriger/bitbucket-build-status-notifier-plugin-issue.git +refs/heads/:refs/remotes/origin/
Checking out Revision be3deb74d3c0f1f489c64e76827606ece518131b (issue-example)
> git config core.sparsecheckout # timeout=10
> git checkout -f be3deb74d3c0f1f489c64e76827606ece518131b
First time build. Skipping changelog.
[Pipeline] stage
[Pipeline] { (test)
[Pipeline] bitbucketStatusNotify
[Pipeline] bitbucketStatusNotify
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Finished: SUCCESS
Thank you for your help!

 

This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

hello@adriancarriger.com (JIRA)

unread,
Mar 23, 2017, 8:42:03 AM3/23/17
to jenkinsc...@googlegroups.com
Adrian Carriger edited a comment on Bug JENKINS-40456
Hi [~flagbit], thanks for the awesome plugin! I'm also experiencing the issue and have created a [minimal repo|https://bitbucket.org/dt-acarriger/bitbucket-build-status-notifier-plugin-issue/commits/branch/issue-example] to demonstrate what I'm experiencing.
h1. Steps to reproduce
# Create a mutlibranch Jenkins (v2.51) project with a [Jenkinsfile like this|https://bitbucket.org/dt-acarriger/bitbucket-build-status-notifier-plugin-issue/src/513089d10b7be34940347c3661f7eb88e05b5bd9/Jenkinsfile?at=master&fileviewer=file-view-default]
** This does [post to Bitbucket|https://bitbucket.org/dt-acarriger/bitbucket-build-status-notifier-plugin-issue/commits/branch/master]
# Create a branch, publish it, make a commit
** This does not post to Bitbucket
# Make another change on the branch
** This does post to Bitbucket

h1. No Error Message


In the Jenkins log for the build that does not post to Bitbucket there is no error message and there is no success message.
h1. Log


Here is the log for the build that does not post to Bitbucket
Branch indexing
> git rev-parse --is-inside-work-tree # timeout=10
Setting origin to g...@bitbucket.org:dt-acarriger/bitbucket-build-status-notifier-plugin-issue.git
> git config remote.origin.url g...@bitbucket.org:dt-acarriger/bitbucket-build-status-notifier-plugin-issue.git # timeout=10
Fetching origin...
Fetching upstream changes from origin
> git --version # timeout=10
using GIT_ASKPASS to set credentials Bitbucket Notify
> git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*

Seen branch in repository origin/issue-example
Seen branch in repository origin/master
Seen 2 remote branches
Obtained Jenkinsfile from be3deb74d3c0f1f489c64e76827606ece518131b
[Pipeline] node
Running on master in /Users/acarriger/.jenkins/workspace/tifier-plugin_issue-example-7CIO4G3WKWGDSZ73ZRBWZTTA265YQQSKAEKGOJOPCLK5RW635WYQ
[Pipeline] \{
[Pipeline] checkout
Cloning the remote Git repository
Cloning repository g...@bitbucket.org:dt-acarriger/bitbucket-build-status-notifier-plugin-issue.git
> git init /Users/acarriger/.jenkins/workspace/tifier-plugin_issue-example-7CIO4G3WKWGDSZ73ZRBWZTTA265YQQSKAEKGOJOPCLK5RW635WYQ # timeout=10
Fetching upstream changes from g...@bitbucket.org:dt-acarriger/bitbucket-build-status-notifier-plugin-issue.git
> git --version # timeout=10
using GIT_ASKPASS to set credentials Bitbucket Notify
> git fetch --tags --progress g...@bitbucket.org:dt-acarriger/bitbucket-build-status-notifier-plugin-issue.git +refs/heads/*:refs/remotes/origin/*

> git config remote.origin.url g...@bitbucket.org:dt-acarriger/bitbucket-build-status-notifier-plugin-issue.git # timeout=10
> git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10

> git config remote.origin.url g...@bitbucket.org:dt-acarriger/bitbucket-build-status-notifier-plugin-issue.git # timeout=10
Fetching upstream changes from g...@bitbucket.org:dt-acarriger/bitbucket-build-status-notifier-plugin-issue.git
using GIT_ASKPASS to set credentials Bitbucket Notify
> git fetch --tags --progress g...@bitbucket.org:dt-acarriger/bitbucket-build-status-notifier-plugin-issue.git +refs/heads/*:refs/remotes/origin/*

Checking out Revision be3deb74d3c0f1f489c64e76827606ece518131b (issue-example)
> git config core.sparsecheckout # timeout=10
> git checkout -f be3deb74d3c0f1f489c64e76827606ece518131b
First time build. Skipping changelog.
[Pipeline] stage
[Pipeline] \{ (test)
[Pipeline] bitbucketStatusNotify
[Pipeline] bitbucketStatusNotify
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Finished: SUCCESS

 


Thank you for your help!

 

davidbows@gmail.com (JIRA)

unread,
Mar 27, 2017, 3:33:01 PM3/27/17
to jenkinsc...@googlegroups.com

Hello - having the same issue.  First  build is not being notified, all others working fine.

You can see from the log that it is calling the notify:

 
First time build. Skipping changelog.
[Pipeline] }

[Pipeline] // stage
[Pipeline] withEnv
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Notify)
[Pipeline] bitbucketStatusNotify
[Pipeline] slackSend
run slackstepsend, step null:false, desc :false
Slack Send Pipeline step configured values from global config - baseUrl: true, teamDomain: true, token: true, channel: false, color: false
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Setup)
[Pipeline] echo

      • Installing NodeJS ***

davidbows@gmail.com (JIRA)

unread,
Mar 27, 2017, 3:42:01 PM3/27/17
to jenkinsc...@googlegroups.com
David Bows edited a comment on Bug JENKINS-40456
Hello - having the same issue.  First  build is not being notified, all others working fine.

You can see from the log that it is calling the notify but it fires :
----
 
First time build. Skipping changelog.
[Pipeline] }
[Pipeline] // stage
[Pipeline] withEnv
[Pipeline] \{
[Pipeline] stage
[Pipeline] \{ (Notify)
[Pipeline] bitbucketStatusNotify
[Pipeline] slackSend
run slackstepsend, step null:false, desc :false
Slack Send Pipeline step configured values from global config - baseUrl: true, teamDomain: true, token: true, channel: false, color: false
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] \{ (Setup)
[Pipeline] echo
*
**
***
Installing NodeJS ***

----
Here is the second build. You can see that it fires.


 
Pipeline] }
[Pipeline] // stage
[Pipeline] withEnv
[Pipeline] \{
[Pipeline] stage
[Pipeline] \{ (Notify)
Sending build status INPROGRESS for commit eaf1de07954dba605e2ed9f60e9b22e9bf17bdbd to BitBucket is done!
[Pipeline] bitbucketStatusNotify

run slackstepsend, step null:false, desc :false
Slack Send Pipeline step configured values from global config - baseUrl: true, teamDomain: true, token: true, channel: false, color: false
[Pipeline] slackSend
[Pipeline] }
[Pipeline] // stage

chocolatey030@gmail.com (JIRA)

unread,
Mar 11, 2019, 8:43:02 PM3/11/19
to jenkinsc...@googlegroups.com
030 030 commented on Bug JENKINS-40456

Any update on this issue? Is there anything I can do in order to help?

This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

chocolatey030@gmail.com (JIRA)

unread,
Mar 13, 2019, 9:49:03 AM3/13/19
to jenkinsc...@googlegroups.com

joseph.solomon89@gmail.com (JIRA)

unread,
Apr 10, 2020, 3:18:03 PM4/10/20
to jenkinsc...@googlegroups.com

Why do we need to fetch previous build scm values here https://github.com/jenkinsci/bitbucket-build-status-notifier-plugin/blob/df373d0ae3ac32a5337c1c002505dee0c85ff5b0/src/main/java/org/jenkinsci/plugins/bitbucket/BitbucketBuildStatusHelper.java#L142?

Couldn't we replace this line with 

Map<String,SCM> scm_map = new LinkedHashMap<>();
for (WorkflowRun.SCMCheckout co : build.checkouts(null)) {
    scm_map.put(co.scm.getKey(), co.scm);
}
Collection<? extends SCM> scms = scm_map.values()
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages