-
Notifications
You must be signed in to change notification settings - Fork 352
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
JENKINS-65741: Implement a new option that will allow to include jenkins url to the commit status #454
base: master
Are you sure you want to change the base?
Conversation
…ins url to the bitbucket commit status
return DisplayURLProvider.get().getRoot(); | ||
} | ||
|
||
private static String getRunURL(@NonNull Run<?, ?> build) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method was confusing - it was returning job url but saying it was returning root url, and since I needed a new method that would return a root url - I had to rename this.
This method also never actually uses build
and cfg
so I am not sure what's the purpose of everything in there except for the last line.
try { | ||
url = getRootURL(build); | ||
rootUrl = getRootURL(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Root URL does not need a checkURL
. There is no requirements for the text fields it is used in, and we want to keep whatever the user have put in there.
@@ -231,6 +246,10 @@ private static String getBuildKey(@NonNull Run<?, ?> build, String branch, | |||
key = build.getParent().getFullName(); // use the job full name as the key for the status | |||
} | |||
|
|||
if (includeJenkinsURL) { | |||
key = rootUrl + "/" + key; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There might be double /
depending on the user input - but I figured it doesn't makes any difference, the string is just a seed for a hash - as long as it's consistent, we're good.
Is it possible to show a screenshot of how this looks on Bitbucket? |
@ssc327 I just attached a screenshot above. The top entry coming from a Jenkins instance with this option enabled. |
Anyone? |
Actually I was just testing it on |
….com:dee-kryvenko/bitbucket-branch-source-plugin into feature/JENKINS-65741-add-key-override-trait
FYI there is a very interesting discussion going on here https://jira.atlassian.com/browse/BSERV-12817 relatively to this feature. |
This PR will add a new option to the existing commit status trait. Enabling this option will add Jenkins URL to the commit status key and description to differentiate notifications from different systems.
I initially wanted to include URL into the build status name, but at least Bitbucket Server does not making status popup windows wider to accommodate that. The end of the name getting shrined into
...
. I thought it is more important to see info about the job atop, so I included URL to the description instead of the name.https://issues.jenkins.io/browse/JENKINS-65741
I could not find any existing tests for the commit statuses, and I am not really up to the challenge to cover it all with tests in the scope of this PR, so no tests in this PR. I did tested it locally on my Bitbucket Server instance.
Your checklist for this pull request