launchpad-dev team mailing list archive
-
launchpad-dev team
-
Mailing list archive
-
Message #04300
Re: Binary upload processing
Hi Julian,
This was a discussion we had off-list but since I'm going to start
working on it, I thought it'd be a good idea to see if you're happy with
the proposed solution.
On Fri, 2010-07-30 at 16:48 -0300, Guilherme Salgado wrote:
> Hi James,
>
> On Fri, 2010-07-30 at 13:56 -0400, James Westby wrote:
> > Hi,
> >
> > I dug in to how upload policies work and it looks to be fairly
> > straightforward for our needs.
> >
> > Firstly we would define our policy in
> > lib/lp/archiveuploader/uploadpolicy.py, setting some options for
> > standard processing, and with a method that we can use to reject on any
> > condition we like.
> >
>
> > We register this policy with a specific name, e.g. 'vostok', and this is
> > how the policy is selected. We would set the configs/cronscripts for
> > vostok instances to run the upload processor with -C vostok, and that
> > would mean the policy would be used.
> >
>
> Ideally we'd use zope named utilities instead of the policy registry
> implemented by AbstractUploadPolicy. That'd allow us to define our
> custom policy under lp/vostok instead of lp/archiveuploader, but that's
> not required, of course.
This is not as straight-forward as I expected because zope utilities are
implemented as singletons but the main callsite of AbstractUploadPolicy
changes the policy instances based on the arguments given in the command
line. I'll check with Gary if there's any other way we could achieve
the same thing that utilities would buy us.
>
> > So far so good.
> >
> > The only wrinkle I see is that we want to only accept "mixed" uploads,
> > not source-only or binary-only (though we may want this to be
> > configurable).
> >
> > Each policy sets can_upload_source, can_upload_binaries and
> > can_upload_mixed, but you have to set the first two to True to have the
> > last checked, meaning that all three would be acceptable.
> >
>
> Maybe we could get rid of these 3 settings and create a separate one
> (e.g. upload_types) using an Enum that describes the types of uploads a
> given policy accepts? That may not work well if we have more than a
> handful combinations of upload types accepted by all the policies,
> though.
This is the specific bit where I'd like your opinion, Julian.
>
> > Either we do some refactoring there, or we use the
> > policySpecificChecks() method on our policy to reject source-only or
> > binary-only uploads later.
--
Guilherme Salgado <https://launchpad.net/~salgado>
Attachment:
signature.asc
Description: This is a digitally signed message part
Follow ups