1 |
On Wed, Feb 10, 2016 at 05:11:20AM +0000, Robin H. Johnson wrote: |
2 |
> On Wed, Feb 10, 2016 at 01:24:16AM +0000, Robin H. Johnson wrote: |
3 |
> > I will happily take a pre-receive hook, regardless of it using |
4 |
> > pkgcore/portage. Note that it should operate WITHOUT having a checkout, |
5 |
> > needs to be able to take new ebuilds & Manifest on stdin. |
6 |
> > |
7 |
> > Trying to checkout the tree for each update I don't think is a good |
8 |
> > idea, as it's 5+ seconds of overhead; and somebody else could try to |
9 |
> > push a change in the meantime. |
10 |
> Slight clarification here: |
11 |
> I am willing to keep a stateful checkout as a post-receive hook, and the |
12 |
> pre-receive hook CAN use that checkout to read other contents. It just |
13 |
> might be more than one commit behind sometimes. |
14 |
> |
15 |
> Eg: |
16 |
> T=1 push P1 comes in, triggers pre-receive, passes, triggers post-receive hook (async) |
17 |
> T=1..5 working tree in the process of post-receive, state is dirty [1] |
18 |
> T=2 push P2 comes in, triggers pre-receive. What should happen? |
19 |
> |
20 |
> What should the pre-receive do in this case? |
21 |
> A) fail outright? (terrible choice, included for completeness) |
22 |
> B) block on the active post-receive completing? (while !done; sleep) |
23 |
> C) validate against a changing tree? (might fail, not in a way that's |
24 |
> easy to reproduce) |
25 |
> D) validate against a previous CLEAN tree? (if this push depends on a |
26 |
> change in push P1, it will fail when it should have passed) |
27 |
> |
28 |
> [1] actually a really good question here, does git prepare changes |
29 |
> somewhere in .git and atomically rename into place, even so, multiple |
30 |
> moves cannot be atomic together. |
31 |
> |
32 |
> -- |
33 |
> Robin Hugh Johnson |
34 |
> Gentoo Linux: Developer, Infrastructure Lead, Foundation Trustee |
35 |
> E-Mail : robbat2@g.o |
36 |
> GnuPG FP : 11ACBA4F 4778E3F6 E4EDF38E B27B944E 34884E85 |
37 |
> |
38 |
|
39 |
We do not need the whole manifest checking, we just need to have a list |
40 |
of SRC_URI that is being added in any ebuilds and then grep Manifest if |
41 |
those filenames exist. The receive hook checking the hashes of the files |
42 |
is probably asking too much. This would miss any files added by eclasses |
43 |
but that is rare and changes less often so we should probably be okay. |
44 |
|
45 |
Is there any sane way to spit out condensed SRC_URI for all use-flags? |
46 |
|
47 |
-- Jason |