Migrate SonarQube plugin to new Jenkins API: question on Callable::checkRoles

93 views
Skip to first unread message

Julien HENRY

unread,
Mar 6, 2015, 9:33:55 AM3/6/15
to jenkin...@googlegroups.com
Hi guys,

I'm trying to upgrade SQ plugin to new Jenkins API. I discovered the new method to be implemented on Callable and I have read https://wiki.jenkins-ci.org/display/JENKINS/Slave+To+Master+Access+Control. But still I'm not sure of what to do.

In SonarRunnerBuilder [1] we need to get the path of the installed SonarRunner tool. The code was largely inspired from Ant plugin:

What do you suggest to me? Should I use MasterToSlaveCallable ?

Thanks

Julien

 

Jesse Glick

unread,
Mar 6, 2015, 11:51:53 AM3/6/15
to Jenkins Dev
On Fri, Mar 6, 2015 at 9:33 AM, 'Julien HENRY' via Jenkins Developers
<jenkin...@googlegroups.com> wrote:
> What do you suggest to me? Should I use MasterToSlaveCallable ?

Yes. Does the wiki need to be clarified?

Julien HENRY

unread,
Mar 6, 2015, 11:59:56 AM3/6/15
to jenkin...@googlegroups.com
> Does the wiki need to be clarified?

In fact it's just that I don't know what is my situation (Master To Slave, Slave To Master, other?). Here I have a Builder extension "perform" method that need to know where is located the InstallableTool on the slave running the build. But I don't know where is executed the "perform" method. My guess was that it was executed on master (Master to Slave) but maybe it could be directly executed on the slave. In this case maybe there was no need for the Callable stuff.

Anyway thanks for the answer.

++

Julien


De : Jesse Glick <jgl...@cloudbees.com>
À : Jenkins Dev <jenkin...@googlegroups.com>
Envoyé le : Vendredi 6 mars 2015 17h51
Objet : Re: Migrate SonarQube plugin to new Jenkins API: question on Callable::checkRoles

On Fri, Mar 6, 2015 at 9:33 AM, 'Julien HENRY' via Jenkins Developers



<jenkin...@googlegroups.com> wrote:
> What do you suggest to me? Should I use MasterToSlaveCallable ?




--
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-dev+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr0sM-rLBs2ofpme_OstB0OiL9%2Bo%2BZP0Uh-A64Lbrm%3D7dw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.



Jesse Glick

unread,
Mar 6, 2015, 2:28:37 PM3/6/15
to Jenkins Dev
On Fri, Mar 6, 2015 at 11:59 AM, 'Julien HENRY' via Jenkins Developers
<jenkin...@googlegroups.com> wrote:
> I don't know where is executed the "perform" method.

Always on the master. Anything the slave does happens via the remoting
channel, though this is typically hidden from you by FilePath and
Launcher.

vinodhi...@gmail.com

unread,
May 26, 2015, 7:50:56 AM5/26/15
to jenkin...@googlegroups.com
Hello All,

I have a similar issue after I upgraded to LTS 1.580.3.  We would run our callable code either in Master or Slave.

Instead of using Callable, I am using MasterToSlaveCallable now. It was mentioned in the comments (https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/jenkins/security/MasterToSlaveCallable.java ) that  :

"Convenient {@link Callable} meant to be run on slave.".

May I know if I use MasterToSlaveCallable class, will my callable could be run in both Master and Slave?

Kindly help me !

Thanks.

Reply all
Reply to author
Forward
0 new messages