[Spacewalk-devel] Addition to channel.software API

James Hogarth james.hogarth at gmail.com
Tue Apr 20 10:59:08 EDT 2010


On 20 April 2010 15:47, Tomas Lestach <tlestach at redhat.com> wrote:
>
>
>
>
> --
> Tomas Lestach
> RHN Satellite Engineering, Red Hat
>
> ----- "James Hogarth" <james.hogarth at gmail.com> wrote:
>
>> Hi all,
>>
>> This is my first time trying to follow through the code and
>> contribute
>> to the codebase.
>>
>> >From my perspective the ability via the XML-RPC API to get the last
>> repo modified date (and possibly whether a build would be in
>> progress)
>> would be extremely useful to us.
>
> Hello James,
>
> I think this is wonderful idea! It might be helpful for more people.
>
>>
>> The idea being that after an RPM is built via a build system and
>> pushed via rhnpush there is not (as far as I know) a way via the API
>> to check when the repodata actually gets updated.
>>
>> As a result I have had a couple of times when a deploy of the new RPM
>> for our application is meant to be carried out but the repodata
>> hasn't
>> quite been built yet resulting in wasted time and another RPM
>> deployment later.
>>
>> I'm thinking adding this to
>> java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java
>> within the ChannelSoftwareHandler class *could* provide at least part
>> of that info...
>>
>>  /**
>>     * Returns the last build date on the repodata for a channel
>>     * @param sessionKey WebSession containing User information.
>>     * @param id - id of channel wanted
>>     * @throws NoSuchChannelException thrown if no channel is found.
>>     * @return the build date on the repodata of the channel requested
>>     */
>>
>>    public String getChannelLastBuildById(String sessionKey, Integer
>> id)
>>         throws NoSuchChannelException {
>>          User user = getLoggedInUser(sessionKey);
>>          return
>> ChannelManager.getRepoLastBuild(lookupChannelById(user,id));
>>    }
>>
>>
>
> I've already applied your patch with one single change ...
> (because getRepoLastBuild() may return null -> no repo will be generated for empty channels)
>
> http://git.fedorahosted.org/git/?p=spacewalk.git;a=commitdiff;h=6519f98fe579244ead774895b50f46c5a0d1f334
>
> Thank you!
>
>> I'm a sysadmin by trade and only dabble in code at this point....
>>
>> Does it at least look like I'm on the right track for a proper patch
>> to be submitted?
>
> Yes, the patch looks very good.
> Usually patches are sent as output of `git format-patch`. Otherwise no objections. :-)
>
>
> Best Regards,
> Tomas
>
>> Incidentally whilst I'm looking at this code anyway.... I've noticed
>> that ChannelDetail shows a 12 hour date for last repo build and last
>> modified a 24 hour date.... any ideas?
>>
>> James
>>
>> _______________________________________________
>> Spacewalk-devel mailing list
>> Spacewalk-devel at redhat.com
>> https://www.redhat.com/mailman/listinfo/spacewalk-devel
>
> _______________________________________________
> Spacewalk-devel mailing list
> Spacewalk-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/spacewalk-devel
>

I'm more used to subversion than git... having troubles with getting
any output from git format-patch on ubuntu lucid ...

Attached is a `git diff` output with your revision and the changes to
documentation too...

There is a test included but I'm not sure how useful it would be...

Wahoo! My first code inclusion! ;)

Thanks for the feedback Tomas... hopefully over time I'll be able to
contribute more as Spacewalk gets put to further use here....

Kind regards,

James
-------------- next part --------------
A non-text attachment was scrubbed...
Name: spacewalk-getChannelLastBuildById.diff
Type: text/x-patch
Size: 7101 bytes
Desc: not available
URL: <https://www.redhat.com/archives/spacewalk-devel/attachments/20100420/34c01879/attachment.bin>


More information about the Spacewalk-devel mailing list