Hudson.getUrl() returns ""

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

Hudson.getUrl() returns ""

Renaud Bruyeron-2

I am writing a plugin that needs the Hudson URL - it seems that the
Mailer object has that info, and
that Hudson.getUrl() is hardcoded to return "".
I think this is not ideal: this information is global to the instance,
and should move up to the Hudson object.

Should I raise an issue about this?

 - Renaud

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

Reply | Threaded
Open this post in threaded view
|

Re: Hudson.getUrl() returns ""

Kohsuke Kawaguchi-2
Renaud Bruyeron wrote:
> I am writing a plugin that needs the Hudson URL - it seems that the
> Mailer object has that info, and
> that Hudson.getUrl() is hardcoded to return "".
> I think this is not ideal: this information is global to the instance,
> and should move up to the Hudson object.

You are right that this information shuold be owned by Hudson, not by
Mailer, as it's generally useful.

I probably won't be able to modify "getUrl", as it's used throughout the
views, and in there it's usually desirable to use the host name the
client used, instead of the host name that the server is configured with.

Can you file an issue to the issue tracker?

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

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

Re: Hudson.getUrl() returns ""

Kohsuke Kawaguchi-2
In reply to this post by Renaud Bruyeron-2
Renaud Bruyeron wrote:
> I am writing a plugin that needs the Hudson URL - it seems that the
> Mailer object has that info, and
> that Hudson.getUrl() is hardcoded to return "".
> I think this is not ideal: this information is global to the instance,
> and should move up to the Hudson object.

BTW, is this for a JMX plugin?

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

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

Re: Hudson.getUrl() returns ""

Renaud Bruyeron-2
Kohsuke Kawaguchi wrote:
> Renaud Bruyeron wrote:
>> I am writing a plugin that needs the Hudson URL - it seems that the
>> Mailer object has that info, and
>> that Hudson.getUrl() is hardcoded to return "".
>> I think this is not ideal: this information is global to the
>> instance, and should move up to the Hudson object.
>
> BTW, is this for a JMX plugin?
>
Nope, this is for an IRC plugin ;-)
I am almost done with the basics, i.e. notify a list of channels that a
project changed status. I also want to add some simple commands to be
able to browse the job list, and maybe schedule jobs from the channel. I
wanted to include a link to the job in the message, but I need the full
URL to do this, hence my question.

 - Renaud

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

Reply | Threaded
Open this post in threaded view
|

Re: Hudson.getUrl() returns ""

Kohsuke Kawaguchi-2
Renaud Bruyeron wrote:
> Nope, this is for an IRC plugin ;-)
> I am almost done with the basics, i.e. notify a list of channels that a
> project changed status. I also want to add some simple commands to be
> able to browse the job list, and maybe schedule jobs from the channel. I
> wanted to include a link to the job in the message, but I need the full
> URL to do this, hence my question.

Cool!

Would you be able to host this plugin on java.net?


--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

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

Re: Hudson.getUrl() returns ""

Vladimir Sizikov
In reply to this post by Kohsuke Kawaguchi-2
Hi,

On Wed, Dec 06, 2006 at 10:37:56PM -0800, Kohsuke Kawaguchi wrote:
> Renaud Bruyeron wrote:
> >I am writing a plugin that needs the Hudson URL - it seems that the
> >Mailer object has that info, and
> >that Hudson.getUrl() is hardcoded to return "".
> >I think this is not ideal: this information is global to the instance,
> >and should move up to the Hudson object.
>
> You are right that this information shuold be owned by Hudson, not by
> Mailer, as it's generally useful.

Yes, two more places where I needed that URL:

- In RSS support (to provide the link to ATOM feed from inside ATOM
  feed, as recommended by ATOM spec)

- In "trigger builds remotely" feautre, in the help, showing the URL
  the users should use to trigger builds  remotely in secure manner.
  Currently I say:
  Use the following URL to trigger build remotely:
  HUDSON_URL/job/qa-ant-tasks/build?token=TOKEN_NAME

  But it would be much better to provide proper URL.

Thanks,
  --Vladimir

> I probably won't be able to modify "getUrl", as it's used throughout the
> views, and in there it's usually desirable to use the host name the
> client used, instead of the host name that the server is configured with.
>
> Can you file an issue to the issue tracker?
>
> --
> Kohsuke Kawaguchi
> Sun Microsystems                   [hidden email]


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

Reply | Threaded
Open this post in threaded view
|

Re: Hudson.getUrl() returns ""

Kohsuke Kawaguchi-2

Done. I added Hudson.getRootUrl().

Vladimir Sizikov wrote:

> Hi,
>
> On Wed, Dec 06, 2006 at 10:37:56PM -0800, Kohsuke Kawaguchi wrote:
>> Renaud Bruyeron wrote:
>> >I am writing a plugin that needs the Hudson URL - it seems that the
>> >Mailer object has that info, and
>> >that Hudson.getUrl() is hardcoded to return "".
>> >I think this is not ideal: this information is global to the instance,
>> >and should move up to the Hudson object.
>>
>> You are right that this information shuold be owned by Hudson, not by
>> Mailer, as it's generally useful.
>
> Yes, two more places where I needed that URL:
>
> - In RSS support (to provide the link to ATOM feed from inside ATOM
>   feed, as recommended by ATOM spec)
>
> - In "trigger builds remotely" feautre, in the help, showing the URL
>   the users should use to trigger builds  remotely in secure manner.
>   Currently I say:
>   Use the following URL to trigger build remotely:
>   HUDSON_URL/job/qa-ant-tasks/build?token=TOKEN_NAME
>
>   But it would be much better to provide proper URL.
>
> Thanks,
>   --Vladimir
>
>> I probably won't be able to modify "getUrl", as it's used throughout the
>> views, and in there it's usually desirable to use the host name the
>> client used, instead of the host name that the server is configured with.
>>
>> Can you file an issue to the issue tracker?
>>
>> --
>> Kohsuke Kawaguchi
>> Sun Microsystems                   [hidden email]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment