Skip to content
This repository has been archived by the owner on Apr 17, 2019. It is now read-only.

WIP: [mungegithub] OWNERS implementation #474

Closed
wants to merge 3 commits into from

Conversation

eparis
Copy link
Contributor

@eparis eparis commented Feb 9, 2016

This PR is missing some key usability features.

  • There is no way to know who needs to approve a given PR
  • There is no way for me, as an approver, to know what PRs I need to approve.

I believe that before we turn this on, we REALLY need to solve those usability issues.

@thockin
Copy link
Contributor

thockin commented Feb 10, 2016

Is this ready for review or targetted discussion? can you nominate a reviewer? I'm keen to get this moving, but I am also buried in PRs..

@eparis
Copy link
Contributor Author

eparis commented Feb 10, 2016

This code is ready for review. @pmorie for some reason has started looking more and more in this area. But I see this as completely blocked on UI/usability and have no interest in seeing it merged until this owners stuff is discoverable and manageable by both PR authors and owners. And I don't know when I'll get around to playing with UI stuff myself....

@pmorie
Copy link
Contributor

pmorie commented Feb 11, 2016

@pmorie for some reason has started looking more and more in this area

I think the reason was you started asking me for reviews :)

ownerApproval = "has-owner-approval"
)

type assignmentConfig struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if I interpret correctly, this is the type that the OWNERS file is going to unmarshal into, yes?

Can we make it be a struct so we have room to grow?

type OwnersFile struct {
    Owners []string `json:owners`
 }

This then leaves me room for adding maintainers or other metadata.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm tired. I just asked you for exactly what you did, modulo JSON tags.

@thockin
Copy link
Contributor

thockin commented Feb 11, 2016

This could do with a short doc explaining the semantics. We are sort of lacking in docs for all of the gh bot stuff..

@bgrant0607
Copy link
Contributor

What is the status of this?

@bgrant0607
Copy link
Contributor

What does this PR do?

@eparis
Copy link
Contributor Author

eparis commented Feb 22, 2016

This PR adds or removes a label called has-owner-approval to every PR. It looks for approved or I approve on any line in any comment on the PR.

  • If bgrant is in the OWNERS file in / his approval would be enough for any PR to get the label.

  • If user pkg-user is in pkg/OWNERS
    user pkg-api-user is in pkg/api/OWNERS
    users pkg-client1-user and pkg-client2-user are in pkg/client/OWNERS

    and a PR changes pkg/api/endpoints/util.go and pkg/client/typed/generated/core/v1/endpoints.go

Any of the following combinations of people could approve the PR.

  • bgrant
  • pkg-user
  • pkg-api-user and pkg-client1-user
  • pkg-api-user and pkg-client2-user

We can EASILY make the submit queue require the 'has-owner-approval' label. If it gets added by hand, it will be removed.


Now I am unwilling to merge, and I feel like I've written this 10 times, but can't find it, due to UI/UX/usability. We absolutely need 2 things before i think we should turn this on.

  1. We need some way for an OWNER to know all of the PRs for which (s)he should be giving approval. I also think we need a way to know which of those you are the 'leaf' approver and which of those you are a 'trunk' approver. In above example I'd call bgrant and pkg-user a 'trunk' approver and pkg-api-user and pkg-client-user as 'leaf' approvers. I don't want the bgrant list to have every single PR even though he can approve every single one. But I would want it to show every PR which touches say README.md, which has to be approved by a / OWNER.

  2. We need some way for a PR Author to see the list of OWNERS who need to approve their PR. They should see the set of all 'leaf' approvers and should be able to see the 'trunk' approvers as well if they so choose. Without knowledge of who you are waiting on, processes become stuck. Yes, you can troll around in the repo and look at the OWNERS files, but is that something we should hoist on an unsuspecting community member?

Even if I had the time, I'm not sure I have the web design skills to put those 2 UIs together into anything reasonable, but without them, this whole process because quite opaque to developers and almost impossible for owners....

@bgrant0607
Copy link
Contributor

Thanks, @eparis.

The logic about who can approve makes sense to me -- approvers from all touched directories are required.

I think LGTM from an OWNER should count as approval. I don't think we need to introduce different text. Ideally, LGTM from OWNERs would apply the LGTM label automatically, as well. With this, I think we could get rid of "ok-to-merge", also: if the required OWNERS say it's good, just merge it already. Maybe the lgtm label could mean LGTM from someone trusted and has-owner-approval could be applied once all required owners have given LGTM.

I'd like to drive PR assignment (blunderbuss) from OWENRS, also. The blunderbuss list is currently too small, and many PRs languish with overloaded assignees without being reassigned.

Maybe we should even automatically reassign any PR to which the assignee doesn't respond within some amount of time (a day, a week?).

The auto-assigner could reassign from a pool of owners that hasn't yet approved in the case that multiple approvers are required, favoring leaf owners, in general.

We could maybe provide support to reassign to a trunk approver, using ESCALATE or somesuch. Manual reassignment should work, also, at least until the reassignment timeout.

For UX, we could post a message to the PR to describe the workflow and the escalation procedure, and list the leaf and trunk owners. The PR author could notify other owners or escalate if automatic reassignment wasn't working.

Distinguishing between partially lgtm and fully approved would be useful for listing PRs in limbo.

@eparis
Copy link
Contributor Author

eparis commented Feb 23, 2016

I'd like to drive PR assignment (blunderbuss) from OWENRS, also. The blunderbuss list is currently too small, and many PRs languish with overloaded assignees without being reassigned.

I should probably do that separately. I intended that as an enhancement on this, but it is actually reasonable to do first and makes all of the code for this smaller/easier...

Nothing enforces it, but it should be automatically just adding and
removing a label based on 'OWNERS'

The kubernetes tree pointed to MUST have an OWNERS file in the root dir
or it will absolutely go off the rails.
@thockin
Copy link
Contributor

thockin commented Mar 22, 2016

Whats the status on this? Is this PR still alive, or has it been supplanted by others? I see OWNERS files in tree..

@eparis
Copy link
Contributor Author

eparis commented Mar 22, 2016

This PR is still alive-ish. I don't know how to write a decent UI for OWNERS. The OWNERS files in the kube tree only currently supports 'assignees'. Which is what the old blunderbuss uses. This PR expands that to also have an owners concept. But I don't want to see it merged until we have a good UI for both owners to know what they need to approve and for PR authors to know where to get approval.

bgrant had some ideas (auto-reassign the PR to another owner) but I think that gives a rather 'black box' view for everyone...

So the mechanics are here in this PR, but I don't know if I have to time to create a good story for both owners and authors. So I'd love someone else who has time to pick up the ball there...

@bgrant0607
Copy link
Contributor

Dashboard to view PRs that need to be approved, parameterized by approver.
and
List of de-duped approver lists posted to each PR.

@bgrant0607
Copy link
Contributor

For tests and docs it would be useful to be able to specify file-level ownership.

cc @hongchaodeng @lavalamp

@lavalamp
Copy link
Contributor

@bgrant0607 actually for tests, ownership of just parts of files is what we want. Or maybe a different mechanism. @fejta may be able to find people to do this. I'm about to send an email to the testing sig about this.

@bgrant0607
Copy link
Contributor

@lavalamp Ok, though I would like to be able to use whatever mechanism to automatically assign PRs and issues.

@lavalamp
Copy link
Contributor

Yes, the whole idea would be auto-flaky test issue assignment. Worst case,
we can split out tests owned by different people/groups into separate files.

On Fri, Apr 15, 2016 at 4:57 PM, Brian Grant notifications@github.com
wrote:

@lavalamp https://github.com/lavalamp Ok, though I would like to be
able to use whatever mechanism to automatically assign PRs and issues.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#474 (comment)

@asalkeld
Copy link
Contributor

This might be a solution to the UI problem: http://gerrithub.io/

@davidopp davidopp self-assigned this May 29, 2016
@davidopp
Copy link
Contributor

OK, it is my new mission in life to get some version of this merged ASAP. This feature has become pretty critical, and I think we should do the absolute minimum to get it merged.

First, @eparis , thank you very much for doing this.

The semantics you proposed look reasonable.

I think the issue @bgrant0607 brought up about reusing LGTM is an interesting one. A scenario we need to consider is when someone wants to indicate that the PR looks fine to them, but they want someone else to also do a review (and thus it should not merge until the other person has looked at it). Under Brian's suggestion, if the first reviewer is also a valid approver, then they cannot use the phrase "LGTM" to indicate their satisfaction with the PR, because that will trigger a premature merge. There are obviously two solutions here:
(1) do what Brian suggested, where LGTM really means approval, and the first reviewer in my scenario would use some English phrasing that did not contain LGTM in it
(2) use your original suggestion, where the meaning of LGTM does not change, and we introduce a new phrase for approval
I'm not sure which one is better. I don't really object to Brian's suggestion, but wanted to at least mention the possible downside.

I think we should get rid of ok-to-merge completely. I don't think it has ever been useful. (I think it was intended to denote "I didn't check this PR's logic, but the PR at least seems non-malicious" or something like that.)

I think we should also get rid of the LGTM label. The useful label will be has-owner-approval once this feature is implemented.

Regarding the usability enhancements: I disagree that either of them is needed for the initial version of this feature. I think we should make it the PR assignee's responsibility to shepherd the PRs assigned to them through the process. So for example, if they are not a suitable approver, then they are responsible for reassigning the PR to a suitable approver (either instead of, or after, they have done a review). If this is done properly, then the user will be "in the loop" and doesn't need to understand the full policy (though I certainly don't object to having the bot automatically add a link to the policy when a PR is created). I am not a big fan of Brian's suggestion "we could post a message to the PR to describe the workflow and the escalation procedure, and list the leaf and trunk owners." The thing I worry about is that users will see that and immediately @-mention everyone in that (presumably very long) list, which will make being @-mentioned a completely useless signal, which would be very bad. Also it will go stale unless we edit it each time OWNERS files change.

To be clear, I agree it would be useful to have tools to show approvers a list of PRs that they could approve, and (somewhat less so, since it's not hard to figure out once you know the policy) to show PR authors who is in the candidate approver pool. But I think that, for now, it's OK to lean on the PR's assignee to shepherd the PR through the approval process (and to reassign when they can't). Now that the auto-assigner is integrated with OWNERs this seems reasonable.

WDYT?

@bgrant0607
Copy link
Contributor

See also #869

@bgrant0607
Copy link
Contributor

There's discussion about ok-to-merge in kubernetes/kubernetes#24228

@davidopp
Copy link
Contributor

ping @eparis -- we'd really like to get this in... Could you comment on my last comment in this issue?

@bgrant0607
Copy link
Contributor

@davidopp I'm also in favor of doing MVP, and iterating from there.

I think the minimum is

  • Add approvers to OWNERS files
  • Require approvers of all directories touched to approve -- "I approve" is fine. We can change it later if desired
  • Apply owners-approve label when all have approved
  • Gate submit queue on approval instead of lgtm
  • Eliminate lgtm label

As a separate task, someone can work on assigning approvers after the initial reviewer comments lgtm.

@fejta
Copy link
Contributor

fejta commented Jun 15, 2016

What causes the PR to wait for a review if it is authored by an owner?

On Tue, Jun 14, 2016, 19:10 Brian Grant notifications@github.com wrote:

@davidopp https://github.com/davidopp I'm also in favor of doing MVP,
and iterating from there.

I think the minimum is

  • Add approvers to OWNERS files
  • Require approvers of all directories touched to approve -- "I
    approve" is fine. We can change it later if desired
  • Apply owners-approve label when all have approved
  • Gate submit queue on approval instead of lgtm
  • Eliminate lgtm label

As a separate task, someone can work on assigning approvers after the
initial reviewer comments lgtm.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#474 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AA5ZNUa502QRHDK-rwAlHet-MKsIAeLEks5qL18HgaJpZM4HWEhv
.

@bgrant0607
Copy link
Contributor

@fejta Honor system? Nothing stops anyone with write access from applying lgtm to their own PRs today. An author shouldn't comment "I approve" on their own PR. That seems pretty easy to enforce, though.

@fejta
Copy link
Contributor

fejta commented Jun 15, 2016

If I'm an owner I expect to be able to send the review to a non owner and
get it merged after they lgtm... but I guess in this system either I'll
have to self approve or else find another owner to do the review?

On Tue, Jun 14, 2016, 23:57 Brian Grant notifications@github.com wrote:

@fejta https://github.com/fejta Honor system? Nothing stops anyone with
write access from applying lgtm to their own PRs today. An author
shouldn't comment "I approve" on their own PR. That seems pretty easy to
enforce, though.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#474 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AA5ZNUh_gat6MmamDfeQ3GY61S4IVfBRks5qL6JxgaJpZM4HWEhv
.

@bgrant0607
Copy link
Contributor

@fejta

Previous workflow:

  • a reviewer, who didn't necessarily have write access (and therefore label access), would be assigned
  • the reviewer would eventually type "LGTM" into a comment
  • the author would (often) squash commits and/or rebase
  • the reviewer would then apply the lgtm label if they had label access, or would notify someone in kubernetes-maintainers to do that if they did not; the author could self-apply lgtm if they had label access

Proposed workflow:

  • a reviewer, who isn't necessarily an approver, would be assigned
  • the reviewer would eventually type "LGTM" into a comment
  • the author would (often) squash commits and/or rebase
  • the reviewer would then type I approve if they were an approver, or would notify an approver to do that if they were not; the author could self-approve if they were an approver

It's pretty much the same, except that it bypasses github ACLs.

We've already taken direct merge powers away from most people in kubernetes-maintainers.

@fejta
Copy link
Contributor

fejta commented Jun 15, 2016

New flow sgtm. Thanks!

On Wed, Jun 15, 2016, 09:54 Brian Grant notifications@github.com wrote:

@fejta https://github.com/fejta

Previous workflow:

  • a reviewer, who didn't necessarily have write access (and therefore
    label access), would be assigned
  • the reviewer would eventually type "LGTM" into a comment
  • the author would (often) squash commits and/or rebase
  • the reviewer would then apply the lgtm label if they had label
    access, or would notify someone in kubernetes-maintainers to do that if
    they did not; the author could self-apply lgtm if they had label access

Proposed workflow:

  • a reviewer, who isn't necessarily an approver, would be assigned
  • the reviewer would eventually type "LGTM" into a comment
  • the author would (often) squash commits and/or rebase
  • the reviewer would then type I approve if they were an approver, or
    would notify an approver to do that if they were not; the author could
    self-approve if they were an approver

It's pretty much the same, except that it bypasses github ACLs.

We've already taken direct merge powers away from most people in
kubernetes-maintainers.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#474 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AA5ZNZSdf_IQ5XD072-ULH6d23G-fqT8ks5qMC4sgaJpZM4HWEhv
.

@davidopp
Copy link
Contributor

@eparis What do you think of @bgrant0607 's suggestions here
#474 (comment)

? Do you think you can update this PR to do it? I am willing to take the first item he mentioned ("Add approvers to OWNERS files")

@bgrant0607
Copy link
Contributor

I created a tracking issue for finishing this: #1389

@@ -0,0 +1,180 @@
/*
Copyright 2015 The Kubernetes Authors All rights reserved.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: 2016? (here and above)

@k8s-github-robot
Copy link

Labelling this PR as size/L

@bgrant0607
Copy link
Contributor

@hongchaodeng is working on OWNERS, but I don't think this particular PR is going anywhere, so closing.

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

Successfully merging this pull request may close these issues.

None yet