Re: Catching a job cancel

2019-10-01 Thread John Westcott
Thanks for the tip on this. Unfortunately, my code does more than just sleep its also gathering log information as well as running status checks. Is there anyway to put a larger try/catch block around all of that code rather than just the sleep method? Or a way to register an action on the builder itself for an on-cancel event? Or would that have to be a request to Jenkins core?Does anyone have an example of implementing the RunListener extension point?-JohnOn Sep 30, 2019, at 5:06 AM, Robert Sandell  wrote:When a build is canceled the executor threads will be interrupted. So if your plugin is doing a remote call, waiting on something, or sleeping an InterruptedException will be thrown.Otherwise you can check the status of the current thread: Thread.currentThread().isInterrupted()/BDen tors 26 sep. 2019 kl 22:20 skrev Jeff Pearce :






You can probably get the info if you implement the RunListener extension point 
From:  on behalf of John Westcott IV 
Reply-To: "jenkinsci-dev@googlegroups.com" 
Date: Thursday, September 26, 2019 at 1:17 PM
To: Jenkins Developers 
Subject: Catching a job cancel

 

Notice:
This email is from an external sender.

 

Is it possible for a plugin to get a notification if a Jenkins job is cancelled while the plugin is working?

i.e. is there some kind of "public void on_job_cancel()" method I can implement to take some action if my plugin is actively running when a job is canceled?

I'm not seeing anything in the docs but wanted to double check in case I am missing something.

 

-John

 

-- 
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/6296320b-1e84-4caa-9686-475650e8d334%40googlegroups.com.




-- 
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/AEC405E5-912A-46E2-9FD2-84836E31A08E%40godaddy.com.
-- Robert SandellSoftware EngineerCloudBees, Inc.E: rsand...@cloudbees.comTwitter: robert_sandell

-- 
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/bD22cVOyp60/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/CALzHZS2RPku1jJR39z1_%3DLUkrKgsSvrZkBsgnMtaPZnYCmYPUA%40mail.gmail.com.




-- 
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/DAD8A4DE-2A7C-4789-8168-18B7C6D3D082%40redhat.com.


Re: Stapler Data Binding with Heterogeneous component

2019-10-01 Thread Jesse Glick
On Tue, Oct 1, 2019 at 7:24 AM Allan Burdajewicz
 wrote:
> I use a jelly /lib/form/descriptorList to display the components.

Does not sound right. That is a low-level control. I think you meant
to use a high-level control such as `repeatableHeteroProperty`.

-- 
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/CANfRfr2t5JAzTrb_z4SxAa%3DuCoFqwzJo-_6BAaz9hzBq%3D8o_-g%40mail.gmail.com.


Re: Jenkins global configuration

2019-10-01 Thread Jesse Glick
On Tue, Oct 1, 2019 at 5:06 AM Raihaan Shouhell
 wrote:
> I've been trying to implement a global configuration

Try using the sample in https://github.com/jenkinsci/archetypes which
includes a functional test that should 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/CANfRfr3ioYibmV3t8AcEYnH7rbA5ZWZqPXPyPnq14P2e_CHaDQ%40mail.gmail.com.


Stapler Data Binding with Heterogeneous component

2019-10-01 Thread Allan Burdajewicz
Hello Folks,

I am trying to put in place an abstraction layer to create UI components 
that are meant to be used on AbstractItem, Run and Computer actions. Those 
components do not need to be persisted / saved anywhere and are just 
information for the actual action POST. 

I use a jelly /lib/form/descriptorList to display the components. And the 
UI is working as expected.

On the Action POST method however, I want to retrieve the list of 
configured components (to a list of my abstract component) and therefore I 
cannot use the bindJSONToList method on the StaplerRequest as it would fail 
with: org.kohsuke.stapler.NoStaplerConstructorException: There's no 
@DataBoundConstructor on any constructor of class 
com.cloudbees.jenkins.support.components.AbstractComponent

I am not sure what is the right / best way for doing this ? Or maybe I do 
have to parse the JSON myself ? 

I have pushed the scenario to 
https://github.com/Dohbedoh/jenkins-extension-action-test to help 
understand what I am trying to do.

Any guidance / pointers would help.

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/64725f18-c029-4ca6-b357-c0a98fa106c8%40googlegroups.com.


Jenkins global configuration

2019-10-01 Thread Raihaan Shouhell
Hi all,

I've been trying to implement a global configuration but have an issue 
where only the username field is properly reflected and saved when I use 
the configuration UI.
Other plugins seem to do similar things.

Here is a repo with an MRE of what I get 
https://github.com/res0nance/global-test

Any help would be appreciated.

Cheers,
Raihaan

-- 
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/fd8ac17d-8317-4ddc-aa4c-7e8ce647ce41%40googlegroups.com.


Re: 2.190.2 LTS RC: Backporting JENKINS-59406?

2019-10-01 Thread Raihaan Shouhell
+1 to backporting

On Tuesday, 1 October 2019 14:16:58 UTC+8, Baptiste Mathus wrote:
>
> Hello everyone, hello Oliver,
>
> Our ongoing tests confirmed that 
> https://issues.jenkins-ci.org/browse/JENKINS-59406 is a problem.
>
> Can we consider backporting it? (Oleg already added the lts-candidate a 
> few days ago fwiw).
>
> 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/7797200e-2bc0-42a6-b099-06dc49ac194b%40googlegroups.com.


2.190.2 LTS RC: Backporting JENKINS-59406?

2019-10-01 Thread Baptiste Mathus
Hello everyone, hello Oliver,

Our ongoing tests confirmed that
https://issues.jenkins-ci.org/browse/JENKINS-59406 is a problem.

Can we consider backporting it? (Oleg already added the lts-candidate a few
days ago fwiw).

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CANWgJS5%3DB%2BdmWycsHiiMfR5OB8eVtv5z8UKnkEh3YiQOkr9%3DOQ%40mail.gmail.com.