-
Notifications
You must be signed in to change notification settings - Fork 28
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
Add support for Pipeline jobs #28
Conversation
it somehow works now (doesn't crash anymore), but doesn't display anything ... so this would need more work also tests seems to be broken
This allows project actions to be attached to pipeline jobs based on the presence of an associated build action
@@ -9,14 +9,14 @@ | |||
@SuppressWarnings("unchecked") | |||
public abstract class AbstractRubyMetricsProjectAction<T extends AbstractRubyMetricsBuildAction> extends Actionable implements ProminentProjectAction { | |||
|
|||
protected final AbstractProject<?, ?> project; | |||
protected final Job<?, ?> job; |
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 think this rename may actually be a breaking change for deserializing old build records. It's been a while since I've had to deal with this in Jenkins (it was Hudson last time I had to do so), but if I recall this can be fixed by implementing readResolve()
.
Update: Looks like I have to implement readResolve()
and put back the old field with the transient
keyword: https://wiki.jenkins-ci.org/display/JENKINS/Hint+on+retaining+backward+compatibility
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 believe I have addressed this in c67d3aa
It would probably be nice to add a test that attempts to load an old build record. If any Jenkins maintainers could point me toward a test that does that, I can look at adding one.
Another thing I didn't do in this PR was to update the generator code under |
🤘 |
So I was finally able to deploy your PR into version 1.6.4. Took a while :) As it turns out latest jenkins plugin requirements include FindBugs to pass, which in our case shows 31 errors. I silenced it for now and created #30. Unfortunately I am not a Java developer so I am not really able to fix this issues. Maybe you would like to help? |
Awesome when to know RubyMetrics-Plugin could work with pipeline but why you don't update how-to-work from BTW, thank you for this plugin. |
This PR updates this plugin to work correctly with pipeline jobs.
The main change is to change references to
AbstractProject
,AbstractBuild
, andBuildListener
to refer toJob
,Run
, andTaskListener
respectively. Another change is to implementSimpleBuildStep.LastBuildAction
to allow build actions to contribute actions to a project.One thing I did not do was to make this plugin actually depend on the Pipeline API, so in order to use the publishers, you'll need to use the
step
metastep. Here's an example forRcovPublisher
:Many thanks to @SuperTux88 for starting this work in 61f5f2a and to @cprice404 for his helpful guide to refactoring Jenkins plugins to be pipeline-compatible: https://jenkins.io/blog/2016/05/25/update-plugin-for-pipeline/