[JENKINS-33016] CVS polling not detected in Pipeline
These changes were made to enable the polling functionality in the Pipeline Jobs, as described in JENKINS-33016.
Thank you for this pull request! Please check this document for how the Jenkins project handles pull requests.
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?
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.
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.
To clarify the previous comment, the check was reactivated on last commit.
Any progress on this one?
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 Thanks! Works like a charm!
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.
@oleg-nenashev you are last committer to cvs-plugin - do you know who might help on merging this one?
I believe @jglick is a maintainer. But it's hard to discuss merging the PR while there are merge conflicts
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!