Gerrit Contributions
-
@tekojo said
Pushing stuff into gerrit is pretty complicated. I wish we would allow "drive-by-contributions" through github or some other simple channel. That would remove / simplify these cases.
I believe this question was raised in the mailing list, unfortunately I can't find the thread currently. However as far as I had understood then it had been "redirected" to the developer's mailing list, so perhaps you could do a very fast inquiry how and if it progressed? I'd certainly be interested to know.
One of the proposed solutions, if I remember correctly, was to allow uploading the relevant code somewhere and then a person that knows how to go through the motions gerrit-wise may pick it up and submit it as a proper patch. This could work for occasional contributors like myself - taking someone else's code refactoring it a bit if necessary to comply with Qt's codestyle, maybe writing a unit test and finally pushing it all to gerrit for review.
-
@kshegunov said
One of the proposed solutions, if I remember correctly, was to allow uploading the relevant code somewhere and then a person that knows how to go through the motions gerrit-wise may pick it up and submit it as a proper patch. This could work for occasional contributors like myself - taking someone else's code refactoring it a bit if necessary to comply with Qt's codestyle, maybe writing a unit test and finally pushing it all to gerrit for review.
The main thing we need is a way for the code's author to formally agree to the Qt Project's Contributor License Agreement. This is currently done through Gerrit.
If there's a way for the author to sign the agreement and then upload code without learning Git/Gerrit, that might lower the barrier for newcomers (although we'd then also need a way to then track if this "casual" upload has been picked up by someone and submitted to Gerrit)
-
The CLA agreement logic could potentially be added to the Qt Account however I don't know how much work it can represent to integrate that with Gerrit but it could be a more friendly page for newcomers.
AFAIK, there's no "upload a diff" concept in Gerrit so setting up git properly is not optional. At the extreme end we could potentially provide some sort of setup script/tool maybe through Qt Creator to make things easier.
Note that the current initialiser script to get a working Qt5 git clone already provides all the options to setup Gerrit and the related hooks to get a nice working environment to hack on Qt.
What is left to the user to do by hand is:
- Accept the CLA
- Create the SSH keys
- Upload them to Gerrit
- Hack and Push
Note that there's the qtrepotools module that might offer some nice helpers to use in the Qt Gerrit workflow. Adding them to the documentation might also help lower the entry barrier.
-
@JKSH said:
The main thing we need is a way for the code's author to formally agree to the Qt Project's Contributor License Agreement. This is currently done through Gerrit.
I think the point was that the original submitter only agrees to "free" the code from any copy rights. So that makes the person submitting it as a patch (e.g. me, or you) to do it from within the framework of his own signed CLA.
@SGaist said:
Note that the current initialiser script to get a working Qt5 git clone already provides all the options to setup Gerrit and the related hooks to get a nice working environment to hack on Qt.
The point is however that many (speculating on how "many" here) people choose not to bother for one reason or another. They have a solution that patches up their code but decide it's too much hassle to submit it. My father has such a piece of code for fixing some drag-n-drop bug in the list/table view. I've been trying to make him submit it ... unsuccessfully ...
-
Should we try to create a script that does the basic command line stuff leaving essentially the CLA and ssh key upload up to the user ?
The ssh key handling part being a bit tricky...
Tell him I'd be happy to review that although I can't give a +2 ;)
-
@kshegunov said in Gerrit Contributions:
They have a solution that patches up their code but decide it's too much hassle to submit it.
Yes, I think this is a major disadvantage for people (like me) that can work out a solution for a minor bug but that consider the set-up of the environment too costly (in terms of time and attention) to care. This might lead to Qt devs to focus on major bugs and new features while, quite naturally, minor bugs (priority 3 or worse) remain hanging. At least a minority of those would normally be fixed by the community, as it shouldn't require a huge programming effort, but the process discourages it. KDE in my opinion does a much better job in this sense (https://phabricator.kde.org/). I realise, however, that the main limitation here is the license.
-
I have to agree that this tedious process is a blocker for many potentially valuable contributions.
Out of my own experience - the first time I tried to set up gerrit (was a few years back) I gave up because the process was very Linux-centric and I just couldn't be bothered to work out all the quirks of translating it to Windows myself. After that the instructions got better every now and then and I tried a couple of times more. Each time I got a few steps closer just to get annoyed to the point of ditching the idea for the next couple of months. I still don't have it set up, though I'd love to take a stab at some of the minor bugs that bothered me for a long time, yet have too low of a priority for someone to fix them.
I'd love to be able to just do the work, attach a diff to the bug report (with a legal agreement checbox or whatnot) and let the module maintainer handle the bureaucracy.
-
@Chris-Kawa What were the latest pain points that got you out ?
-
@SGaist The last time I tried was a couple of months back, so my recollection is a bit foggy. I think I stopped somewhere around running some perl scripts on the repo and messing up my whole git setup.
Ok, I know what you're thinking - If you're not able to follow a couple of steps maybe it's a good thing you don't contribute, and I agree that it does a good job with outing some of the beginners. I do realize that some of the things I'll say sound very noobish, but I think that's a good thing in this context so please bare with me.
The point is the whole procedure is kinda daunting if you're, like me, used to just entering git credentials in some login window and being done with it. I'll go over it a bit:- setting up ssh keys. I know - to most Linux guys this is kids stuff, but a seasoned Windows programmer is not used to that at all and copy/pasting some magic commands and editing .config files to do god knows what is kinda weird.
- setting up git - again, to most Linux or command line hackers this is not worth mentioning, but the guide has something like 20 commands just to set up git. I remember half way through it I realized that all of them say --global somewhere in there and I just messed up other projects set up on my machine :/ Should've read that more closely I guess...
- getting sources - when you think you're almost done there's another whole page on just how to get the source code! It involves running perl scripts!I'll better install perl... This might be silly but to someone that usually just presses a button in an IDE this is ridiculous. Basically when I read
# updating each submodule to match the supermodule
I thought "what the heck does that even mean?". Then there's the question of updating it, syncing etc. etc. Yet another few pages about how all of it is set up, what to pull, where to push etc. Installing git hooks?... An evening passed by. - then there's the short part about adding a gerrit remote, a link to how gerrit works aaaaand... h o l y c o w, yet another evening spent reading through this stuff...
- and then, after all that, there's even no way to know if you didn't mess up somewhere. Just try to push something and hope for the best. Needless to say I did not get this far.
Don't get me wrong. I don't want to sound bitchy. I know that to someone that already did it once and has a worked out steps for pushing stuff this all seems like just complaints of a noob, but I'm talking from exactly this noob perspective - a guy who is used to just clone, write code, push/make pull request, go eat some biscuits. Basically spending few evenings to work this stuff out, messing my machine's setup along the way, just to push a 3 line commit is just not something I imagined.
-
@Chris-Kawa said in Gerrit Contributions:
Basically spending few evenings to work this stuff out, messing my machine's setup along the way, just to push a 3 line commit is just not something I imagined.
IMHO this is the central point. If I have a small commit and have to spend 2 days to send it away I'll just give up.
I KDE you create the patch file with git (3 clicks on GitExtensions), log-in click on submit for review and you are done
-
@SGaist said in Gerrit Contributions:
Tell him I'd be happy to review that although I can't give a +2 ;)
The review is the last and smallest of the problems, I know you know. ;)
Should we try to create a script that does the basic command line stuff leaving essentially the CLA and ssh key upload up to the user ?
I really don't see how we'd do that. Even compiling Qt on Windows can get pretty hassly when one considers all the tools and possibly dependencies that have to be pulled from various sources.
@VRonin said in Gerrit Contributions:
his might lead to Qt devs to focus on major bugs and new features while, quite naturally, minor bugs (priority 3 or worse) remain hanging.
And even then there's the possibility the patches are left hanging in gerrit.
https://codereview.qt-project.org/#/c/165958/Out of my own experience - the first time I tried to set up gerrit (was a few years back) I gave up because the process was very Linux-centric and I just couldn't be bothered to work out all the quirks of translating it to Windows myself.
Even in that in mind it's pretty quirky. I'm by no means a git master but this thread attests the difficulty one can meet, even if an experienced developer.
It involves running perl scripts!
Yep, I had tried that on Windows with strawberry pearl, I gave up after a few hours of gloriously failing to make it work.
and then, after all that, there's even no way to know if you didn't mess up somewhere. Just try to push something and hope for the best.
I was literally terrified about this, @SGaist knows how that went as he was guiding me through it. I even thought I could break the remote repo ... not a fun time ...
So back at the issue at hand, @tekojo had you the opportunity to ask if that proposition (made by one of Qt Company's employees if I recall correctly) went anywhere?
-
@Chris-Kawa Not my line of thought at all. I'm really interested about what trouble can make a seasoned programmer like you abandon the idea of contributing. I thought that the fact that you are working on Windows could be part of it because setting up keys and such stuff on that platform is not as straightforward as it is from Linux or macOS as well as the build dependencies are usually completely absent by default from that platform.
I've been through the ssh key setup process on Windows for other purpose and I thought afterward that I was pretty lucky when setting up for my first contribution on macOS even though at that time I found the process daunting. The documentation has improved but still, it's not as easy as anybody would like.@kshegunov I'm just throwing some ideas to to try to find a process that could bring difficulties down maybe have some sort of "Windows pack installer" that you could download to help you setup more easily for contribution.
You should add a ping comment on your patch, that's what I usually do when it starts to stale. -
-
@kshegunov said in Gerrit Contributions:
And even then there's the possibility the patches are left hanging in gerrit.
If patch is left hanging, it's your responsibility to bring attention of reviewers to it.
Though we could have a "remind bot" that would post automatic message in case there is no activity on review in e.g. 2 weeks, and if nothing happens in the next 2 weeks after message, move patch to deferred state
-
Also we could have a reviewer suggestion bot that adds all developers that might be relevant for each patch that is hanging unreviewed for, say, more than 3 days.
-
@tekojo as long as R&D doesn't mean Research & Destroy ;)
@Konstantin-Tokarev I like the idea of the second bot. It can be pretty hard to know whether the people you try to select are currently active or part of the project.
-
BTW, in WebKit project we have configuration file that allows people to be added to review automatically if patch touches file matching specific patterns [1]. Gerrit has a similar feature for watching changes, but watchers are not publicly shown on the review page, so patch author cannot know whom to ping if there is no response.
[1] https://github.com/WebKit/webkit/blob/master/Tools/Scripts/webkitpy/common/config/watchlist
-
@SGaist said in Gerrit Contributions:
You should add a ping comment on your patch, that's what I usually do when it starts to stale.
@Konstantin-Tokarev said in Gerrit Contributions:
If patch is left hanging, it's your responsibility to bring attention of reviewers to it.
Will do.
@SGaist said in Gerrit Contributions:
maybe have some sort of "Windows pack installer" that you could download to help you setup more easily for contribution.
Possibly feasible. I don't much work on windows, so our win users should feel free to correct me, but I think this should include setting up the git, somehow generating and uploading the ssh keys and probably installing perl with running the appropriate scripts. Do I miss something? Perhaps a set of dependencies?
@Konstantin-Tokarev said in Gerrit Contributions:
Though we could have a "remind bot" that would post automatic message in case there is no activity on review in e.g. 2 weeks, and if nothing happens in the next 2 weeks after message, move patch to deferred state
Also we could have a reviewer suggestion bot that adds all developers that might be relevant for each patch that is hanging unreviewed for, say, more than 3 days.
Both of those suggestions sound very good to me. What about adding a list of reviewers automatically on first patch upload (following the same logic)?
-
I know little of this is technically feasible (the amount of work to gain ratio) but just for the sake of an idea let me describe what I'd like the process to look like:
- I open QtCreator (because why not?), from one of the menus I choose "Contribute"
- I'm presented with a wizard that lets me login with my Qt account credentials and accept CLA
- The wizard presents a list of development branches and modules I can check (like the Qt installer does), I select some
- The wizard downloads stuff (source, dependencies, even git if needed!), sets up git (locally to the downloaded repos!) without me needing to do anything, creates the .pro files and I can just start hacking right away (Visual Studio does things like that so it's not really science fiction)
- When I'm done I just push my changes to automatically set up remote and am presented a link to gerrit review page (gerrit integration into QtCreator would be a cherry on the cake).
- Done
Btw. Why do we even need perl? I mean maybe it was convenient to use in a linux environment but think about it - we have a giant c++ library, with its own language(QML), which has two custom build systems (qmake and qbs), its own IDE (QtCreator), two (or is it already one now?) Javascript engines, a networking and web browser engines and yet we still need a totally unrelated foreign language runtime just to download the sources. Sounds kinda eccentric.
-
@Chris-Kawa I think your process might move the problem on the other side of gerrit. Making it too easy to propose changes to the code might swamp code reviewers with changes that can't be accepted. Bots could filer out a few of them but probably the burden will increase significantly.
I'd stick with a diff submission portal. preparing a git diff is the kind of thing a seasoned programmer considers trivial but it's not for a newcomer hence filtering out submission by people that might feel too confident in their Qt expertise.
Same goes for the config. I'm not a fan of a 100% automated wizard but it shouldn't take more than 1 or 2 hours to set up the entire thing for a regular Qt user with decent git experience that is looking to contribute for the first time.