JobProperty Questions

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
21 messages Options
12
Reply | Threaded
Open this post in threaded view
|

JobProperty Questions

Eric Crahen-3
I have a question on using custom JobProperties, I'm noticing some strange behavior.

My plugin adds a custom JobDescriptor to the Jobs.PROPERTIES list and I've included a very basic config.jelly. in the correct resource path resources/hudson/plugins/MyJobProperty/global.jelly and a similar one for config.jelly. It contains a simple f:entry with some text fields to display some data,

The first thing was that when I create a new Job and enter the Job Configuration page, I thought I would see some of what was in the config.jelly in the UI, but there is no addition. Also, there never was a call to isApplicable() or configure() so it would make sense that nothing gets added to the UI, but I'm not quire sure why this is.

The next odd thing was that if I visit the Manage Hudson -> System Configuration page, I do see the additional fields on the UI for my custom property, but there isn't a call to configure() until after I hit save. And load() was never called, so I'm not sure where I have the chance to load the global settings for a custom property.


// -------

package hudson.plugins;

import hudson.model.AbstractProject;
import hudson.model.Job;
import hudson.model.JobProperty;
import hudson.model.JobPropertyDescriptor;
import hudson.tasks.BuildStep ;
import org.kohsuke.stapler.StaplerRequest;


public class MyJobProperty extends JobProperty<AbstractProject<?,?>> {

  public static final JobPropertyDescriptor DESCRIPTOR = new Descriptor();

  public JobPropertyDescriptor getDescriptor() {
    return DESCRIPTOR;
  }

  private static class Descriptor extends JobPropertyDescriptor {

    Descriptor() {
      super(MyJobProperty.class );
    }

    public boolean isApplicable(java.lang.Class<? extends Job> jobType) {
      System.out.println(jobType);
      return AbstractProject.class.isAssignableFrom(jobType);
    }

    // TODO: support per-project override to the system-wide setting
    public IvyJobProperty newInstance(StaplerRequest req) throws FormException {
      System.err.println("NEW INSTANCE!" + req);
      return new IvyJobProperty();
    }

   public boolean configure(StaplerRequest req) throws FormException {
     System.err.println("CONFIG!" + req);
      return true;
   }

    public String getDisplayName() {
      return MyJobProperty.class.toString();
    }

  }

}

// -----------
// Same for global.jelly & config.jelly

<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">

  <f:entry title="MyProperties" help="${rootURL}/plugin/build-timeout/help-projectConfig.html">
    <f:textbox name="myproperties.instance" value="${instance} default" />
    <f:textbox name="myproperties.it" value="${it} default" />
  </f:entry>

</j:jelly>



--

- Eri
Reply | Threaded
Open this post in threaded view
|

Re: JobProperty Questions

Kohsuke Kawaguchi-2


Eric Crahen wrote:

> I have a question on using custom JobProperties, I'm noticing some strange
> behavior.
>
> My plugin adds a custom JobDescriptor to the Jobs.PROPERTIES list and I've
> included a very basic config.jelly. in the correct resource path
> resources/hudson/plugins/MyJobProperty/global.jelly and a similar one for
> config.jelly. It contains a simple f:entry with some text fields to display
> some data,
>
> The first thing was that when I create a new Job and enter the Job
> Configuration page, I thought I would see some of what was in the
> config.jelly in the UI, but there is no addition. Also, there never was a
> call to isApplicable() or configure() so it would make sense that nothing
> gets added to the UI, but I'm not quire sure why this is.
I just checked the code and apparently this part was broken. I just
committed the change.

> The next odd thing was that if I visit the Manage Hudson -> System
> Configuration page, I do see the additional fields on the UI for my custom
> property, but there isn't a call to configure() until after I hit save. And
> load() was never called, so I'm not sure where I have the chance to load the
> global settings for a custom property.

The config() will be only invoked when the browser submits the form, so
that sounds correct to me.

The derived class is responsible for calling the load() method by
itself, actually. See for example Ant.DescriptorImpl l.114.

This is quite error prone, yes, but I couldn't do that in the base class
constructor. Maybe I should call the load when descriptors are added to
their respective list?


> // -------
>
> package hudson.plugins;
>
> import hudson.model.AbstractProject;
> import hudson.model.Job;
> import hudson.model.JobProperty;
> import hudson.model.JobPropertyDescriptor;
> import hudson.tasks.BuildStep;
> import org.kohsuke.stapler.StaplerRequest;
>
>
> public class MyJobProperty extends JobProperty<AbstractProject<?,?>> {
>
>   public static final JobPropertyDescriptor DESCRIPTOR = new Descriptor();
>
>   public JobPropertyDescriptor getDescriptor() {
>     return DESCRIPTOR;
>   }
>
>   private static class Descriptor extends JobPropertyDescriptor {
>
>     Descriptor() {
>       super(MyJobProperty.class);
>     }
>
>     public boolean isApplicable(java.lang.Class<? extends Job> jobType) {
>       System.out.println(jobType);
>       return AbstractProject.class.isAssignableFrom(jobType);
>     }
>
>     // TODO: support per-project override to the system-wide setting
>     public IvyJobProperty newInstance(StaplerRequest req) throws
> FormException {
>       System.err.println("NEW INSTANCE!" + req);
>       return new IvyJobProperty();
>     }
>
>    public boolean configure(StaplerRequest req) throws FormException {
>      System.err.println("CONFIG!" + req);
>       return true;
>    }
>
>     public String getDisplayName() {
>       return MyJobProperty.class.toString();
>     }
>
>   }
>
> }
>
> // -----------
> // Same for global.jelly & config.jelly
>
> <j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler"
> xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson"
> xmlns:f="/lib/form">
>
>   <f:entry title="MyProperties" help="${rootURL}/plugin/build-timeout/help-
> projectConfig.html">
>     <f:textbox name="myproperties.instance" value="${instance} default" />
>     <f:textbox name="myproperties.it" value="${it} default" />
>   </f:entry>
>
> </j:jelly>
>
>
>

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: JobProperty Questions

Eric Crahen-3
Adding load() might be a good idea since (I think) most options would want to restore their previous settings.

I understand how configure() works now, thanks.

One thing I find a little fuzy still is the global JobProperty. On the System Config page, using the global.jelly that I listed in my previous mail, I noticed ${instance} was null, and ${it} was a reference to the Hudson instance. Is there ever a JobProperty instantiated for the global setting?

On 1/26/07, Kohsuke Kawaguchi <[hidden email]> wrote:


Eric Crahen wrote:

> I have a question on using custom JobProperties, I'm noticing some strange
> behavior.
>
> My plugin adds a custom JobDescriptor to the Jobs.PROPERTIES list and I've
> included a very basic config.jelly. in the correct resource path
> resources/hudson/plugins/MyJobProperty/global.jelly and a similar one for
> config.jelly. It contains a simple f:entry with some text fields to display
> some data,
>
> The first thing was that when I create a new Job and enter the Job
> Configuration page, I thought I would see some of what was in the
> config.jelly in the UI, but there is no addition. Also, there never was a
> call to isApplicable() or configure() so it would make sense that nothing
> gets added to the UI, but I'm not quire sure why this is.

I just checked the code and apparently this part was broken. I just
committed the change.

> The next odd thing was that if I visit the Manage Hudson -> System
> Configuration page, I do see the additional fields on the UI for my custom
> property, but there isn't a call to configure() until after I hit save. And
> load() was never called, so I'm not sure where I have the chance to load the
> global settings for a custom property.

The config() will be only invoked when the browser submits the form, so
that sounds correct to me.

The derived class is responsible for calling the load() method by
itself, actually. See for example Ant.DescriptorImpl l.114.

This is quite error prone, yes, but I couldn't do that in the base class
constructor. Maybe I should call the load when descriptors are added to
their respective list?


> // -------
>
> package hudson.plugins;
>
> import hudson.model.AbstractProject;
> import hudson.model.Job;
> import hudson.model.JobProperty;
> import hudson.model.JobPropertyDescriptor;
> import hudson.tasks.BuildStep;
> import org.kohsuke.stapler.StaplerRequest;
>
>

> public class MyJobProperty extends JobProperty<AbstractProject<?,?>> {
>
>   public static final JobPropertyDescriptor DESCRIPTOR = new Descriptor();
>
>   public JobPropertyDescriptor getDescriptor() {
>     return DESCRIPTOR;
>   }
>
>   private static class Descriptor extends JobPropertyDescriptor {
>
>     Descriptor() {
>       super(MyJobProperty.class);
>     }
>
>     public boolean isApplicable(java.lang.Class<? extends Job> jobType) {
>       System.out.println(jobType);
>       return AbstractProject.class.isAssignableFrom(jobType);
>     }
>
>     // TODO: support per-project override to the system-wide setting
>     public IvyJobProperty newInstance(StaplerRequest req) throws
> FormException {
>       System.err.println("NEW INSTANCE!" + req);
>       return new IvyJobProperty();
>     }
>
>    public boolean configure(StaplerRequest req) throws FormException {
>      System.err.println("CONFIG!" + req);
>       return true;
>    }
>
>     public String getDisplayName() {
>       return MyJobProperty.class.toString();
>     }
>
>   }
>
> }
>
> // -----------
> // Same for global.jelly & config.jelly
>
> <j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler"
> xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson"
> xmlns:f="/lib/form">
>
>   <f:entry title="MyProperties" help="${rootURL}/plugin/build-timeout/help-
> projectConfig.html">
>     <f:textbox name=" myproperties.instance" value="${instance} default" />
>     <f:textbox name="myproperties.it" value="${it} default" />
>   </f:entry>
>
> </j:jelly>
>
>
>


--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]





--

- Eric
Reply | Threaded
Open this post in threaded view
|

Re: JobProperty Questions

Kohsuke Kawaguchi-2
Eric Crahen wrote:

> Adding load() might be a good idea since (I think) most options would want
> to restore their previous settings.
>
> I understand how configure() works now, thanks.
>
> One thing I find a little fuzy still is the global JobProperty. On the
> System Config page, using the global.jelly that I listed in my previous
> mail, I noticed ${instance} was null, and ${it} was a reference to the
> Hudson instance. Is there ever a JobProperty instantiated for the global
> setting?
I think it's available as ${descriptor}. See the trac plugin as an example.

>
> On 1/26/07, Kohsuke Kawaguchi <[hidden email]> wrote:
>>
>>
>>
>> Eric Crahen wrote:
>> > I have a question on using custom JobProperties, I'm noticing some
>> strange
>> > behavior.
>> >
>> > My plugin adds a custom JobDescriptor to the Jobs.PROPERTIES list and
>> I've
>> > included a very basic config.jelly. in the correct resource path
>> > resources/hudson/plugins/MyJobProperty/global.jelly and a similar one
>> for
>> > config.jelly. It contains a simple f:entry with some text fields to
>> display
>> > some data,
>> >
>> > The first thing was that when I create a new Job and enter the Job
>> > Configuration page, I thought I would see some of what was in the
>> > config.jelly in the UI, but there is no addition. Also, there never was
>> a
>> > call to isApplicable() or configure() so it would make sense that
>> nothing
>> > gets added to the UI, but I'm not quire sure why this is.
>>
>> I just checked the code and apparently this part was broken. I just
>> committed the change.
>>
>> > The next odd thing was that if I visit the Manage Hudson -> System
>> > Configuration page, I do see the additional fields on the UI for my
>> custom
>> > property, but there isn't a call to configure() until after I hit save.
>> And
>> > load() was never called, so I'm not sure where I have the chance to load
>> the
>> > global settings for a custom property.
>>
>> The config() will be only invoked when the browser submits the form, so
>> that sounds correct to me.
>>
>> The derived class is responsible for calling the load() method by
>> itself, actually. See for example Ant.DescriptorImpl l.114.
>>
>> This is quite error prone, yes, but I couldn't do that in the base class
>> constructor. Maybe I should call the load when descriptors are added to
>> their respective list?
>>
>>
>> > // -------
>> >
>> > package hudson.plugins;
>> >
>> > import hudson.model.AbstractProject;
>> > import hudson.model.Job;
>> > import hudson.model.JobProperty;
>> > import hudson.model.JobPropertyDescriptor;
>> > import hudson.tasks.BuildStep;
>> > import org.kohsuke.stapler.StaplerRequest;
>> >
>> >
>> > public class MyJobProperty extends JobProperty<AbstractProject<?,?>> {
>> >
>> >   public static final JobPropertyDescriptor DESCRIPTOR = new
>> Descriptor();
>> >
>> >   public JobPropertyDescriptor getDescriptor() {
>> >     return DESCRIPTOR;
>> >   }
>> >
>> >   private static class Descriptor extends JobPropertyDescriptor {
>> >
>> >     Descriptor() {
>> >       super(MyJobProperty.class);
>> >     }
>> >
>> >     public boolean isApplicable(java.lang.Class<? extends Job> jobType)
>> {
>> >       System.out.println(jobType);
>> >       return AbstractProject.class.isAssignableFrom(jobType);
>> >     }
>> >
>> >     // TODO: support per-project override to the system-wide setting
>> >     public IvyJobProperty newInstance(StaplerRequest req) throws
>> > FormException {
>> >       System.err.println("NEW INSTANCE!" + req);
>> >       return new IvyJobProperty();
>> >     }
>> >
>> >    public boolean configure(StaplerRequest req) throws FormException {
>> >      System.err.println("CONFIG!" + req);
>> >       return true;
>> >    }
>> >
>> >     public String getDisplayName() {
>> >       return MyJobProperty.class.toString();
>> >     }
>> >
>> >   }
>> >
>> > }
>> >
>> > // -----------
>> > // Same for global.jelly & config.jelly
>> >
>> > <j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler"
>> > xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson"
>> > xmlns:f="/lib/form">
>> >
>> >   <f:entry title="MyProperties"
>> help="${rootURL}/plugin/build-timeout/help-
>> > projectConfig.html">
>> >     <f:textbox name="myproperties.instance" value="${instance} default"
>> />
>> >     <f:textbox name="myproperties.it" value="${it} default" />
>> >   </f:entry>
>> >
>> > </j:jelly>
>> >
>> >
>> >
>>
>>
>> --
>> Kohsuke Kawaguchi
>> Sun Microsystems                   [hidden email]
>>
>>
>>
>
>

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: JobProperty Questions

Eric Crahen-3
Great. One more question, from an instance of the JobDescriptor associated with a Job, how can I see the instance associated with the system config, in order to merge the settings?

On 1/26/07, Kohsuke Kawaguchi <[hidden email]> wrote:
Eric Crahen wrote:
> Adding load() might be a good idea since (I think) most options would want
> to restore their previous settings.
>
> I understand how configure() works now, thanks.
>
> One thing I find a little fuzy still is the global JobProperty. On the
> System Config page, using the global.jelly that I listed in my previous
> mail, I noticed ${instance} was null, and ${it} was a reference to the
> Hudson instance. Is there ever a JobProperty instantiated for the global
> setting?

I think it's available as ${descriptor}. See the trac plugin as an example.

>
> On 1/26/07, Kohsuke Kawaguchi < [hidden email]> wrote:
>>
>>
>>
>> Eric Crahen wrote:
>> > I have a question on using custom JobProperties, I'm noticing some
>> strange
>> > behavior.
>> >
>> > My plugin adds a custom JobDescriptor to the Jobs.PROPERTIES list and
>> I've
>> > included a very basic config.jelly . in the correct resource path
>> > resources/hudson/plugins/MyJobProperty/global.jelly and a similar one
>> for
>> > config.jelly. It contains a simple f:entry with some text fields to
>> display

>> > some data,
>> >
>> > The first thing was that when I create a new Job and enter the Job
>> > Configuration page, I thought I would see some of what was in the
>> > config.jelly in the UI, but there is no addition. Also, there never was
>> a
>> > call to isApplicable() or configure() so it would make sense that
>> nothing
>> > gets added to the UI, but I'm not quire sure why this is.
>>
>> I just checked the code and apparently this part was broken. I just
>> committed the change.
>>
>> > The next odd thing was that if I visit the Manage Hudson -> System
>> > Configuration page, I do see the additional fields on the UI for my
>> custom
>> > property, but there isn't a call to configure() until after I hit save.
>> And
>> > load() was never called, so I'm not sure where I have the chance to load
>> the
>> > global settings for a custom property.
>>
>> The config() will be only invoked when the browser submits the form, so
>> that sounds correct to me.
>>
>> The derived class is responsible for calling the load() method by

>> itself, actually. See for example Ant.DescriptorImpl l.114.
>>
>> This is quite error prone, yes, but I couldn't do that in the base class
>> constructor. Maybe I should call the load when descriptors are added to
>> their respective list?
>>
>>
>> > // -------
>> >
>> > package hudson.plugins ;
>> >
>> > import hudson.model.AbstractProject;
>> > import hudson.model.Job;
>> > import hudson.model.JobProperty;
>> > import hudson.model.JobPropertyDescriptor ;
>> > import hudson.tasks.BuildStep;
>> > import org.kohsuke.stapler.StaplerRequest;
>> >
>> >
>> > public class MyJobProperty extends JobProperty<AbstractProject<?,?>> {
>> >
>> >   public static final JobPropertyDescriptor DESCRIPTOR = new
>> Descriptor();
>> >
>> >   public JobPropertyDescriptor getDescriptor() {
>> >     return DESCRIPTOR;
>> >   }
>> >
>> >   private static class Descriptor extends JobPropertyDescriptor {
>> >
>> >     Descriptor() {
>> >       super(MyJobProperty.class );
>> >     }
>> >
>> >     public boolean isApplicable(java.lang.Class<? extends Job> jobType)
>> {
>> >       System.out.println(jobType);
>> >       return AbstractProject.class.isAssignableFrom(jobType);
>> >     }
>> >
>> >     // TODO: support per-project override to the system-wide setting
>> >     public IvyJobProperty newInstance(StaplerRequest req) throws
>> > FormException {
>> >       System.err.println("NEW INSTANCE!" + req);
>> >       return new IvyJobProperty();
>> >     }
>> >
>> >    public boolean configure(StaplerRequest req) throws FormException {
>> >      System.err.println("CONFIG!" + req);
>> >       return true;
>> >    }
>> >
>> >     public String getDisplayName() {
>> >       return MyJobProperty.class.toString();
>> >     }
>> >
>> >   }
>> >
>> > }
>> >
>> > // -----------
>> > // Same for global.jelly & config.jelly
>> >
>> > <j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler"
>> > xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson"
>> > xmlns:f="/lib/form">
>> >
>> >   <f:entry title="MyProperties"
>> help="${rootURL}/plugin/build-timeout/help-
>> > projectConfig.html ">
>> >     <f:textbox name="myproperties.instance" value="${instance} default"
>> />
>> >     <f:textbox name="myproperties.it " value="${it} default" />
>> >   </f:entry>
>> >
>> > </j:jelly>
>> >
>> >
>> >
>>
>>
>> --
>> Kohsuke Kawaguchi
>> Sun Microsystems                   [hidden email]
>>
>>
>>
>
>


--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]





--

- Eric
Reply | Threaded
Open this post in threaded view
|

Re: JobProperty Questions

Kohsuke Kawaguchi-2
Eric Crahen wrote:
> Great. One more question, from an instance of the JobDescriptor associated
> with a Job, how can I see the instance associated with the system config, in
> order to merge the settings?

The system config is usually stored in Descriptor instance, which you
can get from a static instance (which is usually available by calling
"getDescriptor()".)

See Ant.java for example. It gets the path to Ant from its Descriptor
instance.


--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: JobProperty Questions

mraible
In reply to this post by Kohsuke Kawaguchi-2

Kohsuke Kawaguchi-2 wrote
Eric Crahen wrote:
> Adding load() might be a good idea since (I think) most options would want
> to restore their previous settings.
>
> I understand how configure() works now, thanks.
>
> One thing I find a little fuzy still is the global JobProperty. On the
> System Config page, using the global.jelly that I listed in my previous
> mail, I noticed ${instance} was null, and ${it} was a reference to the
> Hudson instance. Is there ever a JobProperty instantiated for the global
> setting?

I think it's available as ${descriptor}. See the trac plugin as an example.
I'm interested in a Trac plugin for Hudson - do you know where I can find one?

Thanks,

Matt
Reply | Threaded
Open this post in threaded view
|

Re: JobProperty Questions

Kohsuke Kawaguchi-2
mraible wrote:

>
>
> Kohsuke Kawaguchi-2 wrote:
>>
>> Eric Crahen wrote:
>>> Adding load() might be a good idea since (I think) most options would
>>> want
>>> to restore their previous settings.
>>>
>>> I understand how configure() works now, thanks.
>>>
>>> One thing I find a little fuzy still is the global JobProperty. On the
>>> System Config page, using the global.jelly that I listed in my previous
>>> mail, I noticed ${instance} was null, and ${it} was a reference to the
>>> Hudson instance. Is there ever a JobProperty instantiated for the global
>>> setting?
>>
>> I think it's available as ${descriptor}. See the trac plugin as an
>> example.
>>
>
> I'm interested in a Trac plugin for Hudson - do you know where I can find
> one?
It's under the docs&files section.

I guess https://hudson.dev.java.net/plugins.html needs some fix.


--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: JobProperty Questions

mraible

Kohsuke Kawaguchi-2 wrote
mraible wrote:
>
>
> Kohsuke Kawaguchi-2 wrote:
>>
>> Eric Crahen wrote:
>>> Adding load() might be a good idea since (I think) most options would
>>> want
>>> to restore their previous settings.
>>>
>>> I understand how configure() works now, thanks.
>>>
>>> One thing I find a little fuzy still is the global JobProperty. On the
>>> System Config page, using the global.jelly that I listed in my previous
>>> mail, I noticed ${instance} was null, and ${it} was a reference to the
>>> Hudson instance. Is there ever a JobProperty instantiated for the global
>>> setting?
>>
>> I think it's available as ${descriptor}. See the trac plugin as an
>> example.
>>
>
> I'm interested in a Trac plugin for Hudson - do you know where I can find
> one?

It's under the docs&files section.

I guess https://hudson.dev.java.net/plugins.html needs some fix.
I found this and was able to succesfully install it.  However, AFAICT, it only parses log messages and allows you to click on bug links to the Trac instance.  I'm looking for a tab in Trac that shows the Hudson results - much like the Trac-CC plugin.

https://oss.werkbold.de/trac-cc

AFAIK, this plugin would need to be written in Python and would somehow interface with Hudson to pull its results.

Matt
Reply | Threaded
Open this post in threaded view
|

Re: JobProperty Questions

Kohsuke Kawaguchi-2
mraible wrote:
> I found this and was able to succesfully install it.  However, AFAICT, it
> only parses log messages and allows you to click on bug links to the Trac
> instance.  I'm looking for a tab in Trac that shows the Hudson results -
> much like the Trac-CC plugin.
>
> https://oss.werkbold.de/trac-cc
>
> AFAIK, this plugin would need to be written in Python and would somehow
> interface with Hudson to pull its results.

OK, so you want a trac plugin, not a hudson plugin.

I can help about how to pull data from hudson, but I think this needs a
volunteer to work on trac side.

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Trac plugin

Tomasz Sterna-2
In reply to this post by Kohsuke Kawaguchi-2
Dnia 28-02-2007, śro o godzinie 17:11 -0800, Kohsuke Kawaguchi
napisał(a):
> > I'm interested in a Trac plugin for Hudson - do you know where I can
> find
> > one?
> It's under the docs&files section.
> I guess https://hudson.dev.java.net/plugins.html needs some fix.

It would be more useful to configure Trac URL per project basis I think,
not per Hudson installation.

--
Tomasz Sterna
eo Networks

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Trac plugin

Kohsuke Kawaguchi-2
Tomasz Sterna wrote:
> Dnia 28-02-2007, śro o godzinie 17:11 -0800, Kohsuke Kawaguchi
>> > I'm interested in a Trac plugin for Hudson - do you know where I can
>> find
>> > one?
>> It's under the docs&files section.
>> I guess https://hudson.dev.java.net/plugins.html needs some fix.
>
> It would be more useful to configure Trac URL per project basis I think,
> not per Hudson installation.

OK. Is it common? That is, you must have multiple trac installations.

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Trac plugin

Sven Reimers
Yes, it is common.

-Sven

On 3/7/07, Kohsuke Kawaguchi <[hidden email]> wrote:

> Tomasz Sterna wrote:
> > Dnia 28-02-2007, śro o godzinie 17:11 -0800, Kohsuke Kawaguchi
> >> > I'm interested in a Trac plugin for Hudson - do you know where I can
> >> find
> >> > one?
> >> It's under the docs&files section.
> >> I guess https://hudson.dev.java.net/plugins.html needs some fix.
> >
> > It would be more useful to configure Trac URL per project basis I think,
> > not per Hudson installation.
>
> OK. Is it common? That is, you must have multiple trac installations.
>
> --
> Kohsuke Kawaguchi
> Sun Microsystems                   [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Trac plugin

Tomasz Sterna-2
In reply to this post by Kohsuke Kawaguchi-2
Dnia 06-03-2007, wto o godzinie 18:11 -0800, Kohsuke Kawaguchi
napisał(a):
> > It would be more useful to configure Trac URL per project basis I
> think,
> > not per Hudson installation.
> OK. Is it common? That is, you must have multiple trac installations.

Under apache with:
    <Location /projects/>
        PythonOption TracEnvParentDir /home/projects

we're creating new Trac project for every project we start in a snap.
These are being built under Hudson then.

Maybe the global setting could work as a fallback when there is no
project path set?
This way it could keep both user groups happy. :-)
Ones would set global Trac path and the others would set it per project.


--
Tomasz Sterna
eo Networks

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Trac plugin

Kohsuke Kawaguchi-2
Tomasz Sterna wrote:

> Dnia 06-03-2007, wto o godzinie 18:11 -0800, Kohsuke Kawaguchi
> napisa�?(a):
>> > It would be more useful to configure Trac URL per project basis I
>> think,
>> > not per Hudson installation.
>> OK. Is it common? That is, you must have multiple trac installations.
>
> Under apache with:
>     <Location /projects/>
>         PythonOption TracEnvParentDir /home/projects
>
> we're creating new Trac project for every project we start in a snap.
> These are being built under Hudson then.
>
> Maybe the global setting could work as a fallback when there is no
> project path set?
> This way it could keep both user groups happy. :-)
> Ones would set global Trac path and the others would set it per project.
I implemented Trac plugin more or less as a show case, so the current
behavior isn't really backed by any actual user experience.

Sounds like the actual users are saying that it should really be
per-project, so I think I'm just going to modify it as such.

It would be really nice if actual Trac user could own this plugin. I'm
happy to help about any hudson specific things, but ultimately I think
it would make a better plugin when people who uses trac drives it.

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Trac plugin

Kohsuke Kawaguchi-2

I just fixed this in the repository. Will be releasing this new version
when I release 1.86, which is hopefully Monday.

As usual, any feedback appreciated.

Kohsuke Kawaguchi wrote:

> Tomasz Sterna wrote:
>> Dnia 06-03-2007, wto o godzinie 18:11 -0800, Kohsuke Kawaguchi
>> napisa?��?(a):
>>> > It would be more useful to configure Trac URL per project basis I
>>> think,
>>> > not per Hudson installation.
>>> OK. Is it common? That is, you must have multiple trac installations.
>>
>> Under apache with:
>>     <Location /projects/>
>>         PythonOption TracEnvParentDir /home/projects
>>
>> we're creating new Trac project for every project we start in a snap.
>> These are being built under Hudson then.
>>
>> Maybe the global setting could work as a fallback when there is no
>> project path set?
>> This way it could keep both user groups happy. :-)
>> Ones would set global Trac path and the others would set it per project.
>
> I implemented Trac plugin more or less as a show case, so the current
> behavior isn't really backed by any actual user experience.
>
> Sounds like the actual users are saying that it should really be
> per-project, so I think I'm just going to modify it as such.
>
> It would be really nice if actual Trac user could own this plugin. I'm
> happy to help about any hudson specific things, but ultimately I think
> it would make a better plugin when people who uses trac drives it.
>

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Trac plugin

Tomasz Sterna-2
Dnia 10-03-2007, sob o godzinie 17:22 -0800, Kohsuke Kawaguchi
napisał(a):
> I just fixed this in the repository. Will be releasing this new
> version
> when I release 1.86, which is hopefully Monday.
>
> As usual, any feedback appreciated.

Works grat. Thanks. :-)

But only with free-style projects. I don't see the option under maven2
projects. :-(


--
Tomasz Sterna
eo Networks

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Trac plugin

Tomasz Sterna-2
Dnia 13-03-2007, wto o godzinie 10:10 +0100, Tomasz Sterna napisał(a):

> But only with free-style projects. I don't see the option under maven2
> projects. :-(

Oh, there's more.

When I try to edit maven2 project options, Hudson throws exception:
java.lang.NullPointerException
        hudson.plugins.trac.TracProjectProperty.<init>(TracProjectProperty.java:29)
        sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
[...]

The plugin backend is expecting the value of a field that isn't in the
frontend form, right?

--
Tomasz Sterna                      E-Mail: [hidden email]
eo Networks Sp. z o.o.           JabberID: [hidden email]
ul. Jana Olbrachta 94, Warszawa   SkypeID: tomasz.sterna

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Trac plugin

Kohsuke Kawaguchi-2
Tomasz Sterna wrote:

> Dnia 13-03-2007, wto o godzinie 10:10 +0100, Tomasz Sterna napisa�?(a):
>
>> But only with free-style projects. I don't see the option under maven2
>> projects. :-(
>
> Oh, there's more.
>
> When I try to edit maven2 project options, Hudson throws exception:
> java.lang.NullPointerException
> hudson.plugins.trac.TracProjectProperty.<init>(TracProjectProperty.java:29)
> sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
> [...]
>
> The plugin backend is expecting the value of a field that isn't in the
> frontend form, right?
This NPE is fixed. It was a silly bug.


--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Trac plugin

Kohsuke Kawaguchi-2
In reply to this post by Tomasz Sterna-2
Tomasz Sterna wrote:

> Dnia 10-03-2007, sob o godzinie 17:22 -0800, Kohsuke Kawaguchi
> napisa�?(a):
>> I just fixed this in the repository. Will be releasing this new
>> version
>> when I release 1.86, which is hopefully Monday.
>>
>> As usual, any feedback appreciated.
>
> Works grat. Thanks. :-)
>
> But only with free-style projects. I don't see the option under maven2
> projects. :-(
Could you file an issue for this so that we can keep track of this?


--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment
12