Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bitbucket Build Status Empty #27

Closed
blopker opened this issue Jun 7, 2019 · 7 comments
Closed

Bitbucket Build Status Empty #27

blopker opened this issue Jun 7, 2019 · 7 comments

Comments

@blopker
Copy link

blopker commented Jun 7, 2019

Hello, I found a small issue with the way the Bitbucket build statuses are being posted. The issue, I think, is that the "name" field isn't being supplied to the Bitbucket API. The effect is that although the build is green in the PR UI, there's no link to Drone. This only affects the new (beta) PR UI, which can be enabled in a user's settings (Bitbucket Labs).

Expected behavior is that a link shows up next to the build status in the new PR UI. Example from a Jenkins build:
image

The observed behavior is that the build status is shown, but there's no link:
image

The string I see from our Jenkins builds is from the optional "name" field, so I think that's all that needs to be added. As far as I can tell, this is in the CreateStatus function in https://github.com/drone/go-scm/blob/master/scm/driver/bitbucket/repo.go. Adding Name: input.Label to the status struct should do the trick, although it might be nicer to have "name" set to the label plus the build number.

Cheers!

jstrachan added a commit to jstrachan/go-scm that referenced this issue Sep 13, 2019
fix: lets use the version env var instead
@bradrydzewski
Copy link
Member

bradrydzewski commented Sep 20, 2019

@blopker I was wondering if you could create a working example with CURL for creating a status that I could reference? We have both name and key in the payload for compatibility with old and new versions and I'm seeing the status appear.

type status struct {
	State string `json:"state"`
	Key   string `json:"key"`
	Name  string `json:"name"`
	URL   string `json:"url"`
	Desc  string `json:"description"`
}

You can find the code here (note that Bitbucket Server is in the stash package)
https://github.com/drone/go-scm/blob/master/scm/driver/stash/repo.go#L216

Unfortunately, I do not have the option to Bitbucket Labs for my installation (trying to figure that out too). But in the meantime, if there is a CURL I can use to replicate I should be able to fix. Thanks!

@blopker
Copy link
Author

blopker commented Sep 23, 2019

You mentioned Bitbucket Server, but this is for Bitbucket Cloud, sorry for the confusion.

To get to the Labs page, you go to bitbucket.org and click on your profile:
image
Then click on Bitbucket Labs.

The feature is called "New pull request experience":
image

However, it now appears that Bitbucket is displaying something which fixes the usability issue of not being able to click on the status and get to the build in Drone.

The status now looks like:
image

Since the link is now clickable I think the main issue here is gone. Still it might be nice to have a custom status link containing the build number, like Jenkins does.

@bradrydzewski
Copy link
Member

You mentioned Bitbucket Server, but this is for Bitbucket Cloud, sorry for the confusion.

ah, thanks, I was making the wrong assumptions. Thank you for clarifying, as this should now be much easier to track down :)

bradrydzewski added a commit that referenced this issue Sep 25, 2019
@bradrydzewski
Copy link
Member

bradrydzewski commented Sep 25, 2019

I fixed this at the library level so that we can supply a more user-friendly title. Do you have a preference of how you would like to format the title? I am leaning toward Build #42 but am open to suggestions.

bitbucket_pr_statuses

@tboerger
Copy link
Contributor

What about drone/24? Build is already written below it so it's redundant.

@blopker
Copy link
Author

blopker commented Sep 26, 2019

I'm trying to think of what other info would be useful there. Maybe the branch name? Something like: #24 my_great_feature.

@bradrydzewski
Copy link
Member

we will make this customizable in the server. In the meantime, we have this resolved in master and in :latest and I'm planning to cut a tag this weekend. So we should be all set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants