Re: Cannot login to https://repo.jenkins-ci.org/webapp/

2021-02-22 Thread Daniel Anechitoaie
Awesome. This helped and I can now login. Thank you!

On Monday, February 22, 2021 at 7:10:16 PM UTC+2 ga...@gavinmogan.com wrote:

> Its using ldap, and the current easiest way to reset your ldap credentials 
> is https://beta.accounts.jenkins.io
>
> On Mon, Feb 22, 2021 at 9:08 AM Daniel Anechitoaie  
> wrote:
>
>> I'm trying to login to https://repo.jenkins-ci.org/webapp/#/login to 
>> deploy a new version of my plugin but I cannot login. Trying to click on 
>> forgot password doesn't work as well. I get an error:
>>
>> {"error":"The specified user is not permitted to reset his password."}
>>
>> Any idea what's wrong? And How can I recover my login details?  My 
>> username is: danechitoaie
>>
>> -- 
>> 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/e5101aec-b73a-4e7e-a36d-5e736d67d181n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-dev/e5101aec-b73a-4e7e-a36d-5e736d67d181n%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
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/ac589e61-5779-4c1c-8c24-f6b5a64207f5n%40googlegroups.com.


Cannot login to https://repo.jenkins-ci.org/webapp/

2021-02-22 Thread Daniel Anechitoaie
I'm trying to login to https://repo.jenkins-ci.org/webapp/#/login to deploy 
a new version of my plugin but I cannot login. Trying to click on forgot 
password doesn't work as well. I get an error:

{"error":"The specified user is not permitted to reset his password."}

Any idea what's wrong? And How can I recover my login details?  My username 
is: danechitoaie

-- 
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/e5101aec-b73a-4e7e-a36d-5e736d67d181n%40googlegroups.com.


Re: I'm working on a new plugin and when I try to run it I get the following error

2020-02-24 Thread Daniel Anechitoaie
Will do. Is OpenJDK ok? Or i need Oracle JDK?

On Monday, February 24, 2020 at 8:35:39 PM UTC+2, Jesse Glick wrote:
>
> On Mon, Feb 24, 2020 at 12:05 PM Daniel Anechitoaie 
> > wrote: 
> > I'm compiling on OpenJDK 11. 
>
> Best to use JDK 8 for all purposes related to Jenkins. 
>

-- 
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/b925de42-af7a-4047-92bb-01b39b69d6a6%40googlegroups.com.


Re: I'm working on a new plugin and when I try to run it I get the following error

2020-02-24 Thread Daniel Anechitoaie
Yes, that was it. I'm compiling on OpenJDK 11.
Using 2.164.1 works now even with parent 
POM 3.56

Thank you.


On Monday, February 24, 2020 at 6:30:39 PM UTC+2, Mark Waite wrote:
>
>
>
> On Mon, Feb 24, 2020 at 9:19 AM Daniel Anechitoaie  > wrote:
>
>> Hmm, yeah, I had a small brainfart. For some reason I was thinking in 
>> decimal and was seeing 3.6 as 3.60 which in my mind was more recent than 
>> 3.56 (which is the latest 3.x version)/
>>
>> So now with 
>>
>> 
>> org.jenkins-ci.plugins
>> plugin
>> 3.56
>> 
>> 
>>
>>
>>
>> And 
>>
>> 
>> 1.8
>> 8
>> 2.121.1
>> 
>>
>>
>>
>> I get
>>
>> [ERROR] Failed to execute goal 
>> org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile 
>> (default-compile) on project my-plugin: Compilation failure
>> [ERROR] java.nio.file.NoSuchFileException: 
>> /Users/daniels/Work/my-plugin/target/classes/META-INF/annotations/hudson.Extension
>>
>> Should I just go to latest Jenkins and the 4.0 beta parent pom?
>>
>>
> I receive that message when I'm compiling with Java 11 but using a Jenkins 
> version before 2.164.  The first Jenkins LTS to support Java 11 compilation 
> is Jenkins 2.164 (as far as I know)  I've learned to type:
>
> $ mvn clean -Djenkins.version=2.164.3 verify
>
> Eventually, I will update the plugins where I use that technique so that 
> they require Jenkins 2.164 or newer as their minimum version.  Jenkins 
> 2.164 is over a year old.  
>

-- 
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/723e6cd0-0774-4903-8f3f-f33d1e00567f%40googlegroups.com.


Re: I'm working on a new plugin and when I try to run it I get the following error

2020-02-24 Thread Daniel Anechitoaie
Hmm, yeah, I had a small brainfart. For some reason I was thinking in 
decimal and was seeing 3.6 as 3.60 which in my mind was more recent than 
3.56 (which is the latest 3.x version)/

So now with 


org.jenkins-ci.plugins
plugin
3.56





And 


1.8
8
2.121.1




I get

[ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile 
(default-compile) on project my-plugin: Compilation failure
[ERROR] java.nio.file.NoSuchFileException: 
/Users/daniels/Work/my-plugin/target/classes/META-INF/annotations/hudson.Extension

Should I just go to latest Jenkins and the 4.0 beta parent pom?

On Monday, February 24, 2020 at 5:58:39 PM UTC+2, Jesse Glick wrote:
>
> On Mon, Feb 24, 2020 at 10:29 AM Daniel Anechitoaie 
> > wrote: 
> >  
> > org.jenkins-ci.plugins 
> > plugin 
> > 3.6 
>
> This is very old. Try using the latest 3.x, and for the newer LTS line 
> you may need to use a 4.0 beta. 
>

-- 
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/89819385-f68d-485b-9c11-30acad69c7ca%40googlegroups.com.


I'm working on a new plugin and when I try to run it I get the following error

2020-02-24 Thread Daniel Anechitoaie
Hi,

I just started working on a new plugin and when I run mvn hpi:run I get the 
following error:

Failed while enforcing RequireUpperBoundDeps. The error(s) are [
Require upper bound dependencies error for org.slf4j:jcl-over-slf4j:1.7.25 
paths to dependency are:
+-io.jenkins.plugins:my-plugin:1.0.0
  +-org.slf4j:jcl-over-slf4j:1.7.25
and
+-io.jenkins.plugins:my-plugin:1.0.0
  +-org.jenkins-ci.main:jenkins-core:2.204.2
+-org.slf4j:jcl-over-slf4j:1.7.26
,
Require upper bound dependencies error for 
org.slf4j:log4j-over-slf4j:1.7.25 paths to dependency are:
+-io.jenkins.plugins:my-plugin:1.0.0
  +-org.slf4j:log4j-over-slf4j:1.7.25
and
+-io.jenkins.plugins:my-plugin:1.0.0
  +-org.jenkins-ci.main:jenkins-core:2.204.2
+-org.slf4j:log4j-over-slf4j:1.7.26
,
Require upper bound dependencies error for org.slf4j:slf4j-jdk14:1.7.25 
paths to dependency are:
+-io.jenkins.plugins:my-plugin:1.0.0
  +-org.slf4j:slf4j-jdk14:1.7.25
and
+-io.jenkins.plugins:my-plugin:1.0.0
  +-org.jenkins-ci.main:jenkins-war:2.204.2
+-org.slf4j:slf4j-jdk14:1.7.26
]

Any idea what's going on and what I can do to fix this? 
I don't have any direct dependencies to org.slf4j

Here's my POM as well:

---


http://maven.apache.org/POM/4.0.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd;>

4.0.0


org.jenkins-ci.plugins
plugin
3.6



io.jenkins.plugins
my-plugin
1.0.0
hpi

My Plugin




1.8
8
2.204.2





org.apache.maven.plugins
maven-compiler-plugin

${jdk.version}
${jdk.version}
true



org.jenkins-ci.tools
maven-hpi-plugin

true







repo.jenkins-ci.org
https://repo.jenkins-ci.org/public/





repo.jenkins-ci.org
https://repo.jenkins-ci.org/public/






org.jenkins-ci.plugins
structs
1.17




org.apache.commons
commons-lang3
3.9




org.apache.commons
commons-text
1.8




commons-io
commons-io
2.6




org.codehaus.plexus
plexus-utils
3.3.0



org.jsoup
jsoup
1.12.2




-- 
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/00ff633f-fe59-4861-a7fc-80b07ea0d8c0%40googlegroups.com.


Re: Is there ant API/way to make a plugin that runs some action periodically?

2020-01-08 Thread Daniel Anechitoaie
Awesome. So there are two options, this one with AsyncPeriodicWorker and 
the one from @Jeff where you can run it after each job.
I'll look into seeing which one fits best for the current use case.

Thank you.


On Wednesday, January 8, 2020 at 6:54:50 PM UTC+2, Jesse Glick wrote:
>
> On Wed, Jan 8, 2020 at 10:37 AM Daniel Anechitoaie 
> > wrote: 
> > Some Jenkins Java API that would allow me to run some code in the 
> background every day or so. 
>
> https://javadoc.jenkins.io/hudson/model/AsyncPeriodicWork.html 
>

-- 
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/783b22ad-ed65-4021-bdd1-0d497b3cd703%40googlegroups.com.


Re: Is there ant API/way to make a plugin that runs some action periodically?

2020-01-08 Thread Daniel Anechitoaie
That's great idea. Thank you Jeff.

On Wednesday, January 8, 2020 at 6:20:43 PM UTC+2, Jeff wrote:
>
> You could also write a plugin that implements the RunListener extension, 
> and gather the stats as the jobs complete. In some sense, that might be 
> better, because you don't have to worry about builds being discarded before 
> it runs.  Here's an example of that 
> https://github.com/jenkinsci/github-autostatus-plugin/blob/master/src/main/java/org/jenkinsci/plugins/githubautostatus/BuildStatusJobListener.java#L62
>  
>
> On Wed, Jan 8, 2020 at 7:57 AM Jeff Pearce  > wrote:
>
>> I think the Thin Backup plugin does that; you might look at it for ideas.
>>
>>  
>>
>> *From: *> on behalf of Daniel 
>> Anechitoaie >
>> *Reply-To: *"jenkin...@googlegroups.com " <
>> jenkin...@googlegroups.com >
>> *Date: *Wednesday, January 8, 2020 at 7:38 AM
>> *To: *Jenkins Developers >
>> *Subject: *Is there ant API/way to make a plugin that runs some action 
>> periodically?
>>
>>  
>>
>> Notice: This email is from an external sender. 
>>
>>  
>>
>> I need to gather some statistics (nr of jobs, nr of builds, their status, 
>> etc) for our internal Jenkins and post that report to some HTTPS endpoint. 
>>
>> Is there a way that I can make a plugin or something, that is not an 
>> actual job, so that doesn't require an actual agent/worker that will do 
>> this?
>>
>> Some Jenkins Java API that would allow me to run some code in the 
>> background every day or so. Kind of like how Jenkins checks for plugin 
>> updates, new versions, etc.
>>
>>  
>>
>> My other option would be to use the REST API and pull this data out of 
>> Jekins if possible but I think pushing it from Jenkins might be better in 
>> my case.
>>
>>  
>>
>> Is there any way this can be done? And APIs that Jenkins has for this? 
>> Any particular Java class that needs to be extended.
>>
>>  
>>
>> 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 jenkin...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-dev/7c041c4d-2f5e-4f1d-8803-782e40bbdd80%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-dev/7c041c4d-2f5e-4f1d-8803-782e40bbdd80%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>> -- 
>> 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 jenkin...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-dev/783F8984-1D7A-4F7E-96B9-6C6DF959C1BD%40godaddy.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-dev/783F8984-1D7A-4F7E-96B9-6C6DF959C1BD%40godaddy.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
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/fbc806c0-3049-4a81-8ae8-4169545d3545%40googlegroups.com.


Is there ant API/way to make a plugin that runs some action periodically?

2020-01-08 Thread Daniel Anechitoaie
I need to gather some statistics (nr of jobs, nr of builds, their status, 
etc) for our internal Jenkins and post that report to some HTTPS endpoint.
Is there a way that I can make a plugin or something, that is not an actual 
job, so that doesn't require an actual agent/worker that will do this?
Some Jenkins Java API that would allow me to run some code in the 
background every day or so. Kind of like how Jenkins checks for plugin 
updates, new versions, etc.

My other option would be to use the REST API and pull this data out of 
Jekins if possible but I think pushing it from Jenkins might be better in 
my case.

Is there any way this can be done? And APIs that Jenkins has for this? Any 
particular Java class that needs to be extended.

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/7c041c4d-2f5e-4f1d-8803-782e40bbdd80%40googlegroups.com.


Re: Any idea why a TaskListenerDecorator could cause logger.println() to throw null pointer exception

2019-04-17 Thread Daniel Anechitoaie
What's strange is that if I use sh() step it works ok. Isn't sh step also 
executing on the slave?

So this works fine:

---
node {
stage('Test') {
withCodeReviewAssistantGitHubCheckRun(args) {
sh('ls -alh')
}
}
}
---


On Wednesday, April 17, 2019 at 6:47:49 PM UTC+3, Daniel Anechitoaie wrote:
>
> I'm using 
>
> 
> org.jenkins-ci.plugins
> plugin
> 3.6
> 
> 
>
>
> Is this the latest parent POM? I'm not sure how to check which is the 
> latest version available.
>
> On Wednesday, April 17, 2019 at 6:09:07 PM UTC+3, Jesse Glick wrote:
>>
>> On Wed, Apr 17, 2019 at 10:47 AM Daniel Anechitoaie 
>>  wrote: 
>> > So I think the problem might be with serialization and they way I try 
>> to capture data in TaskListenerDecorator 
>>
>> Probably. You should not be attempting to serialize a `StepExecution` 
>> there; it can only be saved in `program.dat`, whereas 
>> `TaskListenerDecorator` is sent to agent JVMs under some conditions 
>> (including your own `XMLLinterStepCallable`). Anyway your code could 
>> not possibly work as written since the `addBodyOutputLine` call would 
>> be made on a _copy_ of the original object, not the one actually used 
>> in the callback. If this output is important, you would need to 
>> explicitly stream it back to the master somehow, as in 
>>
>>
>> https://github.com/jenkinsci/workflow-basic-steps-plugin/blob/5d48ed444cd4041d4b00a2c7197559406d1a2c9a/src/main/java/org/jenkinsci/plugins/workflow/steps/TimeoutStepExecution.java#L255-L336
>>  
>>
>> (You must be very defensive when writing a `SlaveToMasterCallable`, so 
>> this is not for the faint-hearted, but it seems you have already 
>> gotten into some pretty advanced usage.) 
>>
>>
>> There may be some error being printed that you are not seeing 
>> currently—make sure you use the newest parent POM, and call the new 
>> API in 
>>
>> https://github.com/jenkinsci/jenkins-test-harness/pull/127 
>>
>> from your tests. 
>>
>>
>> BTW pending availability of 
>>
>> https://github.com/jenkinsci/jenkins/pull/3959 
>>
>> in your `jenkins.version`, you must override `flush` and `close` as 
>> shown there. Also `XMLLinterStepCallable.invoke` should `flush` before 
>> exiting. 
>>
>

-- 
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/dede9132-120f-4eb5-806e-06a2db04163b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Any idea why a TaskListenerDecorator could cause logger.println() to throw null pointer exception

2019-04-17 Thread Daniel Anechitoaie
I'm using 


org.jenkins-ci.plugins
plugin
3.6




Is this the latest parent POM? I'm not sure how to check which is the 
latest version available.

On Wednesday, April 17, 2019 at 6:09:07 PM UTC+3, Jesse Glick wrote:
>
> On Wed, Apr 17, 2019 at 10:47 AM Daniel Anechitoaie 
> > wrote: 
> > So I think the problem might be with serialization and they way I try to 
> capture data in TaskListenerDecorator 
>
> Probably. You should not be attempting to serialize a `StepExecution` 
> there; it can only be saved in `program.dat`, whereas 
> `TaskListenerDecorator` is sent to agent JVMs under some conditions 
> (including your own `XMLLinterStepCallable`). Anyway your code could 
> not possibly work as written since the `addBodyOutputLine` call would 
> be made on a _copy_ of the original object, not the one actually used 
> in the callback. If this output is important, you would need to 
> explicitly stream it back to the master somehow, as in 
>
>
> https://github.com/jenkinsci/workflow-basic-steps-plugin/blob/5d48ed444cd4041d4b00a2c7197559406d1a2c9a/src/main/java/org/jenkinsci/plugins/workflow/steps/TimeoutStepExecution.java#L255-L336
>  
>
> (You must be very defensive when writing a `SlaveToMasterCallable`, so 
> this is not for the faint-hearted, but it seems you have already 
> gotten into some pretty advanced usage.) 
>
>
> There may be some error being printed that you are not seeing 
> currently—make sure you use the newest parent POM, and call the new 
> API in 
>
> https://github.com/jenkinsci/jenkins-test-harness/pull/127 
>
> from your tests. 
>
>
> BTW pending availability of 
>
> https://github.com/jenkinsci/jenkins/pull/3959 
>
> in your `jenkins.version`, you must override `flush` and `close` as 
> shown there. Also `XMLLinterStepCallable.invoke` should `flush` before 
> exiting. 
>

-- 
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/efc88986-b84c-46c9-8caf-5ae313eb8397%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Any idea why a TaskListenerDecorator could cause logger.println() to throw null pointer exception

2019-04-17 Thread Daniel Anechitoaie
Nope. I'm still getting NullPointerException even with 

getContext().newBodyInvoker() .withContexts(environmentExpander, 
taskListenerDecorator) 
.withCallback(BodyExecutionCallback.wrap(getContext())) .start(); 

So something else must be the issue but not sure what.


On Wednesday, April 17, 2019 at 4:54:53 PM UTC+3, Daniel Anechitoaie wrote:
>
> I suspect my problem is with .withCallback(new 
> WithCheckRunStepExecutionCallback(this)) ?
> But then if I use ".withCallback(BodyExecutionCallback.wrap(getContext()))" 
> instead, how will I be able to read a variable from within StepExecution 
> class?
>
>
>
> On Wednesday, April 17, 2019 at 4:18:28 PM UTC+3, Daniel Anechitoaie wrote:
>>
>> I have a pipeline step plugin that wraps other steps and captures the 
>> output and for some reason this causes a Null Pointer Exception when I try 
>> to do logger.println() from the step plugin that is wrapped.
>>
>> *So with this pipeline:*
>> ---
>> node {
>> stage('Test') {
>> withCodeReviewAssistantGitHubCheckRun(args) {
>> codeReviewAssistantXMLLint()
>> }
>> }
>> }
>> ---
>>
>>
>> *withCodeReviewAssistantGitHubCheckRun having a:*
>> ---
>> private static class 
>> WithCheckRunStepExecutionTaskListenerDecorator extends 
>> TaskListenerDecorator {
>> private static final long serialVersionUID = 1;
>> private WithCheckRunStepExecution withCheckRunStepExecution;
>>
>> 
>> WithCheckRunStepExecutionTaskListenerDecorator(WithCheckRunStepExecution 
>> withCheckRunStepExecution) {
>> this.withCheckRunStepExecution = 
>> withCheckRunStepExecution;
>> }
>>
>> @Nonnull
>> @Override
>> public OutputStream decorate(@Nonnull final OutputStream 
>> outputStream) {
>> return new LineTransformationOutputStream() {
>> @Override
>> protected void eol(byte[] b, int len) throws 
>> IOException {
>> synchronized (outputStream) {
>> 
>> withCheckRunStepExecution.addBodyOutputLine(b, len);
>> outputStream.write(b, 0, len);
>> }
>> }
>> };
>> }
>> }
>> ---
>>
>>
>> *that's used like:*
>> ---
>> EnvironmentExpander environmentExpander = 
>> EnvironmentExpander.merge(
>> getContext().get(EnvironmentExpander.class),
>> new WithCheckRunStepExecutionEnvironmentExpander(new 
>> EnvVars())
>> );
>>
>> TaskListenerDecorator taskListenerDecorator = 
>> TaskListenerDecorator.merge(
>> getContext().get(TaskListenerDecorator.class),
>> new 
>> WithCheckRunStepExecutionTaskListenerDecorator(this)
>> );
>>
>> getContext().newBodyInvoker()
>> .withContexts(environmentExpander, 
>> taskListenerDecorator)
>> .withCallback(new 
>> WithCheckRunStepExecutionCallback(this))
>> .start();
>> ---
>>
>>
>>
>> *And codeReviewAssistantXMLLint is basically:*
>> ---
>> public class XMLLinterStep extends Step {
>> @Override
>> public StepExecution start(StepContext context) {
>> return new XMLLinterStepExecution(this, context);
>> }
>>
>> private static class XMLLinterStepExecution extends 
>> SynchronousNonBlockingStepExecution {
>> private static final long serialVersionUID = 1L;
>> private transient final XMLLinterStep step;
>>
>> XMLLinterStepExecution(XMLLinterStep step, StepContext context) {
>> super(context);
>> this.step = step;
>> }
>>
>> @Override
>> protected Void run() throws IOException, InterruptedException {
>> TaskListener taskListener = 
>> getContext().get(TaskListener.class);
>> Objects.requireNonNull(taskListener, "Failed to get 
>> TaskListener.class");
>>
>> FilePath filePath = getContext().get(FilePath.class);
>> Objects.requireNonNull(filePath, "Failed to get 
>> FilePath.class");
>>
>> if (!filePath.exists()) {
>> fil

Re: Any idea why a TaskListenerDecorator could cause logger.println() to throw null pointer exception

2019-04-17 Thread Daniel Anechitoaie
I suspect my problem is with .withCallback(new 
WithCheckRunStepExecutionCallback(this)) ?
But then if I use ".withCallback(BodyExecutionCallback.wrap(getContext()))" 
instead, how will I be able to read a variable from within StepExecution 
class?



On Wednesday, April 17, 2019 at 4:18:28 PM UTC+3, Daniel Anechitoaie wrote:
>
> I have a pipeline step plugin that wraps other steps and captures the 
> output and for some reason this causes a Null Pointer Exception when I try 
> to do logger.println() from the step plugin that is wrapped.
>
> *So with this pipeline:*
> ---
> node {
> stage('Test') {
> withCodeReviewAssistantGitHubCheckRun(args) {
> codeReviewAssistantXMLLint()
> }
> }
> }
> ---
>
>
> *withCodeReviewAssistantGitHubCheckRun having a:*
> ---
> private static class 
> WithCheckRunStepExecutionTaskListenerDecorator extends 
> TaskListenerDecorator {
> private static final long serialVersionUID = 1;
> private WithCheckRunStepExecution withCheckRunStepExecution;
>
> 
> WithCheckRunStepExecutionTaskListenerDecorator(WithCheckRunStepExecution 
> withCheckRunStepExecution) {
> this.withCheckRunStepExecution = withCheckRunStepExecution;
> }
>
> @Nonnull
> @Override
> public OutputStream decorate(@Nonnull final OutputStream 
> outputStream) {
> return new LineTransformationOutputStream() {
> @Override
> protected void eol(byte[] b, int len) throws 
> IOException {
> synchronized (outputStream) {
> withCheckRunStepExecution.addBodyOutputLine(b, 
> len);
> outputStream.write(b, 0, len);
> }
> }
> };
> }
> }
> ---
>
>
> *that's used like:*
> ---
> EnvironmentExpander environmentExpander = 
> EnvironmentExpander.merge(
> getContext().get(EnvironmentExpander.class),
> new WithCheckRunStepExecutionEnvironmentExpander(new 
> EnvVars())
> );
>
> TaskListenerDecorator taskListenerDecorator = 
> TaskListenerDecorator.merge(
> getContext().get(TaskListenerDecorator.class),
> new 
> WithCheckRunStepExecutionTaskListenerDecorator(this)
> );
>
> getContext().newBodyInvoker()
> .withContexts(environmentExpander, 
> taskListenerDecorator)
> .withCallback(new 
> WithCheckRunStepExecutionCallback(this))
> .start();
> ---
>
>
>
> *And codeReviewAssistantXMLLint is basically:*
> ---
> public class XMLLinterStep extends Step {
> @Override
> public StepExecution start(StepContext context) {
> return new XMLLinterStepExecution(this, context);
> }
>
> private static class XMLLinterStepExecution extends 
> SynchronousNonBlockingStepExecution {
> private static final long serialVersionUID = 1L;
> private transient final XMLLinterStep step;
>
> XMLLinterStepExecution(XMLLinterStep step, StepContext context) {
> super(context);
> this.step = step;
> }
>
> @Override
> protected Void run() throws IOException, InterruptedException {
> TaskListener taskListener = 
> getContext().get(TaskListener.class);
> Objects.requireNonNull(taskListener, "Failed to get 
> TaskListener.class");
>
> FilePath filePath = getContext().get(FilePath.class);
> Objects.requireNonNull(filePath, "Failed to get 
> FilePath.class");
>
> if (!filePath.exists()) {
> filePath.mkdirs();
> }
>
> filePath.act(new XMLLinterStepCallable(taskListener));
> return null;
> }
> }
>
> private static class XMLLinterStepCallable extends 
> MasterToSlaveFileCallable {
> private static final long serialVersionUID = 1L;
> private final TaskListener taskListener;
>
> XMLLinterStepCallable(TaskListener taskListener) {
> this.taskListener = taskListener;
> }
>
> @Override
> public Void invoke(File dir, VirtualChannel channel) throws 
> IOException {
> PrintStream logger = taskListener.getLogger();
> logger.println("Test"); *//THIS LINE THROWS Null Pointer 
> Exception*
> return null;
>   

Any idea why a TaskListenerDecorator could cause logger.println() to throw null pointer exception

2019-04-17 Thread Daniel Anechitoaie
I have a pipeline step plugin that wraps other steps and captures the 
output and for some reason this causes a Null Pointer Exception when I try 
to do logger.println() from the step plugin that is wrapped.

*So with this pipeline:*
---
node {
stage('Test') {
withCodeReviewAssistantGitHubCheckRun(args) {
codeReviewAssistantXMLLint()
}
}
}
---


*withCodeReviewAssistantGitHubCheckRun having a:*
---
private static class WithCheckRunStepExecutionTaskListenerDecorator 
extends TaskListenerDecorator {
private static final long serialVersionUID = 1;
private WithCheckRunStepExecution withCheckRunStepExecution;


WithCheckRunStepExecutionTaskListenerDecorator(WithCheckRunStepExecution 
withCheckRunStepExecution) {
this.withCheckRunStepExecution = withCheckRunStepExecution;
}

@Nonnull
@Override
public OutputStream decorate(@Nonnull final OutputStream 
outputStream) {
return new LineTransformationOutputStream() {
@Override
protected void eol(byte[] b, int len) throws 
IOException {
synchronized (outputStream) {
withCheckRunStepExecution.addBodyOutputLine(b, 
len);
outputStream.write(b, 0, len);
}
}
};
}
}
---


*that's used like:*
---
EnvironmentExpander environmentExpander = 
EnvironmentExpander.merge(
getContext().get(EnvironmentExpander.class),
new WithCheckRunStepExecutionEnvironmentExpander(new 
EnvVars())
);

TaskListenerDecorator taskListenerDecorator = 
TaskListenerDecorator.merge(
getContext().get(TaskListenerDecorator.class),
new WithCheckRunStepExecutionTaskListenerDecorator(this)
);

getContext().newBodyInvoker()
.withContexts(environmentExpander, 
taskListenerDecorator)
.withCallback(new 
WithCheckRunStepExecutionCallback(this))
.start();
---



*And codeReviewAssistantXMLLint is basically:*
---
public class XMLLinterStep extends Step {
@Override
public StepExecution start(StepContext context) {
return new XMLLinterStepExecution(this, context);
}

private static class XMLLinterStepExecution extends 
SynchronousNonBlockingStepExecution {
private static final long serialVersionUID = 1L;
private transient final XMLLinterStep step;

XMLLinterStepExecution(XMLLinterStep step, StepContext context) {
super(context);
this.step = step;
}

@Override
protected Void run() throws IOException, InterruptedException {
TaskListener taskListener = 
getContext().get(TaskListener.class);
Objects.requireNonNull(taskListener, "Failed to get 
TaskListener.class");

FilePath filePath = getContext().get(FilePath.class);
Objects.requireNonNull(filePath, "Failed to get 
FilePath.class");

if (!filePath.exists()) {
filePath.mkdirs();
}

filePath.act(new XMLLinterStepCallable(taskListener));
return null;
}
}

private static class XMLLinterStepCallable extends 
MasterToSlaveFileCallable {
private static final long serialVersionUID = 1L;
private final TaskListener taskListener;

XMLLinterStepCallable(TaskListener taskListener) {
this.taskListener = taskListener;
}

@Override
public Void invoke(File dir, VirtualChannel channel) throws 
IOException {
PrintStream logger = taskListener.getLogger();
logger.println("Test"); *//THIS LINE THROWS Null Pointer 
Exception*
return null;
}
}
}
---

-- 
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/b716ba9a-e24a-4792-ac8b-7ce5862cfe9b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: When using the dir step in a Jenkins pipeline is there any way to get that value from a step within?

2019-04-17 Thread Daniel Anechitoaie
Yep, works as expected. Thanks

On Wednesday, April 17, 2019 at 2:09:10 PM UTC+3, Daniel Anechitoaie wrote:
>
> This makes sense. Not sure why I was confused about this.
> I'm in the process of migrating it from "extends Builder implements 
> SimpleBuildStep" to "extends Step".
>
> I'll post back how it goes.
>
> Thank you for clarification.
>
> On Wednesday, April 17, 2019 at 2:01:41 PM UTC+3, Robert Sandell wrote:
>>
>> I'm not sure I understand the question completely. But the FilePath 
>> object in the step context will be what the current working directory is. 
>> So if your step is called inside a dir step then the FilePath will be that 
>> directory otherwise it will be the workspace, or null if the step gets 
>> called outside of a node step.
>> So you don't need to know if you are inside a dir step, just that there 
>> is a FilePath to use.
>>
>> https://github.com/jenkinsci/workflow-basic-steps-plugin/blob/master/src/main/java/org/jenkinsci/plugins/workflow/steps/PushdStep.java#L90-L93
>>
>> /B
>>
>> Den ons 17 apr. 2019 kl 12:22 skrev Daniel Anechitoaie <
>> danie...@gmail.com>:
>>
>>> I'm working on Jenkins pipeline plugin that generates some paths 
>>> relative to the workspace at the moment.
>>> But sometimes I need to wrap my plugin with dir - 
>>> https://github.com/jenkinsci/workflow-basic-steps-plugin/blob/master/src/main/java/org/jenkinsci/plugins/workflow/steps/PushdStep.java
>>>  step.
>>> Is there any way from within my plugin to know if it was wrapped by the 
>>> "dir" step plugin so I can use that dir as a relative path vs if it was not 
>>> in which case I should use the workspace as a relative path?
>>>
>>> -- 
>>> 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 jenkin...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/jenkinsci-dev/5ce71f78-8765-4471-b9b1-31d118c43e83%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/jenkinsci-dev/5ce71f78-8765-4471-b9b1-31d118c43e83%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>> -- 
>> *Robert Sandell*
>> Software Engineer
>> CloudBees, Inc.
>> [image: CloudBees-Logo.png] <http://www.cloudbees.com/>
>> E: rsan...@cloudbees.com
>> Twitter: robert_sandell
>>
>

-- 
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/0c31105f-2931-4106-8f28-e306191794a6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: When using the dir step in a Jenkins pipeline is there any way to get that value from a step within?

2019-04-17 Thread Daniel Anechitoaie
This makes sense. Not sure why I was confused about this.
I'm in the process of migrating it from "extends Builder implements 
SimpleBuildStep" to "extends Step".

I'll post back how it goes.

Thank you for clarification.

On Wednesday, April 17, 2019 at 2:01:41 PM UTC+3, Robert Sandell wrote:
>
> I'm not sure I understand the question completely. But the FilePath object 
> in the step context will be what the current working directory is. So if 
> your step is called inside a dir step then the FilePath will be that 
> directory otherwise it will be the workspace, or null if the step gets 
> called outside of a node step.
> So you don't need to know if you are inside a dir step, just that there is 
> a FilePath to use.
>
> https://github.com/jenkinsci/workflow-basic-steps-plugin/blob/master/src/main/java/org/jenkinsci/plugins/workflow/steps/PushdStep.java#L90-L93
>
> /B
>
> Den ons 17 apr. 2019 kl 12:22 skrev Daniel Anechitoaie  >:
>
>> I'm working on Jenkins pipeline plugin that generates some paths relative 
>> to the workspace at the moment.
>> But sometimes I need to wrap my plugin with dir - 
>> https://github.com/jenkinsci/workflow-basic-steps-plugin/blob/master/src/main/java/org/jenkinsci/plugins/workflow/steps/PushdStep.java
>>  step.
>> Is there any way from within my plugin to know if it was wrapped by the 
>> "dir" step plugin so I can use that dir as a relative path vs if it was not 
>> in which case I should use the workspace as a relative path?
>>
>> -- 
>> 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 jenkin...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-dev/5ce71f78-8765-4471-b9b1-31d118c43e83%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-dev/5ce71f78-8765-4471-b9b1-31d118c43e83%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> -- 
> *Robert Sandell*
> Software Engineer
> CloudBees, Inc.
> [image: CloudBees-Logo.png] <http://www.cloudbees.com/>
> E: rsan...@cloudbees.com 
> Twitter: robert_sandell
>

-- 
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/23fce438-23ae-4125-9510-639ab7245b12%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


When using the dir step in a Jenkins pipeline is there any way to get that value from a step within?

2019-04-17 Thread Daniel Anechitoaie
I'm working on Jenkins pipeline plugin that generates some paths relative 
to the workspace at the moment.
But sometimes I need to wrap my plugin with dir - 
https://github.com/jenkinsci/workflow-basic-steps-plugin/blob/master/src/main/java/org/jenkinsci/plugins/workflow/steps/PushdStep.java
 step.
Is there any way from within my plugin to know if it was wrapped by the 
"dir" step plugin so I can use that dir as a relative path vs if it was not 
in which case I should use the workspace as a relative path?

-- 
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/5ce71f78-8765-4471-b9b1-31d118c43e83%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Any idea what could cause Jenkins console output to be mixed like this in a pipeline job?

2019-04-16 Thread Daniel Anechitoaie
This seems too be happening only wen I run Jenkins in a Master/Slave setup 
(2 servers).
If I only have the master it seems there's no problem with the output.

I'll try to see if I can setup 2.173 the same way (master + slave) to see 
if it's still reproducible.



On Tuesday, April 16, 2019 at 4:02:48 PM UTC+3, Jesse Glick wrote:
>
> On Tue, Apr 16, 2019 at 5:16 AM Daniel Anechitoaie 
> > wrote: 
> > Any idea what's going on? 
>
> Check whether it happens in Jenkins 2.173. If not, there is a backport 
> to LTS I could propose. If it still does, then I suspect something in 
> `git` or `git-client` will need to do a `flush()` somewhere. The code 
> here is nonstandard and problematic (JENKINS-21342) but nobody dares 
> touch it. Might suffice for `GitCommandMasterToSlaveCallable` to call 
> some new `GitClient.flush()` method defined on `CliGitAPIImpl`. If you 
> have a consistent way to reproduce this it would be helpful. 
>

-- 
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/8210af96-a327-4676-814b-97dc38eb4bdc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Any idea what could cause Jenkins console output to be mixed like this in a pipeline job?

2019-04-16 Thread Daniel Anechitoaie
And if you look at the timestamp:

[2019-04-16T09:06:31.*541Z*] [Pipeline] myPlugin
[2019-04-16T09:06:31.208Z] Seen branch in repository origin/feature/pr1
[2019-04-16T09:06:31.208Z] Seen branch in repository origin/master
[2019-04-16T09:06:31.208Z] Seen 2 remote branches

the logs that appear after the second stage started even have the timestamp 
in ms less than the second stage.
So kind of weird that a message that was generated before appears after.


On Tuesday, April 16, 2019 at 12:41:13 PM UTC+3, Daniel Anechitoaie wrote:
>
> The strange thing is that this part of the log that appears under the 
> other stage:
> ---
> [2019-04-16T09:06:31.211Z]  > git show-ref --tags -d # timeout=10
> [2019-04-16T09:06:31.224Z]  > git config core.sparsecheckout # timeout=10
> [2019-04-16T09:06:31.229Z]  > git checkout -f 
> bf7221352765115631b4326fa6b0603ff0f19637
> [2019-04-16T09:06:31.244Z]  > git branch -a -v --no-abbrev # timeout=10
> [2019-04-16T09:06:31.249Z]  > git checkout -b feature/pr1 
> bf7221352765115631b4326fa6b0603ff0f19637
> [2019-04-16T09:06:31.272Z]  > git rev-list --no-walk 
> bf7221352765115631b4326fa6b0603ff0f19637 # timeout=10
> ---
>
> Doesn't seem to even be present if I replace the call to "myPlugin()" with 
> "sh(ls)" for example in (BeginCheckRun) stage.
> What could cause the git plugin to have extra output and to have outside 
> of its stage, in the next stage.
>
>
>
> On Tuesday, April 16, 2019 at 12:16:03 PM UTC+3, Daniel Anechitoaie wrote:
>>
>> For some reason the console output seems to be all mixed. Like the output 
>> from on step is present in other step.
>> Notice how "(BeginCheckRun)" stage started, yet the output from (Git) 
>> stage is not finished, and part of the (Git) stage is also printed after 
>> (BeginCheckRun) stage started.
>> Any idea what's going on?
>>
>> myPlugin() is a Step plugin I did that "extends 
>> SynchronousNonBlockingStepExecution"
>> If I don't call myPlugin() in my Jenkinsfile then the output is ok.
>> Any idea what could cause this to happen?
>>
>> Here's my Jenkinsfile
>> ---
>> node {
>> stage('Cleanup') {
>> cleanWs()
>> }
>>
>> stage('Git') {
>> dir('scm') {
>> git(...)
>> }
>> }
>>
>> stage('BeginCheckRun') {
>> dir('scm') {
>> myPlugin()
>> }
>> }
>> }
>>
>> ---
>>
>>
>> And the console output:
>> ---
>> [2019-04-16T09:06:27.056Z] Started by user Daniel Anechitoaie
>> [2019-04-16T09:06:27.057Z] Running in Durability level: 
>> PERFORMANCE_OPTIMIZED
>> [2019-04-16T09:06:27.381Z] [Pipeline] Start of Pipeline
>> [2019-04-16T09:06:27.414Z] [Pipeline] node
>> [2019-04-16T09:06:27.432Z] Running on wrkr1 in 
>> /var/lib/jenkins/workspace/some/test
>> [2019-04-16T09:06:27.432Z] [Pipeline] {
>> [2019-04-16T09:06:27.449Z] [Pipeline] stage
>> [2019-04-16T09:06:27.452Z] [Pipeline] { (Cleanup)
>> [2019-04-16T09:06:27.552Z] [Pipeline] cleanWs
>> [2019-04-16T09:06:27.564Z] [WS-CLEANUP] Deleting project workspace...
>> [2019-04-16T09:06:27.564Z] [WS-CLEANUP] Deferred wipeout is used...
>> [2019-04-16T09:06:27.912Z] [WS-CLEANUP] done
>> [2019-04-16T09:06:27.914Z] [Pipeline] }
>> [2019-04-16T09:06:27.918Z] [Pipeline] // stage
>> [2019-04-16T09:06:27.933Z] [Pipeline] stage
>> [2019-04-16T09:06:27.935Z] [Pipeline] { (Git)
>> [2019-04-16T09:06:27.945Z] [Pipeline] dir
>> [2019-04-16T09:06:27.946Z] Running in 
>> /var/lib/jenkins/workspace/some/test/scm
>> [2019-04-16T09:06:27.946Z] [Pipeline] {
>> [2019-04-16T09:06:27.973Z] [Pipeline] git
>> [2019-04-16T09:06:27.996Z] using credential 
>> 86595008-12db-46b4-b1a3-e79de2f0e2af
>> [2019-04-16T09:06:28.289Z] Cloning the remote Git repository
>> [2019-04-16T09:06:28.292Z] Cloning repository g...@github.com:some/test.git
>> [2019-04-16T09:06:28.292Z]  > git init 
>> /var/lib/jenkins/workspace/some/test/scm # timeout=10
>> [2019-04-16T09:06:28.718Z] Fetching upstream changes from 
>> g...@github.com:some/test.git
>> [2019-04-16T09:06:28.719Z]  > git --version # timeout=10
>> [2019-04-16T09:06:28.724Z] using GIT_SSH to set credentials some_test
>> [2019-04-16T09:06:28.726Z]  > git fetch --tags --progress 
>> g...@github.com:some/test.git +refs/heads/*:refs/remotes/origin/*
>> [2019-04-16T09:06:30.130Z]  > git config remote.origin.url 
>> g...@github.com:some/test.git # timeout=10
>> [2019-04-16T09:06:30.135Z]  > git config --add remote.origin.fetch 

Re: Any idea what could cause Jenkins console output to be mixed like this in a pipeline job?

2019-04-16 Thread Daniel Anechitoaie
The strange thing is that this part of the log that appears under the other 
stage:
---
[2019-04-16T09:06:31.211Z]  > git show-ref --tags -d # timeout=10
[2019-04-16T09:06:31.224Z]  > git config core.sparsecheckout # timeout=10
[2019-04-16T09:06:31.229Z]  > git checkout -f 
bf7221352765115631b4326fa6b0603ff0f19637
[2019-04-16T09:06:31.244Z]  > git branch -a -v --no-abbrev # timeout=10
[2019-04-16T09:06:31.249Z]  > git checkout -b feature/pr1 
bf7221352765115631b4326fa6b0603ff0f19637
[2019-04-16T09:06:31.272Z]  > git rev-list --no-walk 
bf7221352765115631b4326fa6b0603ff0f19637 # timeout=10
---

Doesn't seem to even be present if I replace the call to "myPlugin()" with 
"sh(ls)" for example in (BeginCheckRun) stage.
What could cause the git plugin to have extra output and to have outside of 
its stage, in the next stage.



On Tuesday, April 16, 2019 at 12:16:03 PM UTC+3, Daniel Anechitoaie wrote:
>
> For some reason the console output seems to be all mixed. Like the output 
> from on step is present in other step.
> Notice how "(BeginCheckRun)" stage started, yet the output from (Git) 
> stage is not finished, and part of the (Git) stage is also printed after 
> (BeginCheckRun) stage started.
> Any idea what's going on?
>
> myPlugin() is a Step plugin I did that "extends 
> SynchronousNonBlockingStepExecution"
> If I don't call myPlugin() in my Jenkinsfile then the output is ok.
> Any idea what could cause this to happen?
>
> Here's my Jenkinsfile
> ---
> node {
> stage('Cleanup') {
> cleanWs()
> }
>
> stage('Git') {
> dir('scm') {
> git(...)
> }
> }
>
> stage('BeginCheckRun') {
> dir('scm') {
>     myPlugin()
> }
> }
> }
>
> ---
>
>
> And the console output:
> ---
> [2019-04-16T09:06:27.056Z] Started by user Daniel Anechitoaie
> [2019-04-16T09:06:27.057Z] Running in Durability level: 
> PERFORMANCE_OPTIMIZED
> [2019-04-16T09:06:27.381Z] [Pipeline] Start of Pipeline
> [2019-04-16T09:06:27.414Z] [Pipeline] node
> [2019-04-16T09:06:27.432Z] Running on wrkr1 in 
> /var/lib/jenkins/workspace/some/test
> [2019-04-16T09:06:27.432Z] [Pipeline] {
> [2019-04-16T09:06:27.449Z] [Pipeline] stage
> [2019-04-16T09:06:27.452Z] [Pipeline] { (Cleanup)
> [2019-04-16T09:06:27.552Z] [Pipeline] cleanWs
> [2019-04-16T09:06:27.564Z] [WS-CLEANUP] Deleting project workspace...
> [2019-04-16T09:06:27.564Z] [WS-CLEANUP] Deferred wipeout is used...
> [2019-04-16T09:06:27.912Z] [WS-CLEANUP] done
> [2019-04-16T09:06:27.914Z] [Pipeline] }
> [2019-04-16T09:06:27.918Z] [Pipeline] // stage
> [2019-04-16T09:06:27.933Z] [Pipeline] stage
> [2019-04-16T09:06:27.935Z] [Pipeline] { (Git)
> [2019-04-16T09:06:27.945Z] [Pipeline] dir
> [2019-04-16T09:06:27.946Z] Running in 
> /var/lib/jenkins/workspace/some/test/scm
> [2019-04-16T09:06:27.946Z] [Pipeline] {
> [2019-04-16T09:06:27.973Z] [Pipeline] git
> [2019-04-16T09:06:27.996Z] using credential 
> 86595008-12db-46b4-b1a3-e79de2f0e2af
> [2019-04-16T09:06:28.289Z] Cloning the remote Git repository
> [2019-04-16T09:06:28.292Z] Cloning repository g...@github.com:some/test.git
> [2019-04-16T09:06:28.292Z]  > git init 
> /var/lib/jenkins/workspace/some/test/scm # timeout=10
> [2019-04-16T09:06:28.718Z] Fetching upstream changes from 
> g...@github.com:some/test.git
> [2019-04-16T09:06:28.719Z]  > git --version # timeout=10
> [2019-04-16T09:06:28.724Z] using GIT_SSH to set credentials some_test
> [2019-04-16T09:06:28.726Z]  > git fetch --tags --progress 
> g...@github.com:some/test.git +refs/heads/*:refs/remotes/origin/*
> [2019-04-16T09:06:30.130Z]  > git config remote.origin.url 
> g...@github.com:some/test.git # timeout=10
> [2019-04-16T09:06:30.135Z]  > git config --add remote.origin.fetch 
> +refs/heads/*:refs/remotes/origin/* # timeout=10
> [2019-04-16T09:06:30.142Z]  > git config remote.origin.url 
> g...@github.com:some/test.git # timeout=10
> [2019-04-16T09:06:30.150Z] Fetching upstream changes from 
> g...@github.com:some/test.git
> [2019-04-16T09:06:30.150Z] using GIT_SSH to set credentials some_test
> [2019-04-16T09:06:30.151Z]  > git fetch --tags --progress 
> g...@github.com:some/test.git +refs/heads/*:refs/remotes/origin/*
> [2019-04-16T09:06:31.222Z] Checking out Revision 
> bf7221352765115631b4326fa6b0603ff0f19637 (origin/feature/pr1)
> [2019-04-16T09:06:31.269Z] Commit message: "Update README.md"
> [2019-04-16T09:06:31.300Z] [Pipeline] }
> [2019-04-16T09:06:31.302Z] [Pipeline] // dir
> [2019-04-16T09:06:31.331Z] [Pipeline] }
> [2019-04-16T09:06:31.362Z] [Pipeline] // stage
> [2019-04-16T09:06:31.376Z] [Pipeline] stage
> [2019-04-16T09:06:31.

Any idea what could cause Jenkins console output to be mixed like this in a pipeline job?

2019-04-16 Thread Daniel Anechitoaie
For some reason the console output seems to be all mixed. Like the output 
from on step is present in other step.
Notice how "(BeginCheckRun)" stage started, yet the output from (Git) stage 
is not finished, and part of the (Git) stage is also printed after 
(BeginCheckRun) stage started.
Any idea what's going on?

myPlugin() is a Step plugin I did that "extends 
SynchronousNonBlockingStepExecution"
If I don't call myPlugin() in my Jenkinsfile then the output is ok.
Any idea what could cause this to happen?

Here's my Jenkinsfile
---
node {
stage('Cleanup') {
cleanWs()
}

stage('Git') {
dir('scm') {
git(...)
}
}

stage('BeginCheckRun') {
dir('scm') {
myPlugin()
}
}
}

---


And the console output:
---
[2019-04-16T09:06:27.056Z] Started by user Daniel Anechitoaie
[2019-04-16T09:06:27.057Z] Running in Durability level: 
PERFORMANCE_OPTIMIZED
[2019-04-16T09:06:27.381Z] [Pipeline] Start of Pipeline
[2019-04-16T09:06:27.414Z] [Pipeline] node
[2019-04-16T09:06:27.432Z] Running on wrkr1 in 
/var/lib/jenkins/workspace/some/test
[2019-04-16T09:06:27.432Z] [Pipeline] {
[2019-04-16T09:06:27.449Z] [Pipeline] stage
[2019-04-16T09:06:27.452Z] [Pipeline] { (Cleanup)
[2019-04-16T09:06:27.552Z] [Pipeline] cleanWs
[2019-04-16T09:06:27.564Z] [WS-CLEANUP] Deleting project workspace...
[2019-04-16T09:06:27.564Z] [WS-CLEANUP] Deferred wipeout is used...
[2019-04-16T09:06:27.912Z] [WS-CLEANUP] done
[2019-04-16T09:06:27.914Z] [Pipeline] }
[2019-04-16T09:06:27.918Z] [Pipeline] // stage
[2019-04-16T09:06:27.933Z] [Pipeline] stage
[2019-04-16T09:06:27.935Z] [Pipeline] { (Git)
[2019-04-16T09:06:27.945Z] [Pipeline] dir
[2019-04-16T09:06:27.946Z] Running in 
/var/lib/jenkins/workspace/some/test/scm
[2019-04-16T09:06:27.946Z] [Pipeline] {
[2019-04-16T09:06:27.973Z] [Pipeline] git
[2019-04-16T09:06:27.996Z] using credential 
86595008-12db-46b4-b1a3-e79de2f0e2af
[2019-04-16T09:06:28.289Z] Cloning the remote Git repository
[2019-04-16T09:06:28.292Z] Cloning repository g...@github.com:some/test.git
[2019-04-16T09:06:28.292Z]  > git init 
/var/lib/jenkins/workspace/some/test/scm # timeout=10
[2019-04-16T09:06:28.718Z] Fetching upstream changes from 
g...@github.com:some/test.git
[2019-04-16T09:06:28.719Z]  > git --version # timeout=10
[2019-04-16T09:06:28.724Z] using GIT_SSH to set credentials some_test
[2019-04-16T09:06:28.726Z]  > git fetch --tags --progress 
g...@github.com:some/test.git +refs/heads/*:refs/remotes/origin/*
[2019-04-16T09:06:30.130Z]  > git config remote.origin.url 
g...@github.com:some/test.git # timeout=10
[2019-04-16T09:06:30.135Z]  > git config --add remote.origin.fetch 
+refs/heads/*:refs/remotes/origin/* # timeout=10
[2019-04-16T09:06:30.142Z]  > git config remote.origin.url 
g...@github.com:some/test.git # timeout=10
[2019-04-16T09:06:30.150Z] Fetching upstream changes from 
g...@github.com:some/test.git
[2019-04-16T09:06:30.150Z] using GIT_SSH to set credentials some_test
[2019-04-16T09:06:30.151Z]  > git fetch --tags --progress 
g...@github.com:some/test.git +refs/heads/*:refs/remotes/origin/*
[2019-04-16T09:06:31.222Z] Checking out Revision 
bf7221352765115631b4326fa6b0603ff0f19637 (origin/feature/pr1)
[2019-04-16T09:06:31.269Z] Commit message: "Update README.md"
[2019-04-16T09:06:31.300Z] [Pipeline] }
[2019-04-16T09:06:31.302Z] [Pipeline] // dir
[2019-04-16T09:06:31.331Z] [Pipeline] }
[2019-04-16T09:06:31.362Z] [Pipeline] // stage
[2019-04-16T09:06:31.376Z] [Pipeline] stage
[2019-04-16T09:06:31.380Z] [Pipeline] { (BeginCheckRun)
[2019-04-16T09:06:31.485Z] [Pipeline] dir
[2019-04-16T09:06:31.485Z] Running in 
/var/lib/jenkins/workspace/some/test/scm
[2019-04-16T09:06:31.486Z] [Pipeline] {
[2019-04-16T09:06:31.541Z] [Pipeline] myPlugin
[2019-04-16T09:06:31.208Z] Seen branch in repository origin/feature/pr1
[2019-04-16T09:06:31.208Z] Seen branch in repository origin/master
[2019-04-16T09:06:31.208Z] Seen 2 remote branches
[2019-04-16T09:06:31.211Z]  > git show-ref --tags -d # timeout=10
[2019-04-16T09:06:31.224Z]  > git config core.sparsecheckout # timeout=10
[2019-04-16T09:06:31.229Z]  > git checkout -f 
bf7221352765115631b4326fa6b0603ff0f19637
[2019-04-16T09:06:31.244Z]  > git branch -a -v --no-abbrev # timeout=10
[2019-04-16T09:06:31.249Z]  > git checkout -b feature/pr1 
bf7221352765115631b4326fa6b0603ff0f19637
[2019-04-16T09:06:31.272Z]  > git rev-list --no-walk 
bf7221352765115631b4326fa6b0603ff0f19637 # timeout=10
[2019-04-16T09:06:32.989Z] [Pipeline] }
[2019-04-16T09:06:32.995Z] [Pipeline] // dir
[2019-04-16T09:06:33.063Z] [Pipeline] }
[2019-04-16T09:06:33.089Z] [Pipeline] // stage
[2019-04-16T09:06:33.127Z] [Pipeline] }
[2019-04-16T09:06:33.138Z] [Pipeline] // node
[2019-04-16T09:06:33.165Z] [Pipeline] End of Pipeline
---

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe

Re: Is Jenkins logger buffered? If so is there any way to "flush" it?

2019-04-15 Thread Daniel Anechitoaie
What I'm trying to do is integrate with GitHib Checks API so I need to be 
able to post three types of events to GitHub.
1) When build started (which I did as a pipeline step plugin - 
gitHubCheckRunBegin())
2) When build was successful (which I did as a pipeline step plugin - 
gitHubCheckRunEnd())
3) When build fails. Here I would need to get the output of the stage the 
failed to be able to send that to GitHub.

For #3 I did as you suggested from @Ullrich link as a block scoped function 
which seems perfect.

Basically what I have now is 
https://gist.github.com/danechitoaie/bdde3c4735914e3b830e0e481211c4a9
Dos it make sense? Is it ok the way it was done?

And I'm planing to use this like:

node {
def cfg = [
'stuff': 'stuff',
...
]

stage('Cleanup') {
cleanWs()
}

stage('Git') {
git(...)
}

stage('CheckRun_Begin') {
gitHubCheckRunBegin(cfg)
}

stage('Yarn') {
withGitHubCheckRun(cfg) {
sh(...)
}
}

stage('Build') {
withGitHubCheckRun(cfg) {
sh(...)
}
}

stage('CheckRun_End') {
gitHubCheckRunEnd(cfg)
}
}

So at start gitHubCheckRunBegin makes call to GitHub api to start the 
check, gitHubCheckRunEnd will make call to GitHub api to end the check 
successfully (assuming the job gets there).
And if any step fails then the withGitHubCheckRun will catch that stage 
output and push it the GitHub API



On Monday, April 15, 2019 at 4:07:07 PM UTC+3, Jesse Glick wrote:
>
> On Sat, Apr 13, 2019 at 3:27 PM Daniel Anechitoaie 
> > wrote: 
> > } catch (e) { 
> > myPlugin() 
> > throw e 
> > } 
>
> Not really sure what you are trying to accomplish here, but this does 
> not smell like a good idea. 
>

-- 
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/cad3e883-40f1-4235-b480-d2a38f6899ed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Is Jenkins logger buffered? If so is there any way to "flush" it?

2019-04-13 Thread Daniel Anechitoaie
I'm writing a pipeline Step plugin and in case build fails for any reason I 
need to publish the build log somewhere.
So I'm thinking of using "Run.getLog(nr)".

Any idea if I'll have problems with the log buffering/net being flushed 
when the build fails?

The way the plugin is going to be used is something like this:

node {
try {
stage('Something 1') {

}

stage('Something 2') {

}

stage('Something 3') {

}
} catch (e) {
myPlugin()
throw e
}
}


So if any of the stages fail, when I call myPlugin() in "catch" if inside 
my plugin I call  "Run.getLog(nr)" will I get the full log (of what 
happened up to that point)? Or it's possible I'll get partial log in some 
cases due caching/buffering?

-- 
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/5c9aeda8-4d0a-4d02-8035-43eef22be8ee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: What happens when you do a FilePath.readToString() on a Master/Slave setup?

2019-04-05 Thread Daniel Anechitoaie
Your "read between the lines" was spot on. Sorry for not being more clear I 
was not sure how to explain my train of thoughts.
It's clear now.
Thank you.

On Friday, April 5, 2019 at 4:17:49 PM UTC+3, Jesse Glick wrote:
>
> On Fri, Apr 5, 2019 at 4:11 AM Daniel Anechitoaie  > wrote: 
> > What happens when you do a FilePath.readToString() on a Master/Slave 
> setup? 
> > Will the master read the contents of the file from the salve and process 
> the contents locally? 
>
> I am not sure what you mean by “process” in this context. The master 
> will send a request to the agent to load the file into a string, and 
> the agent sends back a response with that string. 
>
> Reading between the lines a bit, I think you are asking something like 
> this: suppose the agent workspace contains some possibly big file and 
> you only need a little bit of information from it. In that case it is 
> a bad idea to write 
>
> FilePath file = workspace.child("all-results.xml"); 
> String xml = file.readtoString(); // slow! 
> int count = countNumberOfResults(xml); 
>
> The better code would be: 
>
> FilePath file = workspace.child("all-results.xml"); 
> int count = file.act(new CountNumberOfResults()); 
> // … 
> private static final class CountNumberOfResults extends 
> MasterToSlaveFileCallable {…} 
>
> so that the response on the Remoting channel just contains the one 
> integer and not the complete file contents. 
>

-- 
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/d85e9530-e4d0-48e5-bb58-82fe27734744%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to get access to configs/credentials on a UnprotectedRootAction class

2019-04-05 Thread Daniel Anechitoaie
Hah, yah.. makes sense.
I generated the getter and setter from IntelliJ (Command + N) and somehow 
missed the "save()";
I removed the configure method and added save() in the setter.

Thank you.

On Friday, April 5, 2019 at 4:18:51 PM UTC+3, Jesse Glick wrote:
>
> On Fri, Apr 5, 2019 at 6:25 AM Daniel Anechitoaie  > wrote: 
> > I forgot to implement the configure method. 
>
> You should not need such a method. You just forgot to call `save()` 
> from your setter. See the archetype. 
>

-- 
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/79a50233-2880-4035-9b13-95c37b682de3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to get access to configs/credentials on a UnprotectedRootAction class

2019-04-05 Thread Daniel Anechitoaie
Found the issue. I forgot to implement the configure method.


On Friday, April 5, 2019 at 1:08:53 PM UTC+3, Daniel Anechitoaie wrote:
>
> One weird thing is that the settings get lost after Jenkins restart. Any 
> idea what's going on?
>
> package org.jenkinsci.plugins.osfbuildersuite.githubcheckruns.webhook;
>
> import hudson.Extension;
> import hudson.util.Secret;
> import jenkins.model.GlobalConfiguration;
> import org.kohsuke.stapler.DataBoundSetter;
>
> @Extension
> public class GitHubCheckRunConfiguration extends GlobalConfiguration {
> private Secret webhookSecret;
>
> public static GitHubCheckRunConfiguration get() {
> return 
> GlobalConfiguration.all().get(GitHubCheckRunConfiguration.class);
> }
>
> @SuppressWarnings("unused")
> public GitHubCheckRunConfiguration() {
> load();
> }
>
> @SuppressWarnings("unused")
> public Secret getWebhookSecret() {
> return webhookSecret;
> }
>
> @SuppressWarnings("unused")
> @DataBoundSetter
> public void setWebhookSecret(Secret webhookSecret) {
> this.webhookSecret = webhookSecret;
> }
> }
>
>
>
> On Thursday, April 4, 2019 at 4:49:29 PM UTC+3, Daniel Anechitoaie wrote:
>>
>> Perfect. The global-configuration archetype example was super helpful. I 
>> got it working. Thank you.
>> Yes, using a secret makes sense more than whole credentials here.
>>
>>
>> On Thursday, April 4, 2019 at 3:47:07 PM UTC+3, Jesse Glick wrote:
>>>
>>> On Thu, Apr 4, 2019 at 6:52 AM Daniel Beck  wrote: 
>>> > Create a GlobalConfiguration 
>>>
>>> Easiest to start with 
>>>
>>> https://github.com/jenkinsci/archetypes#usage 
>>>
>>> even if you throw away the toy plugin afterwards. 
>>>
>>>
>>> I am not sure what kind of “credentials” you are referring to here. To 
>>> validate a token you would I guess want Jenkins to store some sort of 
>>> public key, or simply a token hash (you could use 
>>> `org.mindrot.jbcrypt.BCrypt`). If you do want to protect a public 
>>> key/hash a bit more, save it as a `Secret` rather than a `String`. 
>>>
>>> When we talk about “credentials” we usually refer specifically to 
>>>
>>>
>>> https://github.com/jenkinsci/credentials-plugin/blob/master/docs/README.adoc
>>>  
>>>
>>> which should not be necessary if Jenkins itself is not retaining 
>>> anything especially secret. An `IdCredentials.id` would imply that you 
>>> expect a secret value to potentially be used in multiple places or 
>>> even loaded from Vault or a Kubernetes `Secret`, which seems unlikely 
>>> in this case. 
>>>
>>

-- 
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/c3cd4f8e-538a-4fa7-8ccb-26a3b1fdcde1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to get access to configs/credentials on a UnprotectedRootAction class

2019-04-05 Thread Daniel Anechitoaie
One weird thing is that the settings get lost after Jenkins restart. Any 
idea what's going on?

package org.jenkinsci.plugins.osfbuildersuite.githubcheckruns.webhook;

import hudson.Extension;
import hudson.util.Secret;
import jenkins.model.GlobalConfiguration;
import org.kohsuke.stapler.DataBoundSetter;

@Extension
public class GitHubCheckRunConfiguration extends GlobalConfiguration {
private Secret webhookSecret;

public static GitHubCheckRunConfiguration get() {
return GlobalConfiguration.all().get(GitHubCheckRunConfiguration.class);
}

@SuppressWarnings("unused")
public GitHubCheckRunConfiguration() {
load();
}

@SuppressWarnings("unused")
public Secret getWebhookSecret() {
return webhookSecret;
}

@SuppressWarnings("unused")
@DataBoundSetter
public void setWebhookSecret(Secret webhookSecret) {
this.webhookSecret = webhookSecret;
}
}



On Thursday, April 4, 2019 at 4:49:29 PM UTC+3, Daniel Anechitoaie wrote:
>
> Perfect. The global-configuration archetype example was super helpful. I 
> got it working. Thank you.
> Yes, using a secret makes sense more than whole credentials here.
>
>
> On Thursday, April 4, 2019 at 3:47:07 PM UTC+3, Jesse Glick wrote:
>>
>> On Thu, Apr 4, 2019 at 6:52 AM Daniel Beck  wrote: 
>> > Create a GlobalConfiguration 
>>
>> Easiest to start with 
>>
>> https://github.com/jenkinsci/archetypes#usage 
>>
>> even if you throw away the toy plugin afterwards. 
>>
>>
>> I am not sure what kind of “credentials” you are referring to here. To 
>> validate a token you would I guess want Jenkins to store some sort of 
>> public key, or simply a token hash (you could use 
>> `org.mindrot.jbcrypt.BCrypt`). If you do want to protect a public 
>> key/hash a bit more, save it as a `Secret` rather than a `String`. 
>>
>> When we talk about “credentials” we usually refer specifically to 
>>
>>
>> https://github.com/jenkinsci/credentials-plugin/blob/master/docs/README.adoc 
>>
>> which should not be necessary if Jenkins itself is not retaining 
>> anything especially secret. An `IdCredentials.id` would imply that you 
>> expect a secret value to potentially be used in multiple places or 
>> even loaded from Vault or a Kubernetes `Secret`, which seems unlikely 
>> in this case. 
>>
>

-- 
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/c2669549-b0fe-45a0-a4d9-27d924214216%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


What happens when you do a FilePath.readToString() on a Master/Slave setup?

2019-04-05 Thread Daniel Anechitoaie
What happens when you do a FilePath.readToString() on a Master/Slave setup?
Will the master read the contents of the file from the salve and process 
the contents locally?

Is it better to do a FilePath.act() so that the processing will happen on 
the slave and then the master will just get the results?

-- 
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/1314090b-39cd-461c-ba09-d058faa3e574%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to get access to configs/credentials on a UnprotectedRootAction class

2019-04-04 Thread Daniel Anechitoaie
Perfect. The global-configuration archetype example was super helpful. I 
got it working. Thank you.
Yes, using a secret makes sense more than whole credentials here.


On Thursday, April 4, 2019 at 3:47:07 PM UTC+3, Jesse Glick wrote:
>
> On Thu, Apr 4, 2019 at 6:52 AM Daniel Beck > 
> wrote: 
> > Create a GlobalConfiguration 
>
> Easiest to start with 
>
> https://github.com/jenkinsci/archetypes#usage 
>
> even if you throw away the toy plugin afterwards. 
>
>
> I am not sure what kind of “credentials” you are referring to here. To 
> validate a token you would I guess want Jenkins to store some sort of 
> public key, or simply a token hash (you could use 
> `org.mindrot.jbcrypt.BCrypt`). If you do want to protect a public 
> key/hash a bit more, save it as a `Secret` rather than a `String`. 
>
> When we talk about “credentials” we usually refer specifically to 
>
>
> https://github.com/jenkinsci/credentials-plugin/blob/master/docs/README.adoc 
>
> which should not be necessary if Jenkins itself is not retaining 
> anything especially secret. An `IdCredentials.id` would imply that you 
> expect a secret value to potentially be used in multiple places or 
> even loaded from Vault or a Kubernetes `Secret`, which seems unlikely 
> in this case. 
>

-- 
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/b82562a9-ae0f-417e-bd41-5a2b68b12e37%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to get access to configs/credentials on a UnprotectedRootAction class

2019-04-04 Thread Daniel Anechitoaie
I have a class that exposes a Webhook and I'd like to check the validity of 
the token from the incoming request.
On a builder class I was able to retrieve the configs trough 
the getDescriptor() class.

How can I do this on a UnprotectedRootAction class?

-- 
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/98852273-3def-44d6-a82f-0284cd3d021b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Iterate trough all jobs and trigger one by name

2019-04-03 Thread Daniel Anechitoaie
Thank you. I'll look into this.

On Wednesday, April 3, 2019 at 8:25:09 PM UTC+3, Jesse Glick wrote:
>
> On Wed, Apr 3, 2019 at 1:20 PM Daniel Anechitoaie  > wrote: 
> > I'm still having trouble how to trigger a job. 
>
> Use `ParameterizedJob` methods. 
>

-- 
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/267552c6-829f-4018-baa9-dadac729fad5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Catch full path in a UnprotectedRootAction class

2019-04-03 Thread Daniel Anechitoaie
Thank you. This helped me understand what's going on and I got it working.

On Wednesday, April 3, 2019 at 8:07:59 PM UTC+3, Jesse Glick wrote:
>
> On Wed, Apr 3, 2019 at 12:45 PM Daniel Anechitoaie 
> > wrote: 
> > Any idea how I can do this? 
>
> http://stapler.kohsuke.org/reference.html 
>

-- 
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/662414f8-55da-475d-a9a8-eeb9e80576df%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Iterate trough all jobs and trigger one by name

2019-04-03 Thread Daniel Anechitoaie
I found how to iterate trough all the jobs "for (Job job : 
Jenkins.get().allItems(Job.class)) {" but I'm still having trouble how to 
trigger a job.
I'm trying to implement a GitHub App for the new GitHub PR checks API, so I 
will add security checks to make sure the requests are coming from a 
trusted source.


On Wednesday, April 3, 2019 at 8:10:00 PM UTC+3, Jesse Glick wrote:
>
> On Wed, Apr 3, 2019 at 12:47 PM Daniel Anechitoaie 
> > wrote: 
> > I need to pass the commit that will be then used by git plugin to make a 
> build from that specific commit. 
>
> The `git` plugin already has such a hook. If for some reason you 
> cannot reuse it, study its code. 
>
> In general what you describe is a security risk. Your webhook needs to 
> demand some kind of proof that the caller is indeed authorized to 
> build that job, in that commit, with those parameters. 
>

-- 
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/a8463b88-7ded-43fb-9c8a-9333cd98a1b4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Iterate trough all jobs and trigger one by name

2019-04-03 Thread Daniel Anechitoaie
I'm working on implementing a webhook for a plugin that should receive as 
param the name of the job it should trigger and some arguments for that job.
How can I iterate trough all the jobs in Jenkins from within a class 
implementing UnprotectedRootAction and how can I trigger a specific job by 
passing a param?

Basically I need to pass the commit that will be then used by git plugin to 
make a build from that specific commit.

-- 
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/d1b9a0ba-8044-4bc9-8463-823f14afdc05%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Catch full path in a UnprotectedRootAction class

2019-04-03 Thread Daniel Anechitoaie
Hi,

I've implemented a UnprotectedRootAction class with a doWebhook method and 
this works fine for urls like .../my-plugin/webhook/
What I want is to be able to capture the whole path and respond to all 
requests that start with "/my-plugin/".
Basically if I have requests like .../my-plugin/some/path I want to be able 
to allow this kind of requests and from within the handler to capture the 
"some/path" part.

Any idea how I can do this?

-- 
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/0108fc46-f50c-4439-9376-1b9d0ae69c75%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to sleep inside a MasterToSlaveCallable

2018-05-25 Thread Daniel Anechitoaie
I was concerned that calling Thread.currentThread().interrupt(); to not 
cause any issues with Jenkins, like crash the job or something like that.
It's clear that it will stop the job, as it should. Just that it was not 
clear to me how Jenkins handles this and if me doing this won't break 
Jenkins in any way.

Thank you. 



On Friday, May 25, 2018 at 6:48:36 PM UTC+3, Matt Sicker wrote:
>
> try {
>   Thread.sleep(...);
> } catch (InterruptedException ex) {
>   Thread.currentThread().interrupt();
> }
>
> That's the normal Java idiom at least. The InterruptedException is checked 
> purely so you are forced to deal with it like this because it's the safer 
> way of killing a thread.
>
> On Fri, May 25, 2018 at 9:21 AM, Daniel Anechitoaie <danie...@gmail.com 
> > wrote:
>
>> Hi,
>>
>> I have a plugin that calls a MasterToSlaveCallable with the following 
>> signature "private static class DataImportCallable extends 
>> MasterToSlaveCallable<Void, IOException>".
>> Inside this MasterToSlaveCallable I zip some files and then upload them 
>> to a server using Apache HTTPClient and then make some REST API calls where 
>> I need to periodically (every 1 minute)
>> check if work is done with the ZIP I have uploaded.
>>
>> My problem is that MasterToSlaveCallable seems to only be allowing one 
>> exception to be thrown and calling Thread.sleep(...) can throw 
>> InterruptedException which does not match the signature of my 
>> MasterToSlaveCallable.
>>
>> How can I "sleep" the thread inside the MasterToSlaveCallable until work 
>> is done?
>>
>> -- 
>> 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/75e070c4-2011-465b-8fc9-e7c3b2face10%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-dev/75e070c4-2011-465b-8fc9-e7c3b2face10%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Matt Sicker
> Software Engineer, CloudBees
>

-- 
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/c6b75cf6-51a2-408b-b3c7-e289eb14207c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to sleep inside a MasterToSlaveCallable

2018-05-25 Thread Daniel Anechitoaie
Hi,

I have a plugin that calls a MasterToSlaveCallable with the following 
signature "private static class DataImportCallable extends 
MasterToSlaveCallable".
Inside this MasterToSlaveCallable I zip some files and then upload them to 
a server using Apache HTTPClient and then make some REST API calls where I 
need to periodically (every 1 minute)
check if work is done with the ZIP I have uploaded.

My problem is that MasterToSlaveCallable seems to only be allowing one 
exception to be thrown and calling Thread.sleep(...) can throw 
InterruptedException which does not match the signature of my 
MasterToSlaveCallable.

How can I "sleep" the thread inside the MasterToSlaveCallable until work is 
done?

-- 
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/75e070c4-2011-465b-8fc9-e7c3b2face10%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: java.nio.channels.ClosedByInterruptException when I click cancel button from a running job

2018-04-02 Thread Daniel Anechitoaie
I can provide whatever is needed.
Would a stripped down version of the plugin with just the absolute minimal 
amount of code needed to replicate the issue be what is needed?
And where should I provide this? I can put it on a new public GitHub repo?



On Monday, April 2, 2018 at 8:27:58 PM UTC+3, Jesse Glick wrote:
>
> On Mon, Apr 2, 2018 at 12:07 PM, Daniel Anechitoaie 
> <danie...@gmail.com > wrote: 
> > If I run my plugin just on master (so not inside a 
> > MasterToSlaveCallable) it does get interrupted ok (not instantly but as 
> soon 
> > as zip operation is finished and without errors). 
> > So my understanding is that maybe something in how 
> MasterToSlaveCallables 
> > are handled cause this strange behaviour since on master and on 
> pipelines 
> > works ok and the problem 
> > seems to be just for MasterToSlaveCallables. 
>
> Not sure offhand. Sounds like it could be a bug in Jenkins core. Would 
> need to have a minimal self-contained test case that could be run 
> through a debugger to track down the culprit. 
>

-- 
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/6f08246a-d3c1-4e08-9860-c7c85b548e19%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: java.nio.channels.ClosedByInterruptException when I click cancel button from a running job

2018-04-02 Thread Daniel Anechitoaie



*>This is a sign that your zip operation is uninterruptible, which is > 
potentially a problem, though perhaps not your first priority for bug > 
fixing.*

I'm totally ok if it's not interruptible. It's a 3rd party lib and you 
can't expect all libs to work perfectly.
But it should interrupt after zip operation finishes, no?
So it should just be delayed a little which is totally ok.

I've check all the code from the zip library I use (org.zeroturnaround.zip) 
and they don't seem to be doing anything with Interrupted expecting that 
would case this behaviour. 
Also If I run my plugin just on master (so not inside a 
MasterToSlaveCallable) it does get interrupted ok (not instantly but as 
soon as zip operation is finished and without errors).
So my understanding is that maybe something in how MasterToSlaveCallables 
are handled cause this strange behaviour since on master and on pipelines 
works ok and the problem
seems to be just for MasterToSlaveCallables.

I even wrapped all my zipping code in a try {} catch (Exception e) {} and 
nothing is thrown by the zip code.



*> Well, `ArtifactArchiver` in core does something conceptually similar, *
*> for example. *
I've checked this and the code there is kind of split into multiple client 
to master operations plus it doesn't use any 3rd party library.
It first makes a call `FilePath.act(` to get the list of files. And then it 
calls .archive on them.
Everything seems to be handled with just calls to FilePath methods so just 
native internal Jenkins APIs




On Friday, March 23, 2018 at 9:37:41 PM UTC+2, Jesse Glick wrote:
>
> On Fri, Mar 23, 2018 at 3:21 PM, Daniel Anechitoaie 
> <danie...@gmail.com > wrote: 
> > If it happens and it's while a long running process (like zipping a big 
> > folder) it even asks me after a while if I want to force close the job 
> which 
> > also works. 
>
> This is a sign that your zip operation is uninterruptible, which is 
> potentially a problem, though perhaps not your first priority for bug 
> fixing. 
>
> > I did searched for other plugins that implement a build step and that 
> > actually try to do any kind of file processing inside those builds 
>
> Well, `ArtifactArchiver` in core does something conceptually similar, 
> for example. 
>

-- 
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/5a7386f4-fb06-49d6-bc9e-d500dd576042%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: java.nio.channels.ClosedByInterruptException when I click cancel button from a running job

2018-03-23 Thread Daniel Anechitoaie
With pipelines seems to be working fine. If I click cancel the job is 
properly canceled without any errors.
If it happens and it's while a long running process (like zipping a big 
folder) it even asks me after a while if I want to force close the job 
which also works.

So the problem seems to be only with freestyle builds.


*> unless this problem seems applicable to a variety *
*> of plugins and somehow never got reported before. *
I think I should've become a QA as somehow I always have the luck of 
finding the most unexpected issues in unexpected cases.
I did searched for other plugins that implement a build step and that 
actually try to do any kind of file processing inside those builds but I 
haven't any similar to what I'm doing
so I can see how they are doing it and if they have same issues as me or 
not.


Anyway I guess I'll give up on this as I have no idea what else I can do 
and be happy that it works ok with pipeline builds as freestyle builds are 
kind of slowly becoming legacy. 


Thank you for your help, at least I have a better understanding of what's 
happening.



On Friday, March 23, 2018 at 8:44:09 PM UTC+2, Jesse Glick wrote:
>
> On Fri, Mar 23, 2018 at 2:19 PM, Daniel Anechitoaie 
> <danie...@gmail.com > wrote: 
> > Now when I click cancel I get. 
>
> In other words, the same as before? 
>
> I think we have reached the limit of what is possible for “debugging 
> by telegram”. If you have a self-contained, minimal, reproducible test 
> case, you should file a bug report with those details. Given that this 
> probably only applies to freestyle and not Pipeline builds, I cannot 
> foresee anyone taking the time to work on an analysis and fix instead 
> of other priorities, unless this problem seems applicable to a variety 
> of plugins and somehow never got reported before. 
>

-- 
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/7c72e4eb-3739-4cdd-bd2d-9947b8db34e5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: java.nio.channels.ClosedByInterruptException when I click cancel button from a running job

2018-03-23 Thread Daniel Anechitoaie
I took latest Jenkins code from master, applied your patch, and runt the 
plugin.
Now when I click cancel I get.

Mar 23, 2018 8:13:31 PM hudson.model.Run execute
SEVERE: Failed to save build record
java.nio.channels.ClosedByInterruptException
at 
java.nio.channels.spi.AbstractInterruptibleChannel.end(AbstractInterruptibleChannel.java:202)
at sun.nio.ch.FileChannelImpl.write(FileChannelImpl.java:216)
at hudson.util.FileChannelWriter.write(FileChannelWriter.java:72)
at java.io.Writer.write(Writer.java:192)
at hudson.util.AtomicFileWriter.write(AtomicFileWriter.java:162)
at java.io.Writer.write(Writer.java:157)
at hudson.XmlFile.write(XmlFile.java:189)
at hudson.model.Run.save(Run.java:1923)
at hudson.model.Run.execute(Run.java:1784)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)


On Friday, March 23, 2018 at 5:30:03 PM UTC+2, Jesse Glick wrote:
>
> On Fri, Mar 23, 2018 at 8:19 AM, Daniel Anechitoaie 
> <danie...@gmail.com > wrote: 
> > So it kind of seems that only MasterToSlaveFileCallable supports being 
> > interrupted while MasterToSlaveCallable it does not. 
>
> That would be odd, since file callables are just a bit of sugar, 
> internally implemented using generic callables. The one thing that 
> strikes my notice is that the wrapper translates 
> `InterruptedException` to `TunneledInterruptedException`, though this 
> ought to be transparent as `FilePath.act` unwraps that and rethrows 
> the original `InterruptedException`. 
>

-- 
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/91c4946a-7510-4d5a-893e-97e75e0eb2f3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: java.nio.channels.ClosedByInterruptException when I click cancel button from a running job

2018-03-23 Thread Daniel Anechitoaie
*>  Perhaps the ZIP function is not interruptible,  *
I think so too.


*> which is too bad, but then the symptom should merely be that the ZIP 
proceeds to completion, and then *
*> the build is shown as aborted in the normal way. *
Which is totally fine. I zip things in a loop so even if it can't be 
interrupted right away but it will stop the next loop iteration from 
happening is totally fine.


*> Check if this helps either or both of *
*> your cases (ZIP and HTTP) without regressing the `sleep` case: *
Give me some time to figure out how to compile Jenkins with this patch and 
then run my plugin in it and I'll come back with feedback.


Some other things that I noticed while doing all kind of tests is that:
The problem reported in this thread happens when I use:

---
workspace.act(new DeployCallable(...
...
private static class DeployCallable extends MasterToSlaveFileCallable 
{..
---

if I use

---
launcher.getChannel().call(new DeployCallable(...
...
private static class DeployCallable extends MasterToSlaveCallable<Void, 
IOException> {
---

then it's not possible to interrupt at all. If I click cancel the full 
build step runs and only at the end the build is marked as interrupted. 
So it kind of seems that only MasterToSlave*File*Callable supports being 
interrupted while MasterToSlaveCallable it does not.

But this is a different issue, so I just brought it up as a FYI. I'll run 
the tests with your patch and MasterToSlaveFileCallable




BTW thank you so much for the help, I've been having this issue for a long 
time but now it's the first time I feel I'm making some progress in 
figuring out what's going on.



On Thursday, March 22, 2018 at 8:04:10 PM UTC+2, Jesse Glick wrote:
>
> On Wed, Mar 21, 2018 at 5:33 PM, Daniel Anechitoaie 
> <danie...@gmail.com > wrote: 
> > java.lang.InterruptedException 
> > at hudson.model.Build$BuildExecution.build(Build.java:214) 
>
> So this is from 
>
>
> https://github.com/jenkinsci/jenkins/blob/3b5c715ae0d00ec3a38c63d8c9bf9de2a76b9e29/core/src/main/java/hudson/model/Build.java#L212-L214
>  
>
> I suspect that code is wrong—see below. 
>
> > But in Jenkins build log it just stops and nothing is displayed. 
>
> Not sure what would cause that. The stack trace implies that the 
> `InterruptedException` should be caught here: 
>
>
> https://github.com/jenkinsci/jenkins/blob/3b5c715ae0d00ec3a38c63d8c9bf9de2a76b9e29/core/src/main/java/hudson/model/Run.java#L1740-L1745
>  
>
> as apparently happened in your `Thread.sleep` test builder. Perhaps 
> the ZIP function is not interruptible, which is too bad, but then the 
> symptom should merely be that the ZIP proceeds to completion, and then 
> the build is shown as aborted in the normal way. 
>
> > If I cancel during the HTTP upload part there I get the 
> java.nio.channels.ClosedByInterruptException 
>
> That would be consistent with my hypothesis that the thread interrupt 
> flag is not getting cleared. Check if this helps either or both of 
> your cases (ZIP and HTTP) without regressing the `sleep` case: 
>
> diff --git a/core/src/main/java/hudson/model/Build.java 
> b/core/src/main/java/hudson/model/Build.java 
> index 15aed23050..7f2fbbbc34 100644 
> --- a/core/src/main/java/hudson/model/Build.java 
> +++ b/core/src/main/java/hudson/model/Build.java 
> @@ -208,8 +208,7 @@ public abstract class Build  Project<P,B>,B extends Build<P,B>> 
>  return false; 
>  } 
>
> -Executor executor = getExecutor(); 
> -if (executor != null && executor.isInterrupted()) { 
> +if (Thread.interrupted()) { 
>  // someone asked build interruption, let stop the 
> build before trying to run another build step 
>  throw new InterruptedException(); 
>  } 
>

-- 
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/8ad400c2-03be-402e-8ac1-1545559fce40%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: java.nio.channels.ClosedByInterruptException when I click cancel button from a running job

2018-03-22 Thread Daniel Anechitoaie
I’ve added two replies to this thread by my emails keep getting deleted and 
they don’t appear on the group on the web.
Have i did something wrong?



> On 21 Mar 2018, at 17:32, Jesse Glick <jgl...@cloudbees.com> wrote:
> 
> On Wed, Mar 21, 2018 at 7:12 AM, Daniel Anechitoaie
> <daniels0...@gmail.com> wrote:
>> [Is it] possible maybe one of these libraries? […]
>> 
>> I tried a test with just a bunch of Thread.sleep() before it gets to my code
>> (that zips the files and HTTP puts them) and if I cancel the job there it
>> gets aborted nicely and is handled properly by Jenkins.
> 
> So sounds like a problem in the interaction between the behavior of
> those libraries and Jenkins interrupt handling. Again I suspect that
> something is catching interrupts, proceeding without throwing
> `InterruptedException`, but then setting the thread interrupt flag and
> this gets ignored up until the moment the build record is being
> finalized and the NIO calls made from `AtomicFileWriter` check the
> flag. If true, the solution would probably be for the code which runs
> an individual build step (somewhere in `AbstractBuild` IIRC) to check
> the interrupt flag and throw `InterruptedException` at that time.
> Could be verified in a `JenkinsRule`-based test by having a
> `TestBuilder` which mimics the relevant behavior of these libraries.
> 
> I doubt this particular issue could apply to Pipeline builds, though
> there might be other ways in which interrupt handling is incorrect
> there as well.
> 
> -- 
> You received this message because you are subscribed to a topic in the Google 
> Groups "Jenkins Developers" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/jenkinsci-dev/BSL0N5UwyC8/unsubscribe.
> To unsubscribe from this group and all its topics, 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/CANfRfr1G3%3DVt28Y2pXupBTUVdsw-D%3DOBpkqv-%3Dw4sTtdoxsOyg%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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/25DD2FFF-B0F2-40AA-9E22-A4D418CEDEA3%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: java.nio.channels.ClosedByInterruptException when I click cancel button from a running job

2018-03-20 Thread Daniel Anechitoaie
This happens all the time for me. So I run the plugin (in dev mode) with 
"mvn hpi:run", start the build, click cancel, and boom, I get this 
exception.

On Tuesday, March 20, 2018 at 11:27:48 PM UTC+2, Jesse Glick wrote:
>
> Offhand that sounds like a core bug. If you were just unlucky enough 
> to cancel at the exact moment `Run.save` was being called, then that 
> is a robustness fix. Possibly some other exception was thrown which 
> failed to clear the thread interruption flag. Would need a 
> self-contained reproducible test case to analyze—if you have one, file 
> a bug report. 
>

-- 
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/42dfdb2a-1ec6-47e0-9507-a3bb02b4c44d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


java.nio.channels.ClosedByInterruptException when I click cancel button from a running job

2018-03-20 Thread Daniel Anechitoaie
Hi,

I'm wrting a plugin that implements a SimpleBuildStep and I have a strange 
behaivour that I don't understand.
If I start the build and then click the cancel button while it's in 
progress I get a java.nio.channels.ClosedByInterruptException and the job 
fails with error instead of with the normal job interupted status.

He're the full stack trace:

java.nio.channels.ClosedByInterruptException
at 
java.nio.channels.spi.AbstractInterruptibleChannel.end(AbstractInterruptibleChannel.java:202)
at sun.nio.ch.FileChannelImpl.write(FileChannelImpl.java:216)
at hudson.util.FileChannelWriter.write(FileChannelWriter.java:72)
at java.io.Writer.write(Writer.java:192)
at hudson.util.AtomicFileWriter.write(AtomicFileWriter.java:162)
at java.io.Writer.write(Writer.java:157)
at hudson.XmlFile.write(XmlFile.java:189)
at hudson.model.Run.save(Run.java:1923)
at hudson.model.Run.execute(Run.java:1784)


My plugin is a Builder plugin that implements SimpleBuildStep and I run my 
code (which zips some files from the workspace and uploads them to a 
server) in a 
"private static class DeployCallable extends 
MasterToSlaveFileCallable" instance that is called using 
"workspace.act(new DeployCallable(...".

The strange thing is that if I restar Jenkins then the build that I 
canceled also dissapears from the build history for this job.


Any idea what would cause this issue? And idea what can I do to fix it?

Also am I using the right class/method (workspace.act and 
MasterToSlaveFileCallable) to make my plugin compatible with master/slave 
setups?


The code for the plugin is here if it 
helps: 
https://github.com/jenkinsci/osf-builder-suite-for-sfcc-deploy-plugin/blob/master/src/main/java/org/jenkinsci/plugins/osfbuildersuiteforsfcc/deploy/DeployBuilder.java#L265

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/5786267e-1c2a-430c-a6c6-880cd65f54e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Looking for some feedback to make my plugin work in distributed Jenkins (master/slave) setups

2017-09-27 Thread Daniel Anechitoaie
Hi,

I'm looking for some feedback regarding making my plugin work in 
distributed Jenkins (master/slave) setups.
For now I have made a "private static class DeployCallable extends 
MasterToSlaveCallable" internal class 
with all my code being inside the "public Boolean call() throws 
InterruptedException" method.
I then just call this method with "
launcher.getChannel().call(deployCallable)".

https://github.com/jenkinsci/osf-builder-suite-for-sfcc-deploy-plugin/blob/master/src/main/java/org/jenkinsci/plugins/osfbuildersuiteforsfcc/deploy/DeployBuilder.java#L413


I think current code should work in a distributed Jenkins (master/slave) 
setup.

I just have one problem, if a user cancels the build from the master my 
plugin does not get interrupted and still gets executed until the end and 
only then the job is marked as canceled even tough it still finished doing 
everything.

I have described this issue here 
https://issues.jenkins-ci.org/browse/JENKINS-46705

Is there anything that I can do? I'm thinking of breaking my "do it all" "
DeployCallable" into smaller pieces. Like one DeployCallable class to 
prepare the build and return a list of folders to be deployed, then another 
DeployCallable class that will zip one folder and iterate from master over 
the list returned by the first callable and then call this other Callable 
to zip one folder at a time, then another DeployCallable class that will 
upload the zip files and do the same iterate over the list of zips 
generated by the previous callable and call this Callable for each zip to 
upload it.

Would this make sense? I think in this case the interrupted exception might 
work? But my code will be more complicated and ugly.

What are my options? What can I do? 

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/c7ecd19d-021a-4bde-97cc-be2d5ba966c2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Looking for some feedback to make my plugin work in distributed Jenkins (master/slave) setups

2017-09-23 Thread Daniel Anechitoaie
Hi,

I'm looking for some feedback regarding making my plugin work in 
distributed Jenkins (master/slave) setups.
For now I have made a "private static class DeployCallable extends 
MasterToSlaveCallable" internal class 
with all my code being inside the "public Boolean call() throws 
InterruptedException" method.
I then just call this method with "
launcher.getChannel().call(deployCallable)".

https://github.com/jenkinsci/osf-builder-suite-for-sfcc-deploy-plugin/blob/master/src/main/java/org/jenkinsci/plugins/osfbuildersuiteforsfcc/deploy/DeployBuilder.java#L413


I think current code should work in a distributed Jenkins (master/slave) 
setup.

I just have one problem, if a user cancels the build from the master my 
plugin does not get interrupted and still gets executed until the end and 
only then the job is marked as canceled even tough it still finished doing 
everything.

I have described this issue 
here https://issues.jenkins-ci.org/browse/JENKINS-46705

Is there anything that I can do? I'm thinking of breaking my "do it all" "
DeployCallable" into smaller pieces. Like one DeployCallable class to 
prepare the build and return a list of folders to be deployed, then another 
DeployCallable class that will zip one folder and iterate from master over 
the list returned by the first callable and then call this other Callable 
to zip one folder at a time, then another DeployCallable class that will 
upload the zip files and do the same iterate over the list of zips 
generated by the previous callable and call this Callable for each zip to 
upload it.

Would this make sense? I think in this case the interrupted exception might 
work? But my code will be more complicated and ugly.

What are my options? What can I do? 

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/44a583ac-c6b7-43b1-b62a-da9d9497adff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Wiki page seems to be having some kind of caching issues

2017-09-11 Thread Daniel Anechitoaie
Thank you.

On Monday, September 11, 2017 at 5:51:23 PM UTC+3, Daniel Beck wrote:
>
>
> > On 11. Sep 2017, at 13:29, Daniel Anechitoaie <danie...@gmail.com 
> > wrote: 
> > 
> > My main concern is that page at 
> https://plugins.jenkins.io/osf-builder-suite-for-sfcc-deploy does't seem 
> to get updated. 
> > 
>
> https://issues.jenkins-ci.org/browse/WEBSITE-378 has been merged into 
> staging a week ago, but it's not in production. I poked our infra guys. 
>
>

-- 
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/3084b77a-b0b7-49da-b328-01f9014ee80e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Wiki page seems to be having some kind of caching issues

2017-09-11 Thread Daniel Anechitoaie
Hi, yes, that solves it for me, as it seems the cache is by URL.
But what about the plugin site? 
I don't think https://plugins.jenkins.io/ makes use of suck query strings 
tricks. I guess they always query just the normal URL.
As result https://plugins.jenkins.io/osf-builder-suite-for-sfcc-deploy doesn't 
seem to be updated even tough it passed almost 20h since my change.



On Monday, September 11, 2017 at 2:58:42 PM UTC+3, Baptiste Mathus wrote:
>
> Caching issue?
>
> Try adding a fake parameter to the URL. 
> Like "?wat=tf"
>
>
>
>
>
> Le 11 sept. 2017 13:29, "Daniel Anechitoaie" <danie...@gmail.com 
> > a écrit :
>
>> My main concern is that page at 
>> https://plugins.jenkins.io/osf-builder-suite-for-sfcc-deploy does't seem 
>> to get updated.
>> I made the changes on the wiki page more than 12 hours ago and according 
>> to 
>> https://wiki.jenkins.io/display/JENKINS/Plugin+Site+Information+for+Plugin+Developers
>>  
>> that page should update every 6 hours.
>>
>>
>> On Monday, September 11, 2017 at 10:33:50 AM UTC+3, Daniel Anechitoaie 
>> wrote:
>>>
>>> Any idea what's wrong with following Wiki page 
>>> https://wiki.jenkins.io/display/JENKINS/OSF+Builder+Suite+For+Salesforce+Commerce+Cloud+Deploy+Plugin
>>>  
>>> ?
>>> On "last modified" it always says "less than a minute ago" when I 
>>> actually edited the page hours ago.
>>> Also at the bottom of the page, where you can leave comments it appears 
>>> as I am "IRC Bot" and not me, while on other wiki pages it seems to be ok.
>>>
>>>
>>> <https://lh3.googleusercontent.com/-2yOV2t79X_Y/WbY7wfE2GYI/Atk/-an7TknxsfULCES3UPzlWY0q8uJzWOEoQCLcBGAs/s1600/Screen%2BShot%2B2017-09-11%2Bat%2B10.29.51.png>
>>>
>>> -- 
>> 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/e7379fd1-43ac-4146-a321-bc69c48f744d%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-dev/e7379fd1-43ac-4146-a321-bc69c48f744d%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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/7e991e4c-066f-4a7a-a700-7c127e68acb9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Wiki page seems to be having some kind of caching issues

2017-09-11 Thread Daniel Anechitoaie
My main concern is that page 
at https://plugins.jenkins.io/osf-builder-suite-for-sfcc-deploy does't seem 
to get updated.
I made the changes on the wiki page more than 12 hours ago and according 
to 
https://wiki.jenkins.io/display/JENKINS/Plugin+Site+Information+for+Plugin+Developers
 
that page should update every 6 hours.


On Monday, September 11, 2017 at 10:33:50 AM UTC+3, Daniel Anechitoaie 
wrote:
>
> Any idea what's wrong with following Wiki page 
> https://wiki.jenkins.io/display/JENKINS/OSF+Builder+Suite+For+Salesforce+Commerce+Cloud+Deploy+Plugin
>  
> ?
> On "last modified" it always says "less than a minute ago" when I actually 
> edited the page hours ago.
> Also at the bottom of the page, where you can leave comments it appears as 
> I am "IRC Bot" and not me, while on other wiki pages it seems to be ok.
>
>
> <https://lh3.googleusercontent.com/-2yOV2t79X_Y/WbY7wfE2GYI/Atk/-an7TknxsfULCES3UPzlWY0q8uJzWOEoQCLcBGAs/s1600/Screen%2BShot%2B2017-09-11%2Bat%2B10.29.51.png>
>
>

-- 
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/e7379fd1-43ac-4146-a321-bc69c48f744d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Wiki page seems to be having some kind of caching issues

2017-09-11 Thread Daniel Anechitoaie


Any idea what's wrong with following Wiki 
page 
https://wiki.jenkins.io/display/JENKINS/OSF+Builder+Suite+For+Salesforce+Commerce+Cloud+Deploy+Plugin
 
?
On "last modified" it always says "less than a minute ago" when I actually 
edited the page hours ago.
Also at the bottom of the page, where you can leave comments it appears as 
I am "IRC Bot" and not me, while on other wiki pages it seems to be ok.



-- 
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/bda4088d-5164-447d-ba01-0a7a7893f49a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How are pages from https://plugins.jenkins.io/plugin generated?

2017-09-09 Thread Daniel Anechitoaie
Thank you.

On Sunday, September 10, 2017 at 1:03:32 AM UTC+3, Daniel Beck wrote:
>
>
> > On 10. Sep 2017, at 00:02, Daniel Anechitoaie <danie...@gmail.com 
> > wrote: 
> > 
> > How are pages from https://plugins.jenkins.io/plugin generated? 
> > Where is the content pulled from? Is it taken from its wiki page? 
> > 
>
>
> https://wiki.jenkins.io/display/JENKINS/Plugin+Site+Information+for+Plugin+Developers
>  
>
>

-- 
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/aa781e54-9d2f-4954-b217-a4f1cef7c2f3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How are pages from https://plugins.jenkins.io/plugin generated?

2017-09-09 Thread Daniel Anechitoaie
How are pages from https://plugins.jenkins.io/plugin generated?
Where is the content pulled from? Is it taken from its wiki page?

-- 
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/e4a1e96d-5faa-4b64-91ea-43cdd77f2376%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2017-09-07 Thread Daniel Anechitoaie
Thanks.

On Monday, September 4, 2017 at 4:10:39 AM UTC+3, Denys Digtiar wrote:
>
> You can refer to 
> https://wiki.jenkins.io/display/JENKINS/How+to+report+an+issue to learn 
> about the process.
>
> On Monday, August 28, 2017 at 11:53:45 PM UTC+10, Daniel Anechitoaie wrote:
>>
>> 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 
>>> <danie...@gmail.com> 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/2a3a139c-f265-4aa0-ae9a-a1c01b95721b%40googlegroups.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 
> <danie...@gmail.com > 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.


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.


Re: "One or more fields in this block have been edited." is always displayed.

2017-08-08 Thread Daniel Anechitoaie
Hi,

I have replaced now the 





with 









and seems to be working fine.

Thank you.




On Tuesday, August 8, 2017 at 3:30:41 PM UTC+3, Jesse Glick wrote:
>
> On Mon, Aug 7, 2017 at 3:54 PM, Daniel Anechitoaie 
> <danie...@gmail.com > wrote: 
> > So it seems that this is normal, and this is to show that the data has 
> been 
> > changed and it's no longer the default value. 
>
> Yes. I am not sure if this is well tested with repeatable sections. 
> Definitely you should be using normal databinding, meaning 
> `f:repeatableProperty` with no body (`config.jelly` gets looked up on 
> the nested `Describable`); see `ui-samples-plugin`. 
>

-- 
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/12acabdf-266e-489b-bb05-5e81c178ada9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: "One or more fields in this block have been edited." is always displayed.

2017-08-07 Thread Daniel Anechitoaie
I think I figured it out. This actually seems to be a feature of Jenkins 
and not a bug in my code.
After looking trough Jenkins code I found in textbox.jelly the following.

  
${customizedFields.add(name)}
  

So it seems that this is normal, and this is to show that the data has been 
changed and it's no longer the default value.
I was actually thinking otherwise that it's a bug in my code as I haven't 
seen this "modified" icon in any other plugin that has an "advanced" 
section, that I've tested.

If anyone can please confirm my above findings are true it would be great.

Thanks.



On Monday, August 7, 2017 at 10:33:58 PM UTC+3, Daniel Anechitoaie wrote:
>
> I have the following config.jelly file 
> https://bitbucket.org/snippets/danechitoaie/EAgn4K
> Which generates repeatable string textboxes but the problem is that each 
> time I access the configuration page I get this "One or more fields in this 
> block have been edited." without touching anything.
>
> Any idea why this happens? And what I can do to not behave like this?
>
> PrintScreen of how it looks: http://i.imgur.com/1estWLh.png
>
>
> Another strange thing I noticed is that if I have just a "<f:checkbox" 
> inside and if I have the "field" attribute it behaves the same (as in I get 
> this "One or more fields in this block have been edited." icon 
> without doing anything.) But if I replace the "field" attribute with "name" 
> it still work sand aI don't get this icon and message.
>
>
> 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/82b7f4f8-5ee8-4f09-9f38-775b140505ad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


"One or more fields in this block have been edited." is always displayed.

2017-08-07 Thread Daniel Anechitoaie
I have the following config.jelly 
file https://bitbucket.org/snippets/danechitoaie/EAgn4K
Which generates repeatable string textboxes but the problem is that each 
time I access the configuration page I get this "One or more fields in this 
block have been edited." without touching anything.

Any idea why this happens? And what I can do to not behave like this?

PrintScreen of how it looks: http://i.imgur.com/1estWLh.png


Another strange thing I noticed is that if I have just a "

Re: FilePath act fails with an exception

2015-05-25 Thread Daniel Anechitoaie
Just wanting to say thanks. I had the same issue, Googled a little bit and 
found the answer here. Changing it to MasterToSlaveFileCallable worked.

On Monday, April 20, 2015 at 5:23:34 PM UTC+3, Jesse Glick wrote:

 On Thu, Apr 16, 2015 at 2:49 AM, Sverre Moe sverr...@gmail.com 
 javascript: wrote: 
  I changed the code to extend MasterToSlaveFileCallable, but the 
 exception is still the same. 

 No, that is a totally unrelated exception, which smells like a failure 
 to do a clean build. 


-- 
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/59f3dcff-3f83-42a9-89d3-ed1dd95d82ec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to $TOKENS vars in a textbox in a plugin

2015-01-13 Thread Daniel Anechitoaie
Perfect, Thank you.
I think the extended emails plugin does the same.

 On 12 Jan 2015, at 23:39, Slide slide.o@gmail.com wrote:
 
 The best idea is to depend on the token-macro plugin and then use the methods 
 in there to parse the text.
 
 On Mon Jan 12 2015 at 2:15:59 PM Daniel Anechitoaie daniels0...@gmail.com 
 mailto:daniels0...@gmail.com wrote:
 Hi.
 
 I have a plugin that has a textbox. How can I parse the contents of that 
 textbox for vars and tokens. Like the extended email plugin does. If you 
 write $TOKEN this will be replaced with the actuall content of the token when 
 the email is received. How can I do the same in my plugin? I'm not looking to 
 add new env vars, but to access the existing ones.
 
 So for example if a user enters Build${BUILD_ID} I would get 
 BuildACTUAL_BUILD_ID.
 
 Thanks for any suggestions or hints.
 
 -- 
 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 
 mailto:jenkinsci-dev+unsubscr...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/jenkinsci-dev/584ed4d7-11ac-491e-91d6-e398dfb00090%40googlegroups.com
  
 https://groups.google.com/d/msgid/jenkinsci-dev/584ed4d7-11ac-491e-91d6-e398dfb00090%40googlegroups.com?utm_medium=emailutm_source=footer.
 For more options, visit https://groups.google.com/d/optout 
 https://groups.google.com/d/optout.
 
 -- 
 You received this message because you are subscribed to a topic in the Google 
 Groups Jenkins Developers group.
 To unsubscribe from this topic, visit 
 https://groups.google.com/d/topic/jenkinsci-dev/gTBL05WUhQg/unsubscribe 
 https://groups.google.com/d/topic/jenkinsci-dev/gTBL05WUhQg/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to 
 jenkinsci-dev+unsubscr...@googlegroups.com 
 mailto:jenkinsci-dev+unsubscr...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/jenkinsci-dev/CAPiUgVcQM9gPsFoPb9d9amiFnknkQd_1jhk54NX%2BC0YMBm757w%40mail.gmail.com
  
 https://groups.google.com/d/msgid/jenkinsci-dev/CAPiUgVcQM9gPsFoPb9d9amiFnknkQd_1jhk54NX%2BC0YMBm757w%40mail.gmail.com?utm_medium=emailutm_source=footer.
 For more options, visit https://groups.google.com/d/optout 
 https://groups.google.com/d/optout.

-- 
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/8B22B236-DCB4-4082-A76A-3C924D0B6744%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to $TOKENS vars in a textbox in a plugin

2015-01-13 Thread Daniel Anechitoaie
Thank you. 


 On 13 Jan 2015, at 14:44, Slide slide.o@gmail.com wrote:
 
 Yes, I use the token-macro plugin extensively in email-ext.
 
 On Tue Jan 13 2015 at 1:50:45 AM Daniel Anechitoaie daniels0...@gmail.com 
 mailto:daniels0...@gmail.com wrote:
 Perfect, Thank you.
 I think the extended emails plugin does the same.
 
 
 On 12 Jan 2015, at 23:39, Slide slide.o@gmail.com 
 mailto:slide.o@gmail.com wrote:
 
 
 The best idea is to depend on the token-macro plugin and then use the 
 methods in there to parse the text.
 
 On Mon Jan 12 2015 at 2:15:59 PM Daniel Anechitoaie daniels0...@gmail.com 
 mailto:daniels0...@gmail.com wrote:
 Hi.
 
 I have a plugin that has a textbox. How can I parse the contents of that 
 textbox for vars and tokens. Like the extended email plugin does. If you 
 write $TOKEN this will be replaced with the actuall content of the token 
 when the email is received. How can I do the same in my plugin? I'm not 
 looking to add new env vars, but to access the existing ones.
 
 So for example if a user enters Build${BUILD_ID} I would get 
 BuildACTUAL_BUILD_ID.
 
 Thanks for any suggestions or hints.
 
 -- 
 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 
 mailto:jenkinsci-dev+unsubscr...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/jenkinsci-dev/584ed4d7-11ac-491e-91d6-e398dfb00090%40googlegroups.com
  
 https://groups.google.com/d/msgid/jenkinsci-dev/584ed4d7-11ac-491e-91d6-e398dfb00090%40googlegroups.com?utm_medium=emailutm_source=footer.
 For more options, visit https://groups.google.com/d/optout 
 https://groups.google.com/d/optout.
 
 -- 
 
 You received this message because you are subscribed to a topic in the 
 Google Groups Jenkins Developers group.
 To unsubscribe from this topic, visit 
 https://groups.google.com/d/topic/jenkinsci-dev/gTBL05WUhQg/unsubscribe 
 https://groups.google.com/d/topic/jenkinsci-dev/gTBL05WUhQg/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to 
 jenkinsci-dev+unsubscr...@googlegroups.com 
 mailto:jenkinsci-dev+unsubscr...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/jenkinsci-dev/CAPiUgVcQM9gPsFoPb9d9amiFnknkQd_1jhk54NX%2BC0YMBm757w%40mail.gmail.com
  
 https://groups.google.com/d/msgid/jenkinsci-dev/CAPiUgVcQM9gPsFoPb9d9amiFnknkQd_1jhk54NX%2BC0YMBm757w%40mail.gmail.com?utm_medium=emailutm_source=footer.
 
 
 For more options, visit https://groups.google.com/d/optout 
 https://groups.google.com/d/optout.
 
 
 -- 
 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 
 mailto:jenkinsci-dev+unsubscr...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/jenkinsci-dev/8B22B236-DCB4-4082-A76A-3C924D0B6744%40gmail.com
  
 https://groups.google.com/d/msgid/jenkinsci-dev/8B22B236-DCB4-4082-A76A-3C924D0B6744%40gmail.com?utm_medium=emailutm_source=footer.
 For more options, visit https://groups.google.com/d/optout 
 https://groups.google.com/d/optout.
 
 -- 
 You received this message because you are subscribed to a topic in the Google 
 Groups Jenkins Developers group.
 To unsubscribe from this topic, visit 
 https://groups.google.com/d/topic/jenkinsci-dev/gTBL05WUhQg/unsubscribe 
 https://groups.google.com/d/topic/jenkinsci-dev/gTBL05WUhQg/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to 
 jenkinsci-dev+unsubscr...@googlegroups.com 
 mailto:jenkinsci-dev+unsubscr...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/jenkinsci-dev/CAPiUgVc33R2x9gumAzDp3ZYfN22j17tx0y49zDqw76pXJfHFbQ%40mail.gmail.com
  
 https://groups.google.com/d/msgid/jenkinsci-dev/CAPiUgVc33R2x9gumAzDp3ZYfN22j17tx0y49zDqw76pXJfHFbQ%40mail.gmail.com?utm_medium=emailutm_source=footer.
 For more options, visit https://groups.google.com/d/optout 
 https://groups.google.com/d/optout.

-- 
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/1FA231DD-5221-4B30-AC16-FA07558FA9C2%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


How to $TOKENS vars in a textbox in a plugin

2015-01-12 Thread Daniel Anechitoaie
Hi.

I have a plugin that has a textbox. How can I parse the contents of that 
textbox for vars and tokens. Like the extended email plugin does. If you 
write $TOKEN this will be replaced with the actuall content of the token 
when the email is received. How can I do the same in my plugin? I'm not 
looking to add new env vars, but to access the existing ones.

So for example if a user enters Build${BUILD_ID} I would get Build
*ACTUAL_BUILD_ID*.

Thanks for any suggestions or hints.

-- 
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/584ed4d7-11ac-491e-91d6-e398dfb00090%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How the get the user that does the build?

2014-05-15 Thread Daniel Anechitoaie
Hi,

I'm writing a Jenkins build plugin and I need to get the name of the person 
that started the build, or timer if the build was started by timer and so 
on.
Any idea how this info can be retrieved?

Thanks.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Error updating plugin

2014-02-21 Thread Daniel Anechitoaie
Hi,

I have a plugin that uses BouncyCastle and the issue is that every time i 
try to update it by uploading a new version i get the following error:

java.io.IOException: Failed to dynamically deploy this plugin
at 
hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:1304)
at hudson.model.UpdateCenter$DownloadJob.run(UpdateCenter.java:1103)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at 
hudson.remoting.AtmostOneThreadExecutor$Worker.run(AtmostOneThreadExecutor.java:104)
at java.lang.Thread.run(Unknown Source)
Caused by: java.nio.file.FileSystemException: C:\Program Files 
(x86)\Jenkins\plugins\my-builder\WEB-INF\lib\bcpkix-jdk15on-1.50.jar: The 
process cannot access the file because it is being used by another process.

at sun.nio.fs.WindowsException.translateToIOException(Unknown Source)
at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
at sun.nio.fs.WindowsFileSystemProvider.implDelete(Unknown Source)
at sun.nio.fs.AbstractFileSystemProvider.delete(Unknown Source)
at java.nio.file.Files.delete(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at hudson.Util.deleteFile(Util.java:238)
at hudson.Util.deleteRecursive(Util.java:301)
at hudson.Util.deleteContentsRecursive(Util.java:203)
at hudson.Util.deleteRecursive(Util.java:292)
at hudson.Util.deleteContentsRecursive(Util.java:203)
at hudson.Util.deleteRecursive(Util.java:292)
at hudson.Util.deleteContentsRecursive(Util.java:203)
at hudson.Util.deleteRecursive(Util.java:292)
at hudson.ClassicPluginStrategy.explode(ClassicPluginStrategy.java:423)
at 
hudson.ClassicPluginStrategy.createPluginWrapper(ClassicPluginStrategy.java:128)
at hudson.PluginManager.dynamicLoad(PluginManager.java:412)
at 
hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:1300)
... 6 more




Any idea what's going on and what can I do so my plugin would be able to be 
updated?

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Error updating plugin

2014-02-21 Thread Daniel Anechitoaie
I uploaded the new version from the Advanced section (Jenkins  Plugin 
Manager  Advanced) and there is no option there to chose how to instal it 
(with or without restart).

On Friday, February 21, 2014 5:04:42 PM UTC+2, Jesse Glick wrote:

 You need to restart Jenkins to update a plugin. (Jenkins should not 
 even offer the option to call dynamicLoad in this case; Daniel Beck 
 had a PR for this, which IIRC was merged recently.) 


-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Failed to build plugin

2014-02-18 Thread Daniel Anechitoaie
I've set

parent
groupIdorg.jenkins-ci.plugins/groupId
artifactIdplugin/artifactId
version1.551/version
/parent

And yes, I have 2 bouncy castle dependencies:

dependency
groupIdorg.bouncycastle/groupId
artifactIdbcpkix-jdk15on/artifactId
version1.50/version
/dependency
dependency
groupIdorg.bouncycastle/groupId
artifactIdbcprov-jdk15on/artifactId
version1.50/version
/dependency

But I had them since I've started working on my plugin and build did 
worked. Until today. All I did today was add another dependency to 
dependency
groupIdcom.google.javascript/groupId
artifactIdclosure-compiler/artifactId
versionv20140110/version
/dependency

and then when I tried to do a build again it didn't worked.

The weird thing is that i even reverted the code from GIT from before 
adding the dependency to closure-compiler when builds did worked but to no 
success i still wasn't able to do a build on that either.

On Tuesday, February 18, 2014 11:51:44 PM UTC+2, Jesse Glick wrote:

 BouncyCastle incompatibilities are a frequent headache for Jenkins 
 plugin developers. Check the version of Jenkins core you are using, 
 update as needed, and check your plugin’s declared dependencies: 
 sshd-module? Anything which in turns depends on BouncyCastle? 


-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Trying to enable CodeMirror but it's always in readonly mode

2014-02-09 Thread Daniel Anechitoaie
I have a textarea that I'm trying to enable CodeMirror for it and it does 
seem be working but it's always in readonly mode. 
I have added the following attributes codemirror-mode=htmlmixed and 
codemirror-config=mode:'text/html' to it and it does init CodeMirror on 
it but i cannot type anything in there. If I already have a value that i 
set before enabling CodeMirror i do se that text in there but same, in 
readonly mode.

Any idea what I'm doing wrong?

Thanks.

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Best way to load a file into a Jenkins plugin

2014-01-21 Thread Daniel Anechitoaie
Hi,

I'm writing a jenkins build plugin and the build needs to make some HTTPS 
calls but the server requires auth with a certificate and private key.
What would be the best way (from the user's point of view) to allow him to 
load a custom keystore from the project configuration page, under my 
plugin's section as I haven't seen Jenkins to support file data type and as 
the keystore is in binary format i can't create text filed where he can 
paste the certificate or something like this.

Any ideas and help is appreciated.

Thanks. 

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Jelly file filed?

2013-11-19 Thread Daniel Anechitoaie
Hi,

I'm writing a builder plugin and this plugin will need some configs. The 
only thing that's missing is a file input so users can upload a file that 
is used by the build plugin.
I'm not seeing this to be available 
https://wiki.jenkins-ci.org/display/JENKINS/Jelly+form+controls 
https://jenkins-ci.org/maven-site/jenkins-core/jelly-taglib-ref.html#form 

Is this possible somehow? How could I add this to my build plugin?


Thanks.

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Is it possible to zip a folder contents instead of zipping the folder itself with FilePath?

2013-11-18 Thread Daniel Anechitoaie
Yep. Found out how. 
FilePath class has the following method
public int 
*zip*(OutputStreamhttp://download.oracle.com/javase/6/docs/api/java/io/OutputStream.html?is-external=true
 out, DirScanner http://javadoc.jenkins-ci.org/hudson/util/DirScanner.html
 scanner)

And i can use *DirScanner.Glob *to set useDefaultExcludes to false.

Also see http://ant.apache.org/manual/dirtasks.html#patterns for 
default excludes.
(if someone else might have the same questions as i did).


Thanks.


On Monday, November 18, 2013 5:41:18 PM UTC+2, Aldrin Leal wrote:

 (an educated guess follows)

 there's an override for this method which allows you to specify 
 includes/excludes. the one sans this parameter uses the default excludes 
 (which I guess includes .svn/.git)

 --
 -- Aldrin Leal, ald...@leal.eng.br javascript:
 Master your EC2-fu! Get the latest ekaterminal public beta 
 http://www.ingenieux.com.br/products/ekaterminal/
  

 On Mon, Nov 18, 2013 at 12:26 PM, Daniel Anechitoaie 
 danie...@gmail.comjavascript:
  wrote:

 Thanks. This led me to the right direction and 
 using filePathDir.zip(zipOutputStream, **); does what i need with one 
 exception.
 I've tried to use this method to zip the workspace contents which has 
 code from SVN and this ignores the .svn folders from there and they are not 
 zipped.
 Does this mean that the .git folders will also be ignored or what is the 
 logic here? How do i know what will get into my zip and what would be left 
 out?
 Preferably i would like to have everything in my zip.

 Thanks. 

 On Monday, November 18, 2013 2:29:11 PM UTC+2, Daniel Beck wrote:

 Please see this Jira comment: 

 https://issues.jenkins-ci.org/browse/JENKINS-19947?
 focusedCommentId=187616page=com.atlassian.jira.plugin.
 system.issuetabpanels:comment-tabpanel#comment-187616 

 On 18.11.2013, at 12:16, Daniel Anechitoaie danie...@gmail.com wrote: 

  Hi, 
  
  I see that http://javadoc.jenkins-ci.org/hudson/FilePath.html#zip(
 hudson.FilePath) has a really nice method that allows you to quickly 
 zip a folder. 
  My issue is that this zips the folder itself and i need to only zip 
 the folder contents. 
  Is this possible? 
  
  
  Thanks, 
  And sorry but i'm new to Java/Jenkins. 
  
  -- 
  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. 
  For more options, visit https://groups.google.com/groups/opt_out. 

  -- 
 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 javascript:.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: How can i use commons-io 2.4 with Jenkins?

2013-11-17 Thread Daniel Anechitoaie
Thanks.

On Sunday, November 17, 2013 2:05:08 PM UTC+2, Dominik Bartholdi wrote:

 yes, this version will only be available for your plugin…
 /Domi

 On 17.11.2013, at 09:07, Daniel Anechitoaie danie...@gmail.comjavascript: 
 wrote:

 It works now. Thank you.
 Is this safe? Does this mean that commons-io 2.4 will be used only by my 
 plugin and it won't cause issues witj Jenkins as it uses an older version?

 On Sunday, November 17, 2013 8:20:05 AM UTC+2, Dominik Bartholdi wrote:

 change the class loader policy: 
 https://wiki.jenkins-ci.org/display/JENKINS/Plugin+Structure#PluginStructure-Classloader
 /Domi

 On 17.11.2013, at 00:20, Daniel Anechitoaie danie...@gmail.com wrote:

 Can anyone please help me with this? 

 http://stackoverflow.com/questions/20025146/how-can-i-use-commons-io-2-4-with-jenkins
 I'm new to Jenkins plugin dev and also to Java.

 Thanks.

 -- 
 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.
 For more options, visit https://groups.google.com/groups/opt_out.



 -- 
 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 javascript:.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


How can i use commons-io 2.4 with Jenkins?

2013-11-16 Thread Daniel Anechitoaie
Can anyone please help me with this? 
http://stackoverflow.com/questions/20025146/how-can-i-use-commons-io-2-4-with-jenkins
I'm new to Jenkins plugin dev and also to Java.

Thanks.

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.