Request for new p4workflow plugin

89 views
Skip to first unread message

Paul Allen

unread,
Aug 10, 2015, 11:13:45 AM8/10/15
to Jenkins Developers
Hi Guys,

Please can I create a new plugin to extend the ‘p4’ for DSL and extended workflow support.

Plugin Name: p4workflow
GitHub User: p4paul

Initial checkin: https://github.com/p4paul/p4workflow

Kind regards,
Paul

--------------------------------------------------------------------------------
This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed. If
you have received this email in error please notify the system manager. Please
note that any views or opinions presented in this email are solely those of the
author and do not necessarily represent those of Perforce Software. Finally,
the recipient should check this email and any attachments for the presence of
viruses. Perforce Software accepts no liability for any damage caused by any
virus transmitted by this email.

Perforce Software UK Ltd is registered in England and Wales as company no.
3816019 at the following address: West Forest Gate, Wellington Road, Wokingham,
RG40 2AT, UK
--------------------------------------------------------------------------------

Daniel Beck

unread,
Aug 10, 2015, 11:35:19 AM8/10/15
to jenkin...@googlegroups.com
Hi Paul,

Very cool. But why is this a separate plugin?

(Also, some pom.xml metadata is still for the P4 Plugin)

Daniel
> --
> You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/8699CE73-3FBE-4050-9870-500492A04BAA%40perforce.com.
> For more options, visit https://groups.google.com/d/optout.
>

Paul Allen

unread,
Aug 10, 2015, 12:45:19 PM8/10/15
to jenkin...@googlegroups.com
Hi Daniel,

I wanted to keep the ‘p4’ plugin at Jenkins 1.568 to maintain backwards compatibility for non Workflow users.

To implement ‘SimpleBuildStep’ I would need to upgrade to 1.596.1 or later; this would break compatibility for some users. Perhaps there is a way around this? I’m guessing you don’t want to split ‘SimpleBuildStep’ out of the core?

The <scm> and <name> sections do need updating, it was a copy/paste error. Where there any other sections I missed?

Kind regards,
Paul
> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/EE549FA7-5811-4065-B3C7-DB02EB9FD685%40beckweb.net.
> For more options, visit https://groups.google.com/d/optout.



Daniel Beck

unread,
Aug 10, 2015, 2:54:43 PM8/10/15
to jenkin...@googlegroups.com
SimpleBuildStep is in 1.577 or later, and the next LTS is 1.580.x. There is no LTS release between 1.568 and 1.577, so it shouldn't really be that big of a change.

That said, I think with an explicit dependency to a later jenkins-core (but older parent) you can write plugin code for newer versions, while the plugin will show up as compatible with older releases -- you'll need to take care of properly wrapping all new code references in separate classes and/or try/catch blocks though. It'll make for a better experience for users if they get Workflow support out of the box. Who expects that to be a separate plugin?

Re pom.xml content, I noticed url (which may be deliberate?) and name.
> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/737BB261-EF56-4E3D-B5F4-FDE44AA7D915%40perforce.com.

Paul Allen

unread,
Aug 11, 2015, 6:39:17 AM8/11/15
to jenkin...@googlegroups.com
Ok, I’ll add it into the core ‘p4’ plugin. I have wrapped the new references into separate classes, I guess the next step is to test it and see what breaks.

Kind regards,
Paul
> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/A16BE621-428F-4588-A0BD-8905043BD93F%40beckweb.net.

Jesse Glick

unread,
Aug 11, 2015, 9:53:47 AM8/11/15
to Jenkins Dev
On Mon, Aug 10, 2015 at 2:54 PM, Daniel Beck <m...@beckweb.net> wrote:
> with an explicit dependency to a later jenkins-core (but older parent) you can write plugin code for newer versions, while the plugin will show up as compatible with older releases -- you'll need to take care of properly wrapping all new code references in separate classes and/or try/catch blocks though.

This sounds pretty hairy and I would not recommend it.

But yes you should be able to use 1.580.1 as a baseline.

Paul Allen

unread,
Aug 11, 2015, 10:50:34 AM8/11/15
to jenkin...@googlegroups.com
Well nothing in the core part of ‘p4' broke with 1.580.1, just some of the DSL support. Looks like I need 1.596.1 for that to work.



Although with 1.580.1 I do get some errors on startup (see below), is there an annotation I can add to suppress load errors (some sort of optional=true)

Aug 11, 2015 3:45:53 PM hudson.ExtensionFinder$Sezpoz scout
WARNING: Failed to scout org.jenkinsci.plugins.p4.workflow.P4TaggingStep$DescriptorImpl
java.lang.InstantiationException: java.lang.NoClassDefFoundError: org/jenkinsci/plugins/workflow/steps/AbstractStepDescriptorImpl
at net.java.sezpoz.IndexItem.element(IndexItem.java:146)
at hudson.ExtensionFinder$Sezpoz.scout(ExtensionFinder.java:666)
... snip
Caused by: java.lang.NoClassDefFoundError: org/jenkinsci/plugins/workflow/steps/AbstractStepDescriptorImpl
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
... snip
Caused by: java.lang.ClassNotFoundException: org.jenkinsci.plugins.workflow.steps.AbstractStepDescriptorImpl
at jenkins.util.AntClassLoader.findClassInComponents(AntClassLoader.java:1375)
at jenkins.util.AntClassLoader.findClass(AntClassLoader.java:1325)
at jenkins.util.AntClassLoader.loadClass(AntClassLoader.java:1078)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
... 40 more



Using a much older version like 1.565.3 gives the same load errors, but fails to build with…

Started by user anonymous
Building in workspace /Users/pallen/.jenkins/workspace/test
FATAL: hudson.scm.SCM.checkout(Lhudson/model/AbstractBuild;Lhudson/Launcher;Lhudson/FilePath;Lhudson/model/BuildListener;Ljava/io/File;)Z
java.lang.AbstractMethodError: hudson.scm.SCM.checkout(Lhudson/model/AbstractBuild;Lhudson/Launcher;Lhudson/FilePath;Lhudson/model/BuildListener;Ljava/io/File;)Z
at hudson.model.AbstractProject.checkout(AbstractProject.java:1252)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:615)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:524)
at hudson.model.Run.execute(Run.java:1706)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:232)
> --
> You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr2ALEJkHh28nq3uR74X1UsUSm%3D5NSnXtR1JZO%2BWXgh3ig%40mail.gmail.com.

Paul Allen

unread,
Aug 11, 2015, 11:06:02 AM8/11/15
to jenkin...@googlegroups.com
Ok, so adding '@Extension(optional = true)' on DescriptorImpl resolved the load issues.


No idea on the cause of the build error for 1.565.3, but at least 1.580.1 mostly works.
> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/373336BF-E2C5-42F4-BA7F-7CCCA368DB00%40perforce.com.
Reply all
Reply to author
Forward
0 new messages