Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

codereview: accept Github PRs #18517

Closed
bradfitz opened this issue Jan 4, 2017 · 100 comments
Closed

codereview: accept Github PRs #18517

bradfitz opened this issue Jan 4, 2017 · 100 comments

Comments

@bradfitz
Copy link
Contributor

bradfitz commented Jan 4, 2017

I propose we start accepting Github PRs (Pull Requests).

Currently we have a bot auto-close them with a message telling them we don't use PRs and instead use Gerrit.

When we moved to Github, @robpike said:

Most members of the Go community use Git and host their work on GitHub, and we should join them.

While that's true, we're still not using Github like Github users use Github.

I believe that our current pushback bot dissuades many potential contributors.

I propose we start accepting pull requests by automatically converting them into Gerrit CLs ("change lists", same as a PR but different terminology). Reviews would still happen on Gerrit and the bot would update the PR of activity on Gerrit. Gerrit is still where we'd run trybots and push the "Merge" button. We would never merge on Github. Gerrit would remain the upstream source-of truth.

I prototyped this syncing in https://github.com/LetsUseGerrit/gerritbot/ and used it a bit while working on gRPC-go (examples), but in the opposite direction: my Gerrit CLs were abandoned after gRPC-go accepted them on Github.

In any case, the point is that this can be automated with a bit of work and rejecting Github PRs or not is a policy decision more than anything. I propose we change our policy.

Some will say that the quality of PRs will decrease, as many the PRs that arrive and are auto-closed by the pushback bot are pretty bad. But so are many of the Gerrit CLs. I believe the Gerrit CLs are only better on average because that means it's more likely people have read the contributing instructions, or have contributed in the past. But if you only look at first-time contributors on Github PRs vs Gerrit CLs, the quality doesn't look too different. People improve over time as they learn the project and its policies.

@bradfitz bradfitz added this to the Proposal milestone Jan 4, 2017
@bradfitz bradfitz self-assigned this Jan 4, 2017
@randall77
Copy link
Contributor

How would the CLA happen? My understanding is that currently you can't make a Gerrit CL without having already jumped through the CLA hoop. If we auto-make a Gerrit CL, we'd have un-CLAd CLs floating around. Mark them in big red letters, maybe?

@bradfitz
Copy link
Contributor Author

bradfitz commented Jan 4, 2017

@randall77, Google has an official bot for CLA checking already. We just have to flip a bit to turn it on.

@bradfitz
Copy link
Contributor Author

bradfitz commented Jan 4, 2017

(The CLA check would happen on the PR before the Gerrit CL is created.)

@fatih
Copy link
Member

fatih commented Jan 4, 2017

Is Gerrit a requirement? I'm asking because Github recently released improved versions of reviewing Code at Github. Some parts (such as commenting on the code) is now similar to Gerrit. Also say we opened a PR from Github, is the Contributor required to do anything in Gerrit or is only used for merging/testing? I'm curious about the boundary (I just contributed once via Gerrit so don't remember quite the details anymore

@mvdan
Copy link
Member

mvdan commented Jan 4, 2017

What about feedback? If someone files a PR and it gets converted to a Gerrit CL, they might not know how or be willing to reply to any comments or update the code.

@bradfitz
Copy link
Contributor Author

bradfitz commented Jan 4, 2017

@fatih, Gerrit is still a requirement. GitHub has made improvements, but it's still not as powerful as Gerrit. Moving off Gerrit would be way too big of a change to be palatable.

@mvdan, as I wrote above:

Reviews would still happen on Gerrit and the bot would update the PR of activity on Gerrit.

You can see this in action at grpc/grpc-go#546 for example. The bot is barely a prototype at this point and could be improved to leave better messages on Github.

@velovix
Copy link

velovix commented Jan 5, 2017

Taking a look at the grpc issue, I'm a bit skeptical as to the value this strategy adds. Users get to contribute changes in a more familiar way, but as soon as a code review is posted, we're in unfamiliar territory again. I suspect that, as a result of this change, we'll see a lot of abandoned contributions proposed by people who didn't know what they were getting into and don't have an interest in figuring this all out. Learning Gerrit is a pill contributors still need to swallow, regardless.

That said, I appreciate the effort the Go team is making to improve this process.

@bradfitz
Copy link
Contributor Author

bradfitz commented Jan 5, 2017

but as soon as a code review is posted, we're in unfamiliar territory again.

It's something to learn, yes, but it's not as much of a mountain as our current process.

Also, the new Gerrit UI is coming along nicely and will probably be the default at about the same time we're done with this, lowering the bar as well.

@rakyll
Copy link
Contributor

rakyll commented Jan 5, 2017

I would also love to see Trybots integration to push the CI results back to the PR. If no one is working on that, I can.

@bradfitz
Copy link
Contributor Author

bradfitz commented Jan 5, 2017

@rakyll, that'd be nice, but it's a bit soon for that. Let's get Hello World working first, and then we can do that fanciness.

@rakyll rakyll closed this as completed Jan 5, 2017
@slimsag
Copy link

slimsag commented Jan 5, 2017

( @rakyll did this get closed by accident? )

@dsnet dsnet reopened this Jan 5, 2017
@fbettag
Copy link

fbettag commented Jan 5, 2017

YES YES YES YES!

@nathany
Copy link
Contributor

nathany commented Jan 5, 2017

👍 This would be nice.

As someone who rarely uses Gerrit or the gocontribute tool, I've found it necessary to review the rather lengthy Contribution Guidelines #17802 every time. Honestly, that is a deterrent when wanting to make a small change, such as fixing a typo in the release notes.

I do have the same question (#18517 (comment)) as @fatih and I'm not convinced that Gerrit is still more powerful. It seems far simpler to join language communities like Microsoft TypeScript, Mozilla Rust, and Apple Swift in using GitHub for development.

But I can understand that a lot of tooling has been built up around Gerrit, that it could be the personal preference of all or most regular contributors, and switching tools yet again would be a big undertaking.

Which is to say, I think this proposal would be a very nice way to meet the GitHub-using community in the middle. Using Gerrit for review isn't bad -- a few icons are a mystery (e.g. it took me a minute to figure out how to switch to a unified view), but that will likely improve with the new UI.

I think the big open question is what happens when somebody pushes a followup commit to GitHub or amends their local commit and force pushes it? Can gerritbot be expected to handle that?

Thanks Brad.

@glasser
Copy link
Contributor

glasser commented Jan 5, 2017

Would contributors be able to submit additional versions of their patch set by updating their PR (branch) too, or would they have to switch to Gerrit?

As a very occasional Go contributor I find I have to relearn the semantics around creating and publishing patch sets each time, vs GitHub where it's just "push to a branch". (As an open source maintainer I do recognize that Gerrit leads to better patch sets vs PRs where contributors tend to tack more commits on the end during review instead of rewriting, though.) Whereas the discussion part on Gerrit is no trouble.

@nathany
Copy link
Contributor

nathany commented Jan 5, 2017

@glasser Check out GitHub squash commits https://github.com/blog/2141-squash-your-commits It's long been possible for maintainers to squash things first via tools like hub, or for contributors to amend and force push. In the past year, such functionality is just a button on GitHub. It's not identical to the Gerrit cherry-pick system, but accomplishes the same goal (tidy git history).

@bamarni
Copy link

bamarni commented Jan 5, 2017

Would it make sense that the gopherbot also syncronizes it the other way around (Gerrit -> Github)? Because apart from contributing Github PRs also allow people to watch open-source projects development, either through the timeline or the notifications overview panel.

That could be great to also have access to the contribution activity through Github, eg. to see what CLs are currently pending, what is merged or refused, possibly what is discussed too.

@rakyll
Copy link
Contributor

rakyll commented Jan 5, 2017

( @rakyll did this get closed by accident? )

It is closed by my issue triaging tool, waffle.io, by mistake :(

@bradfitz
Copy link
Contributor Author

bradfitz commented Jan 5, 2017

@bamarni, that might be nice later once we get the basics working. Or maybe https://dev.golang.org/ will be fleshed out more by then and we'd prefer that dashboard. We'll see.

@nathany
Copy link
Contributor

nathany commented Jan 5, 2017

If gerritbot is just to transfer the initial PR to a CL, what would the transition look like for followup changes based on the review?

@bradfitz
Copy link
Contributor Author

bradfitz commented Jan 5, 2017

If gerritbot is just to transfer the initial PR to a CL

That is not true. Even in the prototype already implemented, it updates Gerrit when a new version of the Github PR arrives. It can also reply and tell users to squash if they're stacking commits on top of each other.

@willnorris
Copy link

(The CLA check would happen on the PR before the Gerrit CL is created.)

This should certainly work fine, but let me know if/when you enable this so I can keep a close eye on any CLA issues.

There are a few cases I can think of that might cause confusion, depending on how you are creating the Gerrit CL. CLA checking on both GitHub and Gerrit support looking contributors up by email address, but Gerrit has its own internal email alias concept that doesn't apply to GitHub PRs. Similarly, CLA checks on GitHub PRs can be done based solely on GitHub username, even if the git author email is something completely different than what was used to sign the CLA. Gerrit obviously doesn't know or care about GitHub usernames. So I can imagine a case where CLA checking on the GitHub PR succeeds, but subsequently fails when moved over to Gerrit.

Anyway, lots of moving pieces, but I'm happy to do what we can on the CLA side to make this easier.

@bradfitz
Copy link
Contributor Author

bradfitz commented Jan 5, 2017

@willnorris, thanks! Yes, I planned on bugging you, @spearce, et al when the time came.

@JustinAzoff
Copy link

This would be very nice. A week ago I forked x/crypto to add a missing feature to the ssh library[1]. https://golang.org/doc/contribute.html is daunting and I ended up tabling the whole thing until I have a few hours to set aside to setup everything required to submit or even discuss my 10 line patch.

[1] golang/crypto@master...JustinAzoff:master

@jadbox
Copy link

jadbox commented Jan 5, 2017

@bradfitz "It can also reply and tell users to squash if they're stacking commits on top of each other."

When you merge PRs, you have the option to squash the merge via Github's UI. I've thought it's odd that users are forced to keep squashing commits on their branches... it's especially annoying when the PR author makes several small changes to adhere to feedback and then they need to (continually) 're-squash' them.

@minux
Copy link
Member

minux commented Jan 5, 2017 via email

gopherbot pushed a commit to golang/build that referenced this issue Feb 8, 2018
Update golang/go#18517

Change-Id: I5c7980d07db368c90c2e76610ee4c854cec27b60
Reviewed-on: https://go-review.googlesource.com/92936
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
gopherbot pushed a commit to golang/build that referenced this issue Feb 8, 2018
Update golang/go#18517

Change-Id: I5ea227896265d5612b5efa60850f9e03b9025db6
Reviewed-on: https://go-review.googlesource.com/92937
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
@gopherbot
Copy link

Change https://golang.org/cl/93015 mentions this issue: cmd/gopherbot: ignore GitHub PRs when updating issues

gopherbot pushed a commit to golang/build that referenced this issue Feb 9, 2018
Otherwise you get something like
golang/go#23752 (comment)

Update golang/go#18517

Change-Id: I5298f1e34738a4f6faa8b829546bf880a237043d
Reviewed-on: https://go-review.googlesource.com/93015
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
@gopherbot
Copy link

Change https://golang.org/cl/93035 mentions this issue: all: remove PULL_REQUEST_TEMPLATE from .github

gopherbot pushed a commit that referenced this issue Feb 9, 2018
Update #18517

Change-Id: I76d928d5fcc5ed22beaffb86f0fa8fbf6d4ac3d7
Reviewed-on: https://go-review.googlesource.com/93035
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
@gopherbot
Copy link

Change https://golang.org/cl/93135 mentions this issue: maintner/maintnerd: add additional GitHub projects to "go" config

gopherbot pushed a commit to golang/build that referenced this issue Feb 9, 2018
Update golang/go#18517

Change-Id: Icdc131236092f15c51effafa71329e280979a0ef
Reviewed-on: https://go-review.googlesource.com/93135
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
@gopherbot
Copy link

Change https://golang.org/cl/93335 mentions this issue: CONTRIBUTING: remove Pull Request bit

@andlabs
Copy link
Contributor

andlabs commented Feb 11, 2018

Would it still be possible to submit changes directly to Gerrit?

@davecheney
Copy link
Contributor

davecheney commented Feb 11, 2018 via email

@andlabs
Copy link
Contributor

andlabs commented Feb 11, 2018

Good; thanks. (I'm not opposed to GitHub PRs at all — my own projects use the PR system and GitHub's code review software; I am a bit uncomfortable with having to have a forked repository linger in your repo list, though, but that may just be me not knowing everything about git or GitHub to know why the current system they have is better than just sending over a patch file. That being said, I plan on patching Go from my work computer(s) instead of from my home computer, and was going to just git clone directly instead of going through GitHub, which is why I was asking.)

gopherbot pushed a commit that referenced this issue Feb 11, 2018
Also remove the "Also, please do not post patches on the issue
tracker" part, since that didn't seem to reduce the number of patches
inlined into bug reports. And now that we accept PRs, people will
probably try that first. We'll see.

Fixes #23779
Updates #18517

Change-Id: I449e0afd7292718e57d9d428494799c78296a0d2
Reviewed-on: https://go-review.googlesource.com/93335
Reviewed-by: Andrew Bonventre <andybons@golang.org>
@gopherbot
Copy link

Change https://golang.org/cl/93355 mentions this issue: cmd/gerritbot: remind people to publish their draft comments

@gopherbot
Copy link

Change https://golang.org/cl/93356 mentions this issue: cmd/gerritbot: reword message for when a Gerrit message is posted

@gopherbot
Copy link

Change https://golang.org/cl/93357 mentions this issue: cmd/gerritbot: don’t post messages to GitHub over an hour old

@andybons
Copy link
Member

Filed #23783 to further update documentation.

gopherbot pushed a commit to golang/build that referenced this issue Feb 12, 2018
Update golang/go#18517

Change-Id: Ia970d648b85cd75831ee0c6969762752e9b49289
Reviewed-on: https://go-review.googlesource.com/93355
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
gopherbot pushed a commit to golang/build that referenced this issue Feb 12, 2018
Update golang/go#18517

Change-Id: Iccb7b5c61d8fc161b877d0a39f4ee1c523a4cd75
Reviewed-on: https://go-review.googlesource.com/93356
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
@gopherbot
Copy link

Change https://golang.org/cl/93435 mentions this issue: cmd/gerritbot: don't query GitHub as much

@andybons
Copy link
Member

This is live. We now accept Pull Requests in all our repos so I’m going to close this as fixed.

🎉

gopherbot pushed a commit to golang/build that referenced this issue Feb 13, 2018
Use maintner as a fast-path to determine whether comments are
duplicates or not.

Update golang/go#18517

Change-Id: I3ddc380e6e202371903ce62ae9e4c07e9805c1ed
Reviewed-on: https://go-review.googlesource.com/93435
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
@bradfitz
Copy link
Contributor Author

For more information, see https://golang.org/wiki/GerritBot

@thaJeztah
Copy link
Contributor

Awesome work!

@golang golang locked as resolved and limited conversation to collaborators Feb 13, 2018
@golang golang deleted a comment from JoaoGFarias Feb 13, 2018
@gopherbot
Copy link

Change https://golang.org/cl/104577 mentions this issue: cmd/pushback: delete

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests