Gentoo Archives: gentoo-dev

From: Alec Warner <antarus@g.o>
To: Gentoo Dev <gentoo-dev@l.g.o>
Subject: Re: [gentoo-dev] Value of Continuous integration vs Code Review / Pull Requests
Date: Wed, 27 May 2020 15:35:40
Message-Id: CAAr7Pr9qDtEajFxEUBvd4862giR1z0K-XmFChy0xsDeg0wwZKA@mail.gmail.com
In Reply to: RE: [gentoo-dev] Value of Continuous integration vs Code Review / Pull Requests by Thomas Deutschmann
1 On Wed, May 27, 2020 at 5:16 AM Thomas Deutschmann <whissi@g.o>
2 wrote:
3
4 > Hi,
5 >
6 > is this really CI _vs_ Code Review? I.e. we can only have one?
7 >
8
9 I'll try to come back to this. We can make computers do anything, but it's
10 a question of limited time for me and for Gentoo as a whole.
11
12
13 >
14 > CI is nice and helpful. For example I usually don't start review until CI
15 > sets green light but CI alone wouldn't be enough. Thought that Gitlab will
16 > support same kind of hooks similar to how current CI is integrated into
17 > Github, not?
18 >
19
20 So I'm basically back to worrying about social contract here. If its a
21 common Gentoo workflow to:
22 - Have a user fork a repo (github)
23 - Submit a PR (github)
24 - Gentoo CI sees the PR against ::gentoo and runs CI (github)
25 - CI turns green and comments on the PR (github)
26 - Human Gentoo dev reviews PR (github) [some iterations of review and
27 changes with PR author]
28 - Human Gentoo dev downloads PR patch and applies to Gentoo (Gentoo
29 Hosted.)
30
31 Does this workflow meet the social contract? I would assert it does not.
32 Now of course Gentoo doesn't "solely rely" on this workflow and other
33 workflows are available; but if this is a de-facto workflow people are
34 using...does not that concern the community? It concerns me! Hey we
35 originally were like 'nah github is OK' and now I'm coming around and
36 saying 'hey maybe this isn't OK in its current form.' So one idea might be
37 "what can we do about this particular problem."
38
39 What others have done is typically left mirrors of their projects on
40 github, written bots to auto-close PRs to those repos, and funneled users
41 somewhere else. We could do that if we wanted.
42
43
44 >
45 > Also, when I could wish something: The problem when doing review on Github
46 > for me is, that we usually create new revisions. Therefore we don't see
47 > what's changed in new revision versus previous revision. So the change to
48 > review looks like an entire new file was added (which is what basically
49 > happened). It would be cool if our solution would be aware of this and
50 > could handle this somehow. But I guess we would have to create our own
51 > solution for this...
52 >
53
54 So to address your first point above, there are a bunch of (sometimes
55 conflicting) requirements.
56
57 [Github]
58 A past argument for Github was "we need to be on github because this is
59 where the users are." I can tell you the users have not left Github and so
60 without us funneling them somewhere else...I mean if we are going to
61 continue to accept PRs on github we should probably service them (vs
62 auto-closing.)
63
64 [Code Review]
65 Basically how do we build a system where a user can go find our code, fork
66 it, generate a patch, send us the patch, and then be able to run CI on it
67 and do a review online (as opposed to on bugzilla / in-email.) Currently
68 this happens on github and I think there is some support for moving those
69 users to some other solution.
70
71 We could:
72 - Build something on gitlab CE.
73 - Build something on gitea + a CI solution (drone, zuul, etc.)
74 - I don't think gerrit credibly meets these requirements because users
75 can't fork in gerrit and it requires annoying client side tooling.
76 - The main problem I think with gitlab-CE is no one wants to operate it;
77 its too complex of a software package and there is a major fear that once
78 we mgirate everyone on it, something will go wrong and then we will be in
79 trouble. I don't have this fear with gitea because there are fewer moving
80 parts.
81 - The main problem with gitea is that it's relatively unproven and we
82 already know it needs patches for ::gentoo.
83
84 [CI-for-ebuilds]
85 My understanding is that there are two existing CI workflows (I'm ignoring
86 the new thing nattka; it's what I'd consider a different workflow.)
87 (1) Github PRs: A bot watches for PRs against ::gentoo on Github and runs
88 CI on them.
89 (2) Post-Submit CI: Every so often we run Ci against ::gentoo and if
90 something looks super bad we bisect and email that the build is broken.
91
92 So right off the bat there are some gaps.
93 - There is no pre-submit CI on git.gentoo.org at all, so devs can't vet
94 their changes there. Would anyone like this?
95 - There is no flexibility; the CI you get is whatever is configured (e.g.
96 what mgorny set up). This isn't meant as a dig; maybe no one wants to set
97 up CI at all and just wants to use this stuff; I have no idea.
98
99 [Other Projects]
100 Portage has had CI for ages; but it runs on github and uses travis-CI
101 soko.git uses hosted gitlab-ci to build, run tests, and upload containers.
102 https://gitweb.gentoo.org/proj/catalyst.git/ has no CI, but might like some?
103 https://gitweb.gentoo.org/proj/gentoo-mirrorstats.git/
104 <https://gitweb.gentoo.org/proj/gentoo-mirrorstats.git/tree/> has no CI but
105 might like some?
106 https://gitweb.gentoo.org/proj/sandbox.git/ has no CI but might want some?
107 I could go on.
108
109 So to kind of summarize. If I wanted to just do [CI for other projects] we
110 could likely just build that now and not need to talk to most of the
111 community because the CI for other projects is fairly segmented. It's the
112 part that delivers a lot of value (to me!) but, I'd wager, little value to
113 the rest of the community. However the Code Review is intertwined with CI;
114 because I think CI brings a bunch of value into the Code Review process and
115 there are significant Code Review paths (bugzilla, git patches) that don't
116 have presubmit coverage that I think could be fixed. This is why I
117 separated the concerns.
118
119 -A
120
121
122 >
123 > --
124 > Regards,
125 > Thomas Deutschmann / Gentoo Linux Developer
126 > fpr: C4DD 695F A713 8F24 2AA1 5638 5849 7EE5 1D5D 74A5
127 >