-
Notifications
You must be signed in to change notification settings - Fork 100
basic Jenkins pipeline support for notifier #185
Conversation
Very cool! Is there some way for me to test this? I've never used jenkinsfile/pipeline before |
there is a repository here with the proper Jenkinsfile: |
Ok, so it sounds like this is still a Work-In-Progress commit then, I'll add a WIP label and then ping me when this is ready for review. |
We'd be interested in this as well. |
I'll update the PR as soon as I can.
|
As you mentioned the cobertura plugin is right now seeing active work on pipeline support. The PR#55 builds and works. It might be a good idea to test against that (or I can do the testing & report back if you update this PR) |
d4ac341
to
28dacfb
Compare
The solution is getting more and more hacky. I can't exactly base a PR on an unreleased dependency. |
@sectioneight if I create proper pipeline tests would this PR be eligible for merging into master? There is still no coverage and build wrapper support, but it would be great have the basic pipeline support in the released plugin. |
Absolutely, if there's unit test coverage, at least a little bit of
documentation (maybe in the advanced section) and the code is reasonable
then this is purely additive. No need to implement everything all at once,
in fact we prefer smaller PRs.
Also feel free to open up a Work In Progress PR if you want to get a sanity
check / feedback on the general approach.
…On Wed, Feb 1, 2017 at 1:57 AM balihb ***@***.***> wrote:
@sectioneight <https://github.com/sectioneight> if I create proper
pipeline tests would this PR be eligible for merging into master? There is
still no coverage and build wrapper support, but it would be great have the
basic pipeline support in the released plugin.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#185 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAF7P147HU8ZcRIDKgsuPoHY9lbUSG9Cks5rYFcUgaJpZM4KiXMt>
.
|
Oh, i see, we already have a PR :) I was assuming this was an issue while responding via email. Would you like us to take a look at this now or are there changes forthcoming? |
lgtm
Hanjun
…On Thu, Feb 2, 2017 at 1:26 AM, Aiden Scandella ***@***.***> wrote:
Oh, i see, we already have a PR :) I was assuming this was an issue while
responding via email.
Would you like us to take a look at this now or are there changes
forthcoming?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#185 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACW3ywqQVYwuaPSSWLgFMFjuifI3BL2Zks5rYMBFgaJpZM4KiXMt>
.
|
Is this PR still valid? |
it is valid. I just haven't had the time to write the tests for it. |
jenkinsci/cobertura-plugin#55 has been merged, so it'd be great if this PR can make sure cobertura support is enabled. We're using this PR directly, and other than the coverage reporting/comparison, it's been working great! |
+1 |
I finally had time to finish this up. Please try it out! |
@sectioneight ping :D |
maybe @artms as the latest commiter? |
Just did a test and works fine here. This is my Jenkinsfile
|
Where does this stand? We would also really appreciate this PR getting merged. It has a "work in progress" tag; is this still WIP? Perhaps removing that tag would help to get the attention of the maintainers, as it appears to be ready for review. @sectioneight seemed initially enthusiastic about this PR, but is apparently no longer involved in maintaining the project. Who are the current maintainers? |
based on the commit history noone. we are thinking about proposing to
maintain it in the future.
…On Mon, May 14, 2018, 20:15 Mitchell T.H. Young ***@***.***> wrote:
Where does this stand? We would also really appreciate this PR getting
merged. It has a "work in progress" tag; is this still WIP? Perhaps
removing that tag would help to get the attention of the maintainers, as it
appears to be ready for review. @sectioneight
<https://github.com/sectioneight> seemed initially enthusiastic about
this PR, but is apparently no longer involved in maintaining the project.
Who are the current maintainers?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#185 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACvMmM8Y3Imjvyt5dCDSXgtiDy8yQrADks5tycmogaJpZM4KiXMt>
.
|
Im ok merging this if its been staged and working without breaking backwards compatibility |
@balihb please sign the CLA before we can merge this |
@balihb Can you please also add some documentation to the advanced section |
I've added a fix for the null pointer exception in the pipeline. |
@balihb could you please take a look at my Jenkinsfile i've posted above? Is it possible to fix that issue the workaround is required for? |
it should be fixed by my latest change. |
|
||
optionalJenkinsPlugins 'org.jenkins-ci.plugins:junit:1.6@jar' | ||
optionalJenkinsPlugins 'org.jenkins-ci.plugins:cobertura:1.9.6@jar' | ||
optionalJenkinsPlugins 'org.jenkins-ci.plugins:cobertura:1.11@jar' |
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.
Why is this required? Can we decouple this change?
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.
Answered in #185 (comment)
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.
sounds good
this is required, since, this is the first cobertura plugin version, that
supports pipeline.
…On Tue, May 15, 2018, 18:18 Gautam Korlam ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In build.gradle
<#185 (comment)>
:
> @@ -47,7 +47,7 @@ dependencies {
jenkinsPlugins ***@***.***'
optionalJenkinsPlugins ***@***.***'
- optionalJenkinsPlugins ***@***.***'
+ optionalJenkinsPlugins ***@***.***'
Why is this required? Can we decouple this change?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#185 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACvMmCfbmlR_wI-h7X3L7KcXfEoyxhPWks5tyv_TgaJpZM4KiXMt>
.
|
documentation added. Hope it is ok. let me know if I should change anything about it. |
|
||
public Result getBuildResult() { | ||
return this.build.getResult(); | ||
if (this.build.getResult() == null) { |
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.
Can you explain why we would want to return success on null? It seems a bit counterintuitive. Are there any api docs defining this new behavior?
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.
on oldschool freestyle jobs after the build reached the last build step it set the build result to success, but in pipeline there is no definite end of build blocks, so it won't explicitly set SUCCESS, hence the previous workaround, where it was needed to run this before the notifier:
currentBuild.result = currentBuild.result ?: 'SUCCESS'
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.
The phab notifier build step need not necessarily be the last step. If someone uses pipeline and not this plugin, they would have to workaround this anyways, so this logic should not be in this plugin. This should be reported upstream to jenkins.
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.
null == success so far. IMHO it was a genuine missing null check in the plugin code. In freestyle it is always set and in pipeline it is always considered SUCCESS.
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.
makes sense
resultProcessor.sendComment(commentWithConsoleLinkOnFailure); | ||
|
||
return true; | ||
return; |
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.
can remove this redundant return at the end of a void method
|
||
// Fallback to scanning for the reports | ||
copyCoverageToJenkinsMaster(build); | ||
copyCoverageToJenkinsMaster(build, workspace); |
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.
just inline build.getWorkspace()
here and avoid the local workspace
variable
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.
in the new Jenkins API you can't use Build, but must use Run, but the run interface won't provide a getWorkspace method. I can change this call to this:
copyCoverageToJenkinsMaster(build, getWorkspace());
but this is the best I can do.
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.
Lets leave it as is then
|
||
public Result getBuildResult() { | ||
return this.build.getResult(); | ||
if (this.build.getResult() == null) { |
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.
makes sense
Any ETA on when this will be available (plugin version update)? |
Up? everyting seems ready? Please at least allow us to download the plugin from Travis integration server, thanks |
You can use |
Hi, just done. Thanks
Le mar. 12 juin 2018 à 16:07, Gautam Korlam <notifications@github.com> a
écrit :
… You can use ./gradlew jpi to build the plugin locally till a release is
cut
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#185 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AByN11jNKE7jT6DjIyYNqK3fYkqt2okWks5t78skgaJpZM4KiXMt>
.
|
Hi, We in KDE would very much like to use this on our build servers, is there any chance to get it released under plugin upgrades as we'd rather use it from released version instead of unstable git builds. Thanks. |
This is a very rough Jenkins Pipeline support with code duplication that should somehow be refactored.
An example of such pipeline is like this:
Jenkinsfile.txt