Re: WorkflowJob getDescriptor Null

2017-08-28 Thread Shaun Thompson
To answer my own question, the issue was that I was trying to access the 
Workflow job before Jenkins had properly loaded the extension.

The following change allowed me to create a Workflow job dynamically
*@Initializer(after = InitMilestone.EXTENSIONS_AUGMENTED)*
public void initProject() {
try {
for (final WorkflowJob job : 
Util.createSubList(jenkins().getItemMap().values(), WorkflowJob.class)) {
if (job.getDisplayName().equalsIgnoreCase(projectName())) {
workflowJob = job;
}
}
if (workflowJob == null) {
workflowJob = jenkins().createProject(WorkflowJob.class, 
ReleaseManagementPlugin.class.getSimpleName());
}
} catch (final Exception ex) {
throw ReleaseException.builder().with(ex).build();
}
}




On Monday, August 28, 2017 at 2:11:08 PM UTC-5, Shaun Thompson wrote:
>
>
> From the command line it works.  It looks like I'll have to dig into the 
> extensions bit and see how this is getting setup.
>
> On Friday, August 25, 2017 at 2:23:38 PM UTC-5, Jesse Glick wrote:
>>
>> On Fri, Aug 25, 2017 at 12:52 PM, Shaun Thompson  
>> wrote: 
>> > What's seems odd to me is that the tests supplied with the workflow 
>> plugin 
>> > show the same issue when I run it locally. 
>> > 
>> > Any idea on what's going on? 
>>
>> Something is seriously wrong in your test environment. Close your IDE, 
>> open a command shell, and try 
>>
>> mvn clean test 
>>
>> Or, for paranoid Linux users, 
>>
>> alias dockermvn='docker run -v ~/.m2:/var/maven/.m2 -ti --rm --name 
>> mvn -u $(id -u):$(id -g) -e MAVEN_CONFIG=/var/maven/.m2 -v 
>> "$PWD":/usr/src/mymaven -w /usr/src/mymaven maven:3.5.0-jdk-8 mvn 
>> -Duser.home=/var/maven' 
>> dockermvn clean test 
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/00b3650b-b250-442b-90d2-44b70438e01b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: WorkflowJob getDescriptor Null

2017-08-28 Thread Shaun Thompson

>From the command line it works.  It looks like I'll have to dig into the 
extensions bit and see how this is getting setup.

On Friday, August 25, 2017 at 2:23:38 PM UTC-5, Jesse Glick wrote:
>
> On Fri, Aug 25, 2017 at 12:52 PM, Shaun Thompson  > wrote: 
> > What's seems odd to me is that the tests supplied with the workflow 
> plugin 
> > show the same issue when I run it locally. 
> > 
> > Any idea on what's going on? 
>
> Something is seriously wrong in your test environment. Close your IDE, 
> open a command shell, and try 
>
> mvn clean test 
>
> Or, for paranoid Linux users, 
>
> alias dockermvn='docker run -v ~/.m2:/var/maven/.m2 -ti --rm --name 
> mvn -u $(id -u):$(id -g) -e MAVEN_CONFIG=/var/maven/.m2 -v 
> "$PWD":/usr/src/mymaven -w /usr/src/mymaven maven:3.5.0-jdk-8 mvn 
> -Duser.home=/var/maven' 
> dockermvn clean test 
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/840e611c-74ae-4d2a-b94d-fd841479ea0a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Request to join Jenkins Security Team

2017-08-28 Thread R. Tyler Croy
(replies inline)

On Mon, 28 Aug 2017, Christopher Orr wrote:

> Hi there,
> 
> I'd like to request to join the security team.
> I've got all the prerequisites listed (2FA, CLA, nickname on IRC).


Heh, I'm actually surprised you weren't already part of it. :)



- R. Tyler Croy

--
 Code: 
  Chatter: 
 xmpp: rty...@jabber.org

  % gpg --keyserver keys.gnupg.net --recv-key 1426C7DC3F51E16F
--

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/20170828173443.vlqueszqnl36zwqr%40blackberry.coupleofllamas.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


Request to join Jenkins Security Team

2017-08-28 Thread Christopher Orr
Hi there,

I'd like to request to join the security team.
I've got all the prerequisites listed (2FA, CLA, nickname on IRC).

Thanks,
Chris

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/1503941343.3112205.1087569072.66BA5581%40webmail.messagingengine.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to add support for InterruptedException to a plugin?

2017-08-28 Thread Daniel Anechitoaie
How do I create a request for enhancement for Jenkins?
I can try and do this and hopefully someone that has experience will 
implement it at some point, but not sore where and how to create this RFE.


On Monday, August 28, 2017 at 3:19:12 PM UTC+3, Jesse Glick wrote:
>
> On Mon, Aug 28, 2017 at 8:00 AM, Daniel Anechitoaie 
>  wrote: 
> > The problem is that that if I click cancel on the job it still runs 
> until by 
> > build step is finished and all files are zipped and uploaded and only 
> then 
> > it marks the build as aborted. 
> > Is there any way to check from my plugin if the job was aborted and just 
> > stop wherever I am in the build? 
>
> I do not think so. Sounds like an RFE for Jenkins core / Remoting: 
> interrupting a synchronous remote call should `Thread.interrupt` the 
> corresponding thread on the remote side. 
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/4603f8b5-7f5e-4964-8a91-6dd1f4e2acd6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: new Cloud Provider remoting trouble

2017-08-28 Thread Steven F
Tried with Jenkins 2.76 and remoting 3.11, no more detail on the server 
computer log. In the remoting logs I get this:

Aug 28, 2017 1:07:56 PM hudson.remoting.UserRequest perform
WARNING: LinkageError while performing 
UserRequest:hudson.FilePath$FileCallableWrapper@206a0d26
java.lang.LinkageError: Failed to load jenkins.util.SystemProperties
at 
hudson.remoting.RemoteClassLoader.loadClassFile(RemoteClassLoader.java:385)
at 
hudson.remoting.RemoteClassLoader.findClass(RemoteClassLoader.java:293)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at hudson.FilePath.(FilePath.java:2363)
at sun.misc.Unsafe.ensureClassInitialized(Native Method)
at 
sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:43)
at 
sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:156)
at java.lang.reflect.Field.acquireFieldAccessor(Field.java:1088)
at java.lang.reflect.Field.getFieldAccessor(Field.java:1069)
at java.lang.reflect.Field.getLong(Field.java:611)
at 
java.io.ObjectStreamClass.getDeclaredSUID(ObjectStreamClass.java:1707)
at java.io.ObjectStreamClass.access$700(ObjectStreamClass.java:72)
at java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:484)
at java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:472)
at java.security.AccessController.doPrivileged(Native Method)
at java.io.ObjectStreamClass.(ObjectStreamClass.java:472)
at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:369)
at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:598)
at 
java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1843)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1713)
at 
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2000)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1535)
at 
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2245)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2169)
at 
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2027)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1535)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:422)
at hudson.remoting.UserRequest.deserialize(UserRequest.java:272)
at hudson.remoting.UserRequest.perform(UserRequest.java:183)
at hudson.remoting.UserRequest.perform(UserRequest.java:52)
at hudson.remoting.Request$2.run(Request.java:356)
at 
hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NoClassDefFoundError: 
javax/servlet/ServletContextListener
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.lang.ClassLoader.defineClass(ClassLoader.java:642)
at 
hudson.remoting.RemoteClassLoader.loadClassFile(RemoteClassLoader.java:381)
... 36 more
Caused by: java.lang.ClassNotFoundException: 
javax.servlet.ServletContextListener
at 
hudson.remoting.RemoteClassLoader$ClassLoaderProxy.fetch(RemoteClassLoader.java:789)
at sun.reflect.GeneratedMethodAccessor217.invoke(Unknown Source)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at 
hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:899)
at hudson.remoting.Request$2.run(Request.java:356)
at 
hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
at 
org.jenkinsci.remoting.CallableDecorator.call(CallableDecorator.java:19)
at 
hudson.remoting.CallableDecoratorList$1.call(CallableDecoratorList.java:21)
at 
jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
at ..remote call to channel(Native Method)
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1647)
at hudson.remoting.Request.call(Request.java:190)
at 
hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:263)
at com.sun.proxy.$Proxy5.fetch(Unknown Source)
at 
hudson.remoting.RemoteClassLoader.findClass(RemoteClassLoader.java:301)
at 

Configurations getting removed after my build.

2017-08-28 Thread phanikumar
Hello team,

I have developed a custom plugin and provided few fields as shown below.



  

  
  

  
  

  
  

  
  

  


Now, the issue is when I complete my first build the values from hostname
and username getting disappeared. Can someone help me out on this



--
View this message in context: 
http://jenkins-ci.361315.n4.nabble.com/Configurations-getting-removed-after-my-build-tp4901615.html
Sent from the Jenkins dev mailing list archive at Nabble.com.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/1503926237559-4901615.post%40n4.nabble.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to add support for InterruptedException to a plugin?

2017-08-28 Thread Jesse Glick
On Mon, Aug 28, 2017 at 8:00 AM, Daniel Anechitoaie
 wrote:
> The problem is that that if I click cancel on the job it still runs until by
> build step is finished and all files are zipped and uploaded and only then
> it marks the build as aborted.
> Is there any way to check from my plugin if the job was aborted and just
> stop wherever I am in the build?

I do not think so. Sounds like an RFE for Jenkins core / Remoting:
interrupting a synchronous remote call should `Thread.interrupt` the
corresponding thread on the remote side.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr2RSxnsLGY9JbKOQWxXKXR1gFxcqrh4sLhFjhiEc0d9Yg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


How to add support for InterruptedException to a plugin?

2017-08-28 Thread Daniel Anechitoaie
Hi,

Any idea how can I add support for InterruptedException to my plugin?
I have a builder plugin that zips some files from the workspace and then 
uploads them on a remote server.

The flow is basically like this:

---
public void perform(@Nonnull Run build, @Nonnull FilePath workspace,
@Nonnull Launcher launcher, @Nonnull TaskListener 
listener) throws IOException {

launcher.getChannel().call(deployCallable);
}
---

deployCallable is an instance of a inner class described bellow:

---
private static class DeployCallable extends MasterToSlaveCallable { // So it works in master/slave setup

private static final long serialVersionUID = 1L;

public Boolean call() throws InterruptedException {
   for folder in path {
  zip(folder);
   }

   for zip in zipFiles {
  upload(zip); // Using Apache HTTP Client
   }
}
}
---


The problem is that that if I click cancel on the job it still runs until 
by build step is finished and all files are zipped and uploaded and only 
then it marks the build as aborted.
Is there any way to check from my plugin if the job was aborted and just 
stop wherever I am in the build?
Let's say I just created the zips and user clicks on cancel, how do I stop 
here and not also upload all zips?

Thank you.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/dd13bde5-830d-49c9-a18d-a41d555e2e7b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.