Re: Unit testing with pipeline projects

2017-11-24 Thread Mark Waite
You can also refer to the pipeline tests in the hello-world-plugin fork
that I created for Jenkins World 2017.

https://github.com/MarkEWaite/hello-world-plugin/blob/jenkins-world-2017/src/test/java/org/jenkinsci/plugins/hello/HelloWorldBuilderTest.java

Same technique as noted by Ullrich Hafner.  Look at the pom.xml file for
the dependencies and at the java file for the test writing technique.

Mark Waite

On Fri, Nov 24, 2017 at 6:19 AM Ullrich Hafner 
wrote:

> Do you mean an integration test? A unit test never starts a Jenkins
> instance.
>
> Yes you can use any project type you like when your write an integration
> test. Just scan for some plugins that use a JenkinsRule.
>
> Example:
> https://github.com/jenkinsci/warnings-plugin/blob/master/src/test/java/hudson/plugins/warnings/WarningsWorkflowTest.java
>
>
> Am 24.11.2017 um 07:33 schrieb Lakshmi Narasimhan <
> vaikuntam.narasim...@gmail.com>:
>
> Hello.
>
> Is it possible to write a unit test with a pipeline project instead of a
> freestyle project?
>
> More generally, can we install additional plugins to the Jenkins instance
> launched during the test?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-dev/202cc319-fb39-44f5-92dd-fadb4aba80a8%40googlegroups.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/D135F6BE-607B-4545-9454-B91961C827CC%40gmail.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/CAO49JtEDCRg388JXX14SQ0gZ9ztKN0aD%2BNxqdiufOqix3UXESg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: SCM plugin not appearing as SCM option in project configuration

2017-11-24 Thread José Lamas Ríos


On Friday, November 24, 2017 at 10:47:53 AM UTC-3, José Lamas Ríos wrote:
>
>
> I've set breakpoints in the constructor, and the newInstance() and 
> getDisplayName() methods, but one of them gets hit.
>

Sorry, meant to say "but *none* of them get hit"
 

-- 
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/a3b6ccd9-51bd-4cf9-9ab9-2218e2d3bd81%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: SCM plugin not appearing as SCM option in project configuration

2017-11-24 Thread José Lamas Ríos
Hi Stephen, thanks for your help

On Friday, November 24, 2017 at 5:13:45 AM UTC-3, Stephen Connolly wrote:
>
>
>
> Override getDisplayName() and return a name... otherwise it is “invisible” 
> and cannot be selected.
>

Yep, I do have an override returning a string. Here's the entire 
DescriptorImpl class..

@Extension
public static class DescriptorImpl extends 
SCMDescriptor {

@Override
public boolean isApplicable(Job project) {
return true;
}
   
public DescriptorImpl() {
super(GeneXusServerSCM.class, null);
load();
}

@Override
public SCM newInstance(StaplerRequest req, final JSONObject 
formData) throws FormException {
return super.newInstance(req, formData);
}

@Override
public String getDisplayName() {
return "GeneXus Server";
}

@Override
public boolean configure(StaplerRequest req, JSONObject formData) 
throws FormException {
// Save configuration
save();
return super.configure(req, formData);
}

}

I've set breakpoints in the constructor, and the newInstance() and 
getDisplayName() methods, but one of them gets hit.

BTW, the entire project is available here if you want to take a closer look:
https://drive.google.com/open?id=1GNQDH4klYvHfCrmy-NFs6HSjeQqqalfe
 

>
> Are you following the implementation guide in scm-api 
> https://github.com/jenkinsci/scm-api-plugin/blob/master/docs/implementation.adoc
>  because 
> if I missed mentioning that it would be great if you could file a PR to 
> update the docs
>
>
Yes, I'm following that and also these:

https://wiki.jenkins.io/display/JENKINS/Plugin+tutorial#Plugintutorial-PluginImplapproach
https://wiki.jenkins.io/display/JENKINS/Writing+an+SCM+plugin
https://wiki.jenkins.io/display/JENKINS/SCM+plugin+architecture

Anyway, I'll re-read the implementation guide trying to find something I 
may have overlooked.

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/939bb514-1bbf-4dc0-af5b-405882a63a3e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Unit testing with pipeline projects

2017-11-24 Thread Ullrich Hafner
Do you mean an integration test? A unit test never starts a Jenkins instance.

Yes you can use any project type you like when your write an integration test. 
Just scan for some plugins that use a JenkinsRule.

Example: 
https://github.com/jenkinsci/warnings-plugin/blob/master/src/test/java/hudson/plugins/warnings/WarningsWorkflowTest.java
 



> Am 24.11.2017 um 07:33 schrieb Lakshmi Narasimhan 
> :
> 
> Hello.
> 
> Is it possible to write a unit test with a pipeline project instead of a 
> freestyle project?
> 
> More generally, can we install additional plugins to the Jenkins instance 
> launched during the test?
> 
> --
> You received this message because you are subscribed to the Google Groups 
> "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to jenkinsci-dev+unsubscr...@googlegroups.com 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jenkinsci-dev/202cc319-fb39-44f5-92dd-fadb4aba80a8%40googlegroups.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/D135F6BE-607B-4545-9454-B91961C827CC%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: Message signed with OpenPGP


Re: [configuration-as-code] Descriptors configuration

2017-11-24 Thread nicolas de loof
Yes this is a good short terms workaround.  I'm looking if stapler can
easily answer "does this descriptor have a global view" without making
assumption on the view template language, but I think your fix is ok for
now, please push it to main repository

2017-11-24 14:07 GMT+01:00 Ewelina Wilkosz :

> when I changed
>
> URL global = ConfigurationAsCode.class.getClassLoader().getResource(
> cl+"/global.jelly");
> to
>
> URL global = descriptor.getKlass().toJavaClass().getClassLoader()
> .getResource(cl+"/global.jelly");
> it started working for me...
>
> On Friday, November 24, 2017 at 1:54:10 PM UTC+1, nicolas de loof wrote:
>>
>> You're right, that was a distinct (non blocking) issue.
>>
>> this global.jelly lookup was working for me as I had mailer plugin
>> declared as a dependency and ran mvn hpi:run for testing, so this lib is in
>> core classpath
>> will need to investigate a better way to check a Descriptor has a
>> global.jelly view (I'm so pleased to dig into Stapler internals :P)
>>
>>
>>
>> 2017-11-24 13:34 GMT+01:00 Ewelina Wilkosz :
>>
>>> It looks the list is not empty, it's URL global = ConfigurationAsCode.
>>> class.getClassLoader().getResource(cl+"/global.jelly"); that returns
>>> null, is it the same issue you're talking about?
>>>
>>> On Friday, November 24, 2017 at 10:19:19 AM UTC+1, nicolas de loof wrote:

 yes indeed, for a reason I don't understand yet,
 "Jenkins.getInstance().getExtensionList(Descriptor.class)" returns an
 empty list :-\
 investigating ...

 2017-11-24 9:51 GMT+01:00 Ewelina Wilkosz :

> Hi Nicolas, I have a problem with configuring mailer
> - if I use "mailer:" as root element Jenkins won't start - exact copy
> from demo folder
> - if I put mailer under "jenkins:" root element there is no error on
> startup but no configuration is applied
>
> Is there anything special about that one, that should maybe be
> mentioned in the documentation?
>
>
>
> On Thursday, November 23, 2017 at 3:27:19 PM UTC+1, nicolas de loof
> wrote:
>>
>> I wrote this documentation
>> 
>>  for
>> plugin developers to understand the required changes so we can support
>> Descriptor as configuration-as-code targets.
>> I'll work on writing some pull-requests applying this approach to
>> some major plugins.
>>
>> 2017-11-15 16:27 GMT+01:00 nicolas de loof :
>>
>>> this is really work in progress, i.e not even tested on my own
>>> before I propose this in a PR :P
>>> was just for information that I was looking into implementing a fix
>>> for this idea
>>>
>>> 2017-11-15 16:24 GMT+01:00 Jesse Glick :
>>>
 On Wed, Nov 15, 2017 at 9:51 AM, nicolas de loof
  wrote:
 > proposed improvement to Descriptor.configure  (WiP) :
 > https://github.com/ndeloof/jenkins/tree/JENKINS-48018

 If you are soliciting feedback, just file as a PR and mark as
 `work-in-progress`. Easier to gather comments that way.

 --
 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/CANfRfr0%2Bd
 %2BE1RO8PTVeUHnpvH3367zd6D%2Bwa2%2BAeSTgTd9Zc4Q%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-de...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-dev/99138212-72c
> f-47e8-b002-8e00974e1c44%40googlegroups.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-de...@googlegroups.com.
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/jenkinsci-dev/eb597cea-7a8e-43ec-a311-42bc44a80c7b%40goo
>>> glegroups.com
>>> 

Re: [configuration-as-code] Descriptors configuration

2017-11-24 Thread Ewelina Wilkosz
when I changed

URL global = 
ConfigurationAsCode.class.getClassLoader().getResource(cl+"/global.jelly");
to

URL global = 
descriptor.getKlass().toJavaClass().getClassLoader().getResource(cl+"/global.jelly");
it started working for me...

On Friday, November 24, 2017 at 1:54:10 PM UTC+1, nicolas de loof wrote:
>
> You're right, that was a distinct (non blocking) issue.
>
> this global.jelly lookup was working for me as I had mailer plugin 
> declared as a dependency and ran mvn hpi:run for testing, so this lib is in 
> core classpath
> will need to investigate a better way to check a Descriptor has a 
> global.jelly view (I'm so pleased to dig into Stapler internals :P)
>
>
>
> 2017-11-24 13:34 GMT+01:00 Ewelina Wilkosz  >:
>
>> It looks the list is not empty, it's URL global = ConfigurationAsCode.
>> class.getClassLoader().getResource(cl+"/global.jelly"); that returns 
>> null, is it the same issue you're talking about?
>>
>> On Friday, November 24, 2017 at 10:19:19 AM UTC+1, nicolas de loof wrote:
>>>
>>> yes indeed, for a reason I don't understand yet, 
>>> "Jenkins.getInstance().getExtensionList(Descriptor.class)" returns an empty 
>>> list :-\
>>> investigating ...
>>>
>>> 2017-11-24 9:51 GMT+01:00 Ewelina Wilkosz :
>>>
 Hi Nicolas, I have a problem with configuring mailer
 - if I use "mailer:" as root element Jenkins won't start - exact copy 
 from demo folder
 - if I put mailer under "jenkins:" root element there is no error on 
 startup but no configuration is applied

 Is there anything special about that one, that should maybe be 
 mentioned in the documentation?



 On Thursday, November 23, 2017 at 3:27:19 PM UTC+1, nicolas de loof 
 wrote:
>
> I wrote this documentation 
> 
>  for 
> plugin developers to understand the required changes so we can support 
> Descriptor as configuration-as-code targets.
> I'll work on writing some pull-requests applying this approach to some 
> major plugins. 
>
> 2017-11-15 16:27 GMT+01:00 nicolas de loof :
>
>> this is really work in progress, i.e not even tested on my own before 
>> I propose this in a PR :P
>> was just for information that I was looking into implementing a fix 
>> for this idea
>>
>> 2017-11-15 16:24 GMT+01:00 Jesse Glick :
>>
>>> On Wed, Nov 15, 2017 at 9:51 AM, nicolas de loof
>>>  wrote:
>>> > proposed improvement to Descriptor.configure  (WiP) :
>>> > https://github.com/ndeloof/jenkins/tree/JENKINS-48018
>>>
>>> If you are soliciting feedback, just file as a PR and mark as
>>> `work-in-progress`. Easier to gather comments that way.
>>>
>>> --
>>> 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/CANfRfr0%2Bd%2BE1RO8PTVeUHnpvH3367zd6D%2Bwa2%2BAeSTgTd9Zc4Q%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-de...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/jenkinsci-dev/99138212-72cf-47e8-b002-8e00974e1c44%40googlegroups.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-de...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-dev/eb597cea-7a8e-43ec-a311-42bc44a80c7b%40googlegroups.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 

Re: [configuration-as-code] Descriptors configuration

2017-11-24 Thread nicolas de loof
You're right, that was a distinct (non blocking) issue.

this global.jelly lookup was working for me as I had mailer plugin declared
as a dependency and ran mvn hpi:run for testing, so this lib is in core
classpath
will need to investigate a better way to check a Descriptor has a
global.jelly view (I'm so pleased to dig into Stapler internals :P)



2017-11-24 13:34 GMT+01:00 Ewelina Wilkosz :

> It looks the list is not empty, it's URL global = ConfigurationAsCode.
> class.getClassLoader().getResource(cl+"/global.jelly"); that returns
> null, is it the same issue you're talking about?
>
> On Friday, November 24, 2017 at 10:19:19 AM UTC+1, nicolas de loof wrote:
>>
>> yes indeed, for a reason I don't understand yet,
>> "Jenkins.getInstance().getExtensionList(Descriptor.class)" returns an
>> empty list :-\
>> investigating ...
>>
>> 2017-11-24 9:51 GMT+01:00 Ewelina Wilkosz :
>>
>>> Hi Nicolas, I have a problem with configuring mailer
>>> - if I use "mailer:" as root element Jenkins won't start - exact copy
>>> from demo folder
>>> - if I put mailer under "jenkins:" root element there is no error on
>>> startup but no configuration is applied
>>>
>>> Is there anything special about that one, that should maybe be mentioned
>>> in the documentation?
>>>
>>>
>>>
>>> On Thursday, November 23, 2017 at 3:27:19 PM UTC+1, nicolas de loof
>>> wrote:

 I wrote this documentation
 
  for
 plugin developers to understand the required changes so we can support
 Descriptor as configuration-as-code targets.
 I'll work on writing some pull-requests applying this approach to some
 major plugins.

 2017-11-15 16:27 GMT+01:00 nicolas de loof :

> this is really work in progress, i.e not even tested on my own before
> I propose this in a PR :P
> was just for information that I was looking into implementing a fix
> for this idea
>
> 2017-11-15 16:24 GMT+01:00 Jesse Glick :
>
>> On Wed, Nov 15, 2017 at 9:51 AM, nicolas de loof
>>  wrote:
>> > proposed improvement to Descriptor.configure  (WiP) :
>> > https://github.com/ndeloof/jenkins/tree/JENKINS-48018
>>
>> If you are soliciting feedback, just file as a PR and mark as
>> `work-in-progress`. Easier to gather comments that way.
>>
>> --
>> 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/CANfRfr0%2Bd
>> %2BE1RO8PTVeUHnpvH3367zd6D%2Bwa2%2BAeSTgTd9Zc4Q%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-de...@googlegroups.com.
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/jenkinsci-dev/99138212-72cf-47e8-b002-8e00974e1c44%40goo
>>> glegroups.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/eb597cea-7a8e-43ec-a311-42bc44a80c7b%
> 40googlegroups.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/CANMVJznGxsNNam1bmxC7WRUXavabpZt0P6PBXOaNvwS3JKWkLQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [configuration-as-code] Descriptors configuration

2017-11-24 Thread Ewelina Wilkosz
It looks the list is not empty, it's URL global = ConfigurationAsCode.class
.getClassLoader().getResource(cl+"/global.jelly"); that returns null, is it 
the same issue you're talking about?

On Friday, November 24, 2017 at 10:19:19 AM UTC+1, nicolas de loof wrote:
>
> yes indeed, for a reason I don't understand yet, 
> "Jenkins.getInstance().getExtensionList(Descriptor.class)" returns an empty 
> list :-\
> investigating ...
>
> 2017-11-24 9:51 GMT+01:00 Ewelina Wilkosz  >:
>
>> Hi Nicolas, I have a problem with configuring mailer
>> - if I use "mailer:" as root element Jenkins won't start - exact copy 
>> from demo folder
>> - if I put mailer under "jenkins:" root element there is no error on 
>> startup but no configuration is applied
>>
>> Is there anything special about that one, that should maybe be mentioned 
>> in the documentation?
>>
>>
>>
>> On Thursday, November 23, 2017 at 3:27:19 PM UTC+1, nicolas de loof wrote:
>>>
>>> I wrote this documentation 
>>> 
>>>  for 
>>> plugin developers to understand the required changes so we can support 
>>> Descriptor as configuration-as-code targets.
>>> I'll work on writing some pull-requests applying this approach to some 
>>> major plugins. 
>>>
>>> 2017-11-15 16:27 GMT+01:00 nicolas de loof :
>>>
 this is really work in progress, i.e not even tested on my own before I 
 propose this in a PR :P
 was just for information that I was looking into implementing a fix for 
 this idea

 2017-11-15 16:24 GMT+01:00 Jesse Glick :

> On Wed, Nov 15, 2017 at 9:51 AM, nicolas de loof
>  wrote:
> > proposed improvement to Descriptor.configure  (WiP) :
> > https://github.com/ndeloof/jenkins/tree/JENKINS-48018
>
> If you are soliciting feedback, just file as a PR and mark as
> `work-in-progress`. Easier to gather comments that way.
>
> --
> 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/CANfRfr0%2Bd%2BE1RO8PTVeUHnpvH3367zd6D%2Bwa2%2BAeSTgTd9Zc4Q%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-de...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-dev/99138212-72cf-47e8-b002-8e00974e1c44%40googlegroups.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/eb597cea-7a8e-43ec-a311-42bc44a80c7b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [configuration-as-code] Descriptors configuration

2017-11-24 Thread nicolas de loof
yes indeed, for a reason I don't understand yet,
"Jenkins.getInstance().getExtensionList(Descriptor.class)" returns an empty
list :-\
investigating ...

2017-11-24 9:51 GMT+01:00 Ewelina Wilkosz :

> Hi Nicolas, I have a problem with configuring mailer
> - if I use "mailer:" as root element Jenkins won't start - exact copy from
> demo folder
> - if I put mailer under "jenkins:" root element there is no error on
> startup but no configuration is applied
>
> Is there anything special about that one, that should maybe be mentioned
> in the documentation?
>
>
>
> On Thursday, November 23, 2017 at 3:27:19 PM UTC+1, nicolas de loof wrote:
>>
>> I wrote this documentation
>> 
>>  for
>> plugin developers to understand the required changes so we can support
>> Descriptor as configuration-as-code targets.
>> I'll work on writing some pull-requests applying this approach to some
>> major plugins.
>>
>> 2017-11-15 16:27 GMT+01:00 nicolas de loof :
>>
>>> this is really work in progress, i.e not even tested on my own before I
>>> propose this in a PR :P
>>> was just for information that I was looking into implementing a fix for
>>> this idea
>>>
>>> 2017-11-15 16:24 GMT+01:00 Jesse Glick :
>>>
 On Wed, Nov 15, 2017 at 9:51 AM, nicolas de loof
  wrote:
 > proposed improvement to Descriptor.configure  (WiP) :
 > https://github.com/ndeloof/jenkins/tree/JENKINS-48018

 If you are soliciting feedback, just file as a PR and mark as
 `work-in-progress`. Easier to gather comments that way.

 --
 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/ms
 gid/jenkinsci-dev/CANfRfr0%2Bd%2BE1RO8PTVeUHnpvH3367zd6D%2Bw
 a2%2BAeSTgTd9Zc4Q%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/99138212-72cf-47e8-b002-8e00974e1c44%
> 40googlegroups.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/CANMVJzk0dLcx0cskzejC-GNEQJc%2BmGZZbhFiZSKKet3rwQaNzg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [configuration-as-code] Descriptors configuration

2017-11-24 Thread Ewelina Wilkosz
Hi Nicolas, I have a problem with configuring mailer
- if I use "mailer:" as root element Jenkins won't start - exact copy from 
demo folder
- if I put mailer under "jenkins:" root element there is no error on 
startup but no configuration is applied

Is there anything special about that one, that should maybe be mentioned in 
the documentation?



On Thursday, November 23, 2017 at 3:27:19 PM UTC+1, nicolas de loof wrote:
>
> I wrote this documentation 
> 
>  for 
> plugin developers to understand the required changes so we can support 
> Descriptor as configuration-as-code targets.
> I'll work on writing some pull-requests applying this approach to some 
> major plugins. 
>
> 2017-11-15 16:27 GMT+01:00 nicolas de loof  >:
>
>> this is really work in progress, i.e not even tested on my own before I 
>> propose this in a PR :P
>> was just for information that I was looking into implementing a fix for 
>> this idea
>>
>> 2017-11-15 16:24 GMT+01:00 Jesse Glick > >:
>>
>>> On Wed, Nov 15, 2017 at 9:51 AM, nicolas de loof
>>>  wrote:
>>> > proposed improvement to Descriptor.configure  (WiP) :
>>> > https://github.com/ndeloof/jenkins/tree/JENKINS-48018
>>>
>>> If you are soliciting feedback, just file as a PR and mark as
>>> `work-in-progress`. Easier to gather comments that way.
>>>
>>> --
>>> 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/CANfRfr0%2Bd%2BE1RO8PTVeUHnpvH3367zd6D%2Bwa2%2BAeSTgTd9Zc4Q%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/99138212-72cf-47e8-b002-8e00974e1c44%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: SCM plugin not appearing as SCM option in project configuration

2017-11-24 Thread Stephen Connolly
On Fri 24 Nov 2017 at 08:13, Stephen Connolly <
stephen.alan.conno...@gmail.com> wrote:

>
> On Fri 24 Nov 2017 at 00:40, José Lamas Ríos  wrote:
>
>> Hi,
>>
>> Newbie here, newbie on Jenkins and even newbie on Java :)
>>
>> I'm trying to write a new SCM plugin.
>>
>> // com.genexus.gxserver/GeneXusServerSCM.java
>> public class GeneXusServerSCM extends SCM implements Serializable{
>>
>> [...]
>>
>> @Override
>> public DescriptorImpl getDescriptor() {
>> return (DescriptorImpl) super.getDescriptor();
>> }
>>
>> @Extension
>> public static class DescriptorImpl extends
>> SCMDescriptor {
>>
>
> Override getDisplayName() and return a name... otherwise it is “invisible”
> and cannot be selected.
>
> Are you following the implementation guide in scm-api
> https://github.com/jenkinsci/scm-api-plugin/blob/master/docs/implementation.adoc
>  because
> if I missed mentioning that it would be great if you could file a PR to
> update the docs
>

The section applicable to this case is “Implementing hudson.scm.SCM”

>
>
>> @Override
>> public boolean isApplicable(Job project) {
>> return true;
>> }
>>
>> public DescriptorImpl() {
>> super(GeneXusServerSCM.class, null);
>> load();
>> }
>>
>> [...]
>>
>> }
>>
>> I can see my plug-in appear as installed on
>> http://localhost:8080/jenkins/pluginManager/installed but don't see it
>> as an option on the Source Code Management section of a project
>> configuration (ie:
>> http://localhost:8080/jenkins/job/GXserverProjectTest/configure).
>>
>> My project includes a config.jelly
>>
>> // com.genexus.gxserver.GeneXusServerSCM/config.jelly
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>>
>> It only includes a simple 'Label' for now, but as I said above it doesn't
>> even appear as an available SCM option ("None" and "Subversion" do appear).
>>
>> I guess I'm missing some very basic thing, I've been looking at SVN and
>> TFS implementations, but couldn't figure it out.
>>
>> Any hint? How does Jenkins gets the list of available SCMs? Do I have a
>> chance to debug that code?
>>
>> Thanks in advance,
>>
>>
>>
>> --
>> JLR
>>
>> --
>> 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/a156f150-cd96-4d59-b54e-70d17f7b1963%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> Sent from my phone
>
-- 
Sent from my phone

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


Re: SCM plugin not appearing as SCM option in project configuration

2017-11-24 Thread Stephen Connolly
On Fri 24 Nov 2017 at 00:40, José Lamas Ríos  wrote:

> Hi,
>
> Newbie here, newbie on Jenkins and even newbie on Java :)
>
> I'm trying to write a new SCM plugin.
>
> // com.genexus.gxserver/GeneXusServerSCM.java
> public class GeneXusServerSCM extends SCM implements Serializable{
>
> [...]
>
> @Override
> public DescriptorImpl getDescriptor() {
> return (DescriptorImpl) super.getDescriptor();
> }
>
> @Extension
> public static class DescriptorImpl extends
> SCMDescriptor {
>

Override getDisplayName() and return a name... otherwise it is “invisible”
and cannot be selected.

Are you following the implementation guide in scm-api
https://github.com/jenkinsci/scm-api-plugin/blob/master/docs/implementation.adoc
because
if I missed mentioning that it would be great if you could file a PR to
update the docs


> @Override
> public boolean isApplicable(Job project) {
> return true;
> }
>
> public DescriptorImpl() {
> super(GeneXusServerSCM.class, null);
> load();
> }
>
> [...]
>
> }
>
> I can see my plug-in appear as installed on
> http://localhost:8080/jenkins/pluginManager/installed but don't see it as
> an option on the Source Code Management section of a project configuration
> (ie: http://localhost:8080/jenkins/job/GXserverProjectTest/configure).
>
> My project includes a config.jelly
>
> // com.genexus.gxserver.GeneXusServerSCM/config.jelly
> 
> 
> 
> 
> 
> 
> 
> 
> 
>
> It only includes a simple 'Label' for now, but as I said above it doesn't
> even appear as an available SCM option ("None" and "Subversion" do appear).
>
> I guess I'm missing some very basic thing, I've been looking at SVN and
> TFS implementations, but couldn't figure it out.
>
> Any hint? How does Jenkins gets the list of available SCMs? Do I have a
> chance to debug that code?
>
> Thanks in advance,
>
>
>
> --
> JLR
>
> --
> 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/a156f150-cd96-4d59-b54e-70d17f7b1963%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
-- 
Sent from my phone

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