[opensuse-buildservice] extending the /source/project backend call
Hi, what about extending the /source/project backend call with an additional "withsrcmd5" query parameter? Instead of the plain package list it will return also the latest srcmd5 for each package. This call can be used by osc to check which packages in a local project have to be updated. It would probably speed up the update process for large projects because osc only needs to do one http request (instead one for each package) in order to decide if a package has to be updated or not. A drawback is that this call might be a bit "expensive" because for each package the getfilelist() function has to be called (a simple getrev() for each package won't work with links or branches). Any opinions? Marcus -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Tue, Aug 02, 2011 at 08:41:31PM +0200, Marcus Hüwe wrote:
what about extending the /source/project backend call with an additional "withsrcmd5" query parameter? Instead of the plain package list it will return also the latest srcmd5 for each package. This call can be used by osc to check which packages in a local project have to be updated. It would probably speed up the update process for large projects because osc only needs to do one http request (instead one for each package) in order to decide if a package has to be updated or not.
Something like this already exists: you get a "sourceinfolist" if you do a view=info request on a project. The API currently blocks this, though, as there's code missing that filters out packages where the requester has no access rights.
A drawback is that this call might be a bit "expensive" because for each package the getfilelist() function has to be called (a simple getrev() for each package won't work with links or branches).
That actually depends a bit on your osc settings: Depending on whether you want expanded/unexpanded/baserev expanded checkouts, you need a different srcmd5. view=info currently returns the expanded version (i.e. the version used for building the package). Cheers, Michael. -- Michael Schroeder mls@suse.de SUSE LINUX Products GmbH, GF Jeff Hawn, HRB 16746 AG Nuernberg main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);} -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On 2011-08-03 09:15:20 +0200, Michael Schroeder wrote:
On Tue, Aug 02, 2011 at 08:41:31PM +0200, Marcus Hüwe wrote:
what about extending the /source/project backend call with an additional "withsrcmd5" query parameter? Instead of the plain package list it will return also the latest srcmd5 for each package. This call can be used by osc to check which packages in a local project have to be updated. It would probably speed up the update process for large projects because osc only needs to do one http request (instead one for each package) in order to decide if a package has to be updated or not.
Something like this already exists: you get a "sourceinfolist" if you do a view=info request on a project. The API currently blocks this, though, as there's code missing that filters out packages where the requester has no access rights.
That's what I was looking for:) In the meantime the API also supports the "view" parameter (see 3d15d72230a43454c621a7c8ce8ffe94d4bfe507).
A drawback is that this call might be a bit "expensive" because for each package the getfilelist() function has to be called (a simple getrev() for each package won't work with links or branches).
That actually depends a bit on your osc settings: Depending on whether you want expanded/unexpanded/baserev expanded checkouts, you need a different srcmd5. view=info currently returns the expanded version (i.e. the version used for building the package).
I just extended "sub sourceinfo" so that it stores the srcmd5 and the xsrcmd5 (if present). It seems the sourceinfo stuff isn't used at the moment (at least I didn't find anything in backend/api code) so the change shouldn't break anything. Is the attached patch ok? Marcus Btw. what's the difference between the "latest" and "build" revision (both lead to the same revision when using getrev())?
On 2011-08-23 15:44:04 +0200, Marcus Hüwe wrote:
On 2011-08-03 09:15:20 +0200, Michael Schroeder wrote:
On Tue, Aug 02, 2011 at 08:41:31PM +0200, Marcus Hüwe wrote:
what about extending the /source/project backend call with an additional "withsrcmd5" query parameter? Instead of the plain package list it will return also the latest srcmd5 for each package. This call can be used by osc to check which packages in a local project have to be updated. It would probably speed up the update process for large projects because osc only needs to do one http request (instead one for each package) in order to decide if a package has to be updated or not.
Something like this already exists: you get a "sourceinfolist" if you do a view=info request on a project. The API currently blocks this, though, as there's code missing that filters out packages where the requester has no access rights.
That's what I was looking for:) In the meantime the API also supports the "view" parameter (see 3d15d72230a43454c621a7c8ce8ffe94d4bfe507).
A drawback is that this call might be a bit "expensive" because for each package the getfilelist() function has to be called (a simple getrev() for each package won't work with links or branches).
That actually depends a bit on your osc settings: Depending on whether you want expanded/unexpanded/baserev expanded checkouts, you need a different srcmd5. view=info currently returns the expanded version (i.e. the version used for building the package).
I just extended "sub sourceinfo" so that it stores the srcmd5 and the xsrcmd5 (if present). It seems the sourceinfo stuff isn't used at the moment (at least I didn't find anything in backend/api code) so the change shouldn't break anything.
Is the attached patch ok?
Just a small ping - any objections?:) Marcus -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Thu, Sep 01, 2011 at 03:37:40PM +0200, Marcus Hüwe wrote:
I just extended "sub sourceinfo" so that it stores the srcmd5 and the xsrcmd5 (if present). It seems the sourceinfo stuff isn't used at the moment (at least I didn't find anything in backend/api code) so the change shouldn't break anything.
Is the attached patch ok?
Just a small ping - any objections?:)
Ah, actually the sourceinfo stuff is used by the licence checker. So you should not change the meaning of srcmd5 and xsrcmd5. And srcmd5 should aways reflect the source that was used for the parsing, so you need to do it in some other way. (Currently, asking for sourceinfo always gives you the "expand=1" view, so you may want to add a "lsrcmd5".) M. -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On 2011-09-01 16:18:44 +0200, Michael Schroeder wrote:
On Thu, Sep 01, 2011 at 03:37:40PM +0200, Marcus Hüwe wrote:
I just extended "sub sourceinfo" so that it stores the srcmd5 and the xsrcmd5 (if present). It seems the sourceinfo stuff isn't used at the moment (at least I didn't find anything in backend/api code) so the change shouldn't break anything.
Is the attached patch ok?
Just a small ping - any objections?:)
Ah, actually the sourceinfo stuff is used by the licence checker. So you should not change the meaning of srcmd5 and xsrcmd5.
Ok.
And srcmd5 should aways reflect the source that was used for the parsing, so you need to do it in some other way.
Ok.
(Currently, asking for sourceinfo always gives you the "expand=1" view, so you may want to add a "lsrcmd5".)
I just adapted the patch so that the local (aka "unexpanded") rev is stored in the lsrcmd5 attribute (if the package is a link). Thanks for your feedback! Is the attached patch ok? Marcus
On Thu, Sep 01, 2011 at 05:40:55PM +0200, Marcus Hüwe wrote:
I just adapted the patch so that the local (aka "unexpanded") rev is stored in the lsrcmd5 attribute (if the package is a link). Thanks for your feedback!
Is the attached patch ok?
Yes, looks good to me. M. -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
participants (2)
-
Marcus Hüwe
-
Michael Schroeder