cvs-plugin icon indicating copy to clipboard operation
cvs-plugin copied to clipboard

[JENKINS-33016] CVS polling not detected in Pipeline

Open valones opened this issue 9 years ago • 12 comments

These changes were made to enable the polling functionality in the Pipeline Jobs, as described in JENKINS-33016.

valones avatar Feb 18 '16 16:02 valones

Thank you for this pull request! Please check this document for how the Jenkins project handles pull requests.

jenkinsadmin avatar Feb 18 '16 19:02 jenkinsadmin

Agreed, but the only solution that I see requires that I know of implementations of subclasses, which does not think it's a good idea. The ideal solution would be for the Jenkins-24141 or similar were resolved. Any suggestion?

valones avatar Feb 18 '16 20:02 valones

We can't regress the widely used feature of a checkout for a non-pipeline job just to support pipeline features, so I can't accept this Pull Request until we have a suitable solution.

I'd propose implementing both:

protected PollingResult compareRemoteRevisionWith(final Job<?, ?> project, final Launcher launcher, final FilePath workspace, final TaskListener listener, final SCMRevisionState baseline, final CvsRepository[] repositories)

and

protected PollingResult compareRemoteRevisionWith(final AbstractProject<?, ?> project, final Launcher launcher, final FilePath workspace, final TaskListener listener, final SCMRevisionState baseline, final CvsRepository[] repositories)

and have them both delegate to a method with a boolean or enum flag to indicate if this is a pipeline job or not, with the current implementation of compareRemoteRevisionWith contained in this delegated method, and the code you've currently commented out re-enabled and wrapped in a condition that checks this boolean/enum flag. I've not tried running this so can't prove if it would actually work as I hope (I don't know what the actual implementation of Job/AbstractProject that's passed into this method is for pipeline and non-pipeline job), so you'd need to perform some investigation or testing around this.

mc1arke avatar Feb 21 '16 21:02 mc1arke

For a pipeline is a WorkflowJob and for a non-pipeline remains a AbstractProject, but now I shouldn't have to worry about this. Reactivated the check if the Run is a AbstractBuild. Added a TODO for when JENKINS-24141 is resolved.

valones avatar Feb 22 '16 19:02 valones

To clarify the previous comment, the check was reactivated on last commit.

valones avatar Feb 25 '16 20:02 valones

Any progress on this one?

egorse avatar Aug 24 '17 13:08 egorse

This plugin no longer has a maintainer to accept the pull request. However, this fix is fully functional, you just have to compile the code. I've been using it in production environment without any problem since my last post.

valones avatar Aug 24 '17 13:08 valones

@valones Thanks! Works like a charm!

egorse avatar Sep 15 '17 12:09 egorse

for when JENKINS-24141 is resolved

It is; can be used most easily with a 2.60.x or newer baseline, though that is not critical. See https://github.com/jenkinsci/mercurial-plugin/pull/102 for example.

jglick avatar Feb 28 '18 20:02 jglick

@oleg-nenashev you are last committer to cvs-plugin - do you know who might help on merging this one?

egorse avatar Aug 24 '18 13:08 egorse

I believe @jglick is a maintainer. But it's hard to discuss merging the PR while there are merge conflicts

oleg-nenashev avatar Aug 24 '18 13:08 oleg-nenashev

Please note that I adapted your suggested fixes to create a new PR #50 that is mergable and keeps all old functionality. Thanks for providing your solution!

mrmoritz01 avatar Apr 24 '19 19:04 mrmoritz01