-
Notifications
You must be signed in to change notification settings - Fork 364
[JENKINS-76027] Allow Bitbucket build status to be customised #1101
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
Conversation
9ea0bc2
to
8c3ac48
Compare
1da5a31
to
506ed6a
Compare
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.
I looked at the diff on a phone, didn't load to any IDE yet.
.../com/cloudbees/jenkins/plugins/bitbucket/api/buildstatus/BitbucketBuildStatusCustomizer.java
Outdated
Show resolved
Hide resolved
return optionalData; | ||
} | ||
|
||
public void setOptionalData(Map<String, Object> optionalData) { |
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.
Here I'd like some reference to com.fasterxml.jackson so that callers understand what kind of Object
can be put in the map and how it will be serialised.
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.
I thought long about how to make it extensible:
- In my first attempts, I tried using subclasses, but calling different customizers in a cascade would return different objects.
- The second was a map that is serialized excluding the container element.
Using a JsonNode it's not possible (from what I know) to achieve the same result. It also means that customizers would have to have jackson among their dependencies. In this way, a customizer can simply add any type of object. It's up to the implementer to provide a properly serializable bean.
Have a look to ServerBuildStatusCustomizer how is simple is add a testResults data
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.
Add javadoc, replace setter of the map with method to set a single entry (this should avoid delete info populated by other customizers)
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.
Please mention "bean" in the javadoc.
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.
do you mean instead of optionalData?
@param bean value associate to the given key
or
@param optionalData bean associate to the given key
?
src/main/java/com/cloudbees/jenkins/plugins/bitbucket/api/webhook/BitbucketWebhookManager.java
Outdated
Show resolved
Hide resolved
...com/cloudbees/jenkins/plugins/bitbucket/impl/notifier/BitbucketBuildStatusNotifications.java
Outdated
Show resolved
Hide resolved
cadd390
to
a98b9a3
Compare
Define extension point to allow customisation of build status. Additional data could be sei in the optionalData field where all entries will be serialised starting from the root object.
a98b9a3
to
b89041b
Compare
Define an extension point to customize the build status with optional data or change only some basic data (description, build number and so on).
Example of Bitbucket Data Center to add test result (Cloud has report on code insign reports, maybe separate PR for this).