[JIRA] [bitbucket-build-status-notifier-plugin] (JENKINS-33276) Build status is not being set for commit in bitbucket

49 views
Skip to first unread message

goikhburg@gmail.com (JIRA)

unread,
Mar 2, 2016, 10:33:06 AM3/2/16
to jenkinsc...@googlegroups.com
Lior Goikhburg created an issue
 
Jenkins / New Feature JENKINS-33276
Build status is not being set for commit in bitbucket
Issue Type: New Feature New Feature
Assignee: Antonio Mansilla
Components: bitbucket-build-status-notifier-plugin
Created: 02/Mar/16 3:32 PM
Priority: Major Major
Reporter: Lior Goikhburg

The plugin doesn't set the status:

According to the job log - everything is fine:

Sending build status INPROGRESS for commit 915809121478ace3d92e52bbb2769f03f26cbfa9 to BitBucket is done!
Sending build status SUCCESSFUL for commit 915809121478ace3d92e52bbb2769f03f26cbfa9 to BitBucket is done!

Plugin log:

Mar 02, 2016 6:23:46 PM INFO org.jenkinsci.plugins.bitbucket.BitbucketBuildStatusNotifier prebuild
Bitbucket notify on start
Mar 02, 2016 6:23:46 PM INFO org.jenkinsci.plugins.bitbucket.BitbucketBuildStatusNotifier notifyBuildStatus
This response was received:
Mar 02, 2016 6:23:47 PM INFO org.jenkinsci.plugins.bitbucket.BitbucketBuildStatusNotifier prebuild
Bitbucket notify on start succeeded
Mar 02, 2016 6:23:47 PM INFO org.jenkinsci.plugins.bitbucket.BitbucketBuildStatusNotifier perform
Bitbucket notify on finish
Mar 02, 2016 6:23:47 PM INFO org.jenkinsci.plugins.bitbucket.BitbucketBuildStatusNotifier notifyBuildStatus
This response was received:
Mar 02, 2016 6:23:48 PM INFO org.jenkinsci.plugins.bitbucket.BitbucketBuildStatusNotifier perform
Bitbucket notify on finish succeeded

Using CURL requests to api with the same credentials I'm able to set the status:
REQUEST:

curl -X POST https://api.bitbucket.org/2.0/repositories/myteam/myrepo.git/commit/9186237941862379481679236178237/statuses/build -H "Authorization: Bearer HkG8WeMRte2C2vx3CL8SwE7gO8_086612391486231486723617991_g==" -d state=SUCCESSFUL -d key=JENKINS-BUILD-50 -d url=https://cicd.myrepo.ru/job/myrepo/

RESPONSE:

{"name": "", "links": {"commit": {"href": "https://api.bitbucket.org/2.0/repositories/myteam/myrepo/commit/9186237941862379481679236178237"}, "self": {"href": "https://api.bitbucket.org/2.0/repositories/myteam/myrepo/commit/9186237941862379481679236178237/statuses/build/JENKINS-BUILD-50"}}, "url": "https://cicd.myrepo.ru/job/myrepo/", "state": "SUCCESSFUL", "created_on": "2016-03-02T14:46:06.740794+00:00", "key": "JENKINS-BUILD-50", "updated_on": "2016-03-02T14:48:41.267025+00:00", "type": "build", "description": ""}
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

antonio.mansilla@flagbit.de (JIRA)

unread,
Mar 2, 2016, 10:37:02 AM3/2/16
to jenkinsc...@googlegroups.com

goikhburg@gmail.com (JIRA)

unread,
Mar 2, 2016, 10:40:01 AM3/2/16
to jenkinsc...@googlegroups.com
Lior Goikhburg commented on Bug JENKINS-33276
 
Re: Build status is not being set for commit in bitbucket

Bitbucket account and Jenkins was configured according to documentation.

Anything I can do to help troubleshoot this issue ?

goikhburg@gmail.com (JIRA)

unread,
Mar 2, 2016, 10:41:01 AM3/2/16
to jenkinsc...@googlegroups.com

Key and Secret credentials are accepted without error in job configuration page

antonio.mansilla@flagbit.de (JIRA)

unread,
Mar 2, 2016, 10:51:01 AM3/2/16
to jenkinsc...@googlegroups.com

Hi Lior Goikhburg, first thank you for reporting the issue. Currently I don't have too much time to take a look to this, so maybe you could clone the repository, deep into the code and try identify what is exactly the problem, that'd be fine at first.

antonio.mansilla@flagbit.de (JIRA)

unread,
Mar 2, 2016, 11:32:01 AM3/2/16
to jenkinsc...@googlegroups.com

Hi Lior Goikhburg I just remembered some guy had a similar issue because long job names. Can you please report the job name you are having this issue with? Thx

goikhburg@gmail.com (JIRA)

unread,
Mar 2, 2016, 11:49:09 AM3/2/16
to jenkinsc...@googlegroups.com

The job name is "test".
Regarding fixing the code myself, well, that has a very low chance of success considering me not knowing Java

goikhburg@gmail.com (JIRA)

unread,
Mar 2, 2016, 12:03:02 PM3/2/16
to jenkinsc...@googlegroups.com

Hey Antonio Mansilla I figured out what's causing this.
I have a global variable (that I inject before SCM) in the repo name such as: g...@bitbucket.org:my_team/$

{PROJECT}.git.
I guess that the plugin cannot expand that variable and proceeds to notify the repo by my_team/${PROJECT}

repo.
When I change the variable to a real repo name - the plugin works like a charm.

goikhburg@gmail.com (JIRA)

unread,
Mar 2, 2016, 12:03:02 PM3/2/16
to jenkinsc...@googlegroups.com
Lior Goikhburg edited a comment on Bug JENKINS-33276
Hey [~amansilla] I figured out what's causing this.
I have a global variable (that I inject before SCM) in the repo name such as:
 {noformat}  g...@bitbucket.org:my_team/${PROJECT}.git . {noformat}
I guess that the plugin cannot expand that variable and proceeds to notify the repo by
 {noformat}  my_team/${PROJECT} {noformat}  repo.

When I change the variable to a real repo name - the plugin works like a charm.

goikhburg@gmail.com (JIRA)

unread,
Mar 2, 2016, 12:18:03 PM3/2/16
to jenkinsc...@googlegroups.com
Lior Goikhburg edited a comment on Bug JENKINS-33276
Hey [~amansilla] I figured out what's causing this.
I have a global variable (that I inject before SCM) in the repo name such as: {noformat}g...@bitbucket.org:my_team/${PROJECT}.git{noformat}
I guess that the plugin cannot expand that variable and proceeds to notify the repo by {noformat}my_team/${PROJECT}{noformat}
 repo  name .

When I change the variable to a real repo name - the plugin works like a charm.

goikhburg@gmail.com (JIRA)

unread,
Mar 2, 2016, 12:19:02 PM3/2/16
to jenkinsc...@googlegroups.com
Lior Goikhburg edited a comment on Bug JENKINS-33276
Hey [~amansilla] I figured out what's causing this.
I have a global variable (that I inject before SCM)  configured  in the repo  name  url  such as: {noformat} Repository URL: g...@bitbucket.org:my_team/${PROJECT}.git{noformat}
I guess that the plugin cannot expand that variable and proceeds to notify the repo by {noformat}my_team/${PROJECT}{noformat} name.

When I change the variable to a real repo name - the plugin works like a charm.

antonio.mansilla@flagbit.de (JIRA)

unread,
Mar 3, 2016, 9:02:02 AM3/3/16
to jenkinsc...@googlegroups.com

Nice catch Lior Goikhburg. In that case, can you please provide a list of the plugins involved in your deployment and some tips for the job configuration in order to I can properly reproduce your problem?

goikhburg@gmail.com (JIRA)

unread,
Mar 3, 2016, 12:04:01 PM3/3/16
to jenkinsc...@googlegroups.com

Oh, I have a lot of plugins actually, the relevant for this problem is "Environment Injector Plugin".

The job is configured as follows:

  1. Select "Prepare an environment for the run" checkbox (just before SCM)
  2. In "Properties Content" form write:
    PROJECT=REPO_NAME
  3. In SCM choose git and enter "Reository URL"
    g...@bitbucket.org:USERNAME/${PROJECT}.git
  4. In Post-build actions configure "Bitbucket notify build status"

That should trigger the error.

goikhburg@gmail.com (JIRA)

unread,
Mar 3, 2016, 12:05:01 PM3/3/16
to jenkinsc...@googlegroups.com
Lior Goikhburg edited a comment on Bug JENKINS-33276
Oh, I have a lot of plugins actually, the relevant for this problem is "Environment Injector Plugin".

The job is configured as follows:

# Select "Prepare an environment for the run" checkbox (just before SCM)
# In "Properties Content" form write: {noformat}PROJECT=REPO_NAME{noformat}
# In SCM choose git and enter "Reository URL" {noformat}g...@bitbucket.org:USERNAME/${PROJECT}.git{noformat}
# In Post-build actions configure "Bitbucket notify build status"

That should trigger the
 error  problem .

goikhburg@gmail.com (JIRA)

unread,
Mar 3, 2016, 12:10:01 PM3/3/16
to jenkinsc...@googlegroups.com
Lior Goikhburg edited a comment on Bug JENKINS-33276
Oh, I have a lot of plugins actually, the relevant for this problem is "Environment Injector Plugin".

The job is configured as follows:

# Select "Prepare an environment for the run" checkbox (just before SCM)
# In "Properties Content" form write: {noformat}PROJECT=REPO_NAME{noformat}
# In SCM choose git and enter "Reository URL" {noformat}g...@bitbucket.org:USERNAME/${PROJECT}.git{noformat}
# In Post-build actions configure "Bitbucket notify build status"

That should trigger the problem.


EDIT:
You can also try without "Environment Injector Plugin":
Set your job name as the name of your bitbucket repo, and then configure your repo URL to use a built-in variable $JOB_NAME:
{noformat}g...@bitbucket.org:USERNAME/${JOB_NAME}.git{noformat}
And check if your repo is notified.

goikhburg@gmail.com (JIRA)

unread,
Mar 26, 2016, 12:58:02 PM3/26/16
to jenkinsc...@googlegroups.com

Hi Antonio, have you been able to duplicate the problem? Do you think this can be fixed? It'd be cool if I could use a variable in repo name and still be able to have bitbucket notifications.

Reply all
Reply to author
Forward
0 new messages