Global Pipeline Libraries support for p4-plugin

14 views
Skip to first unread message

pallen

unread,
Aug 18, 2017, 11:50:01 AM8/18/17
to Jenkins Developers
Hi Guys,

Please can you point me to where I would need to implement support for 'Global Pipeline Libraries' for the p4-plugin. Currently only 'Retrieval method' of 'Legacy SCM' is available.

If it was part of the scm-api implementation then I must have overlooked the extension point.

Kind regards,
Paul

Jesse Glick

unread,
Aug 18, 2017, 11:52:11 AM8/18/17
to Jenkins Dev
On Fri, Aug 18, 2017 at 11:50 AM, pallen <pal...@perforce.com> wrote:
> Please can you point me to where I would need to implement support for
> 'Global Pipeline Libraries' for the p4-plugin. Currently only 'Retrieval
> method' of 'Legacy SCM' is available.

http://javadoc.jenkins.io/scm-api/jenkins/scm/api/SCMSource.html#retrieve-java.lang.String-hudson.model.TaskListener-

Paul Allen

unread,
Aug 18, 2017, 12:28:52 PM8/18/17
to jenkin...@googlegroups.com
Thank you :-)

I had implemented SCMSource for MultiBranch, but only the retrieve method for observer (2.0).  I can't find any 2.0 methods in the documentation link you sent - is this out-of-date?

Think I found the method in the source...
/**
* SPI: Looks up a specific revision based on some SCM-specific set of permissible syntaxes.
* The default implementation uses {@link #retrieve(SCMSourceCriteria, SCMHeadObserver, TaskListener)}
* and looks for {@link SCMHead#getName} matching the argument (so typically only supporting branch names).
* @param thingName might be a branch name, a tag name, a cryptographic hash, a revision number, etc.
* @param listener the task listener
* @return a valid revision object corresponding to the argument, with a usable corresponding head, or null if malformed or not found
* @throws IOException if an error occurs while performing the operation.
* @throws InterruptedException if any thread has interrupted the current thread.
* @since 1.3
*/
@CheckForNull
protected SCMRevision retrieve(@NonNull final String thingName, @NonNull TaskListener listener)
throws IOException, InterruptedException {
SCMHeadObserver.Named baptist = SCMHeadObserver.named(thingName);
_retrieve(null, baptist, null, listener);
return baptist.result();
}

The Implementation guide has no reference to this older 1.3 method:



Should I override the method or has the API moved on and replaced this with a 2.x implementation?

--
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/CANfRfr2cgHnKH5g4v_A7k12Pto7Sg30cb4N1VYJn-i27UQZxYQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--------------------------------------------------------------------------------
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
--------------------------------------------------------------------------------

Jesse Glick

unread,
Aug 18, 2017, 12:41:34 PM8/18/17
to Jenkins Dev
On Fri, Aug 18, 2017 at 12:28 PM, Paul Allen <pal...@perforce.com> wrote:
> I can't find any 2.0 methods in the documentation link
> you sent - is this out-of-date?

Apparently. I do not know what process generated this Javadoc. You can
file a JIRA ticket in the INFRA project.

> The Implementation guide has no reference to this older 1.3 method:
>
> https://github.com/jenkinsci/scm-api-plugin/blob/master/docs/implementation.adoc

“Feel free” to file a PR mentioning it. This method is needed for
Pipeline libraries and might have other use cases as well.

> Should I override the method

Yes. (It is unrelated to 2.x changes.)
Reply all
Reply to author
Forward
0 new messages