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

Allow /approval variant for Prow approve plugin. #18141

Closed
wants to merge 1 commit into from

Conversation

wlynch
Copy link

@wlynch wlynch commented Jul 1, 2020

It's common within internal Google code review to see "LGTM, Approval"
as a response to approved code reviews, so I've been somewhat conditioned to use
/approval with Prow, only to discover later that it didn't work.

This adds the ability for Prow to accept both /approve and /approval
as valid commands.

This also makes it easy to add other variants (e.g. /approved?) later
if we need to.

It's common within internal Google code review to see "LGTM, Approval"
as a response to approved code reviews, so I've been somewhat conditioned to use
`/approval`, only to discover later that it didn't work.

This adds the ability for Prow to accept both `/approve` and `/approval`
as valid commands.

This also makes it easy to add other variants (e.g. `/approved`?) later
if we need to.
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 1, 2020
@k8s-ci-robot
Copy link
Contributor

Welcome @wlynch!

It looks like this is your first PR to kubernetes/test-infra 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/test-infra has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Contributor

Hi @wlynch. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 1, 2020
@k8s-ci-robot k8s-ci-robot added the area/prow Issues or PRs related to prow label Jul 1, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: wlynch
To complete the pull request process, please assign cjwagner
You can assign the PR to them by writing /assign @cjwagner in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added area/prow/plugins Issues or PRs related to prow's plugins for the hook component sig/testing Categorizes an issue or PR as relevant to SIG Testing. labels Jul 1, 2020
@alvaroaleman
Copy link
Member

cool with me
/ok-to-test
/assign @fejta
(as I can not tell if the claim of what you are using internally is accurate or not :) )

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 3, 2020
@fejta
Copy link
Contributor

fejta commented Jul 9, 2020

Why not just leave an approving github review so you don't have to use /foo commands at all here? An example of my doing this: #18189 (review)

I am not sure the costs associated with this sort of change are worth it:

  • Nobody leaves /approval nor /approve comments inside Google. We click one of a couple buttons/check boxes.
  • We've tended to try and maintain a single way of doing things and expect people to learn this.
    • Humans are flexible and learn at learning a diversity of language constructs. Computers are terrible about this.
    • Once we allow this, why just these two and not also /approved, /approving? Why only English? What about what is common in other companies?
      • The marginal returns on identifying and addressing all these edge cases rapidly exceeds the costs.

But the most fundamental thing here is you should just leave an approving github review to approve, which you cannot get wrong.

To me the current behavior is clear:

  • Approve by leaving an approving github review.
  • Alternatively, you can leave an /approve comment.
  • Those are the only two options (personally I would remove the case insensitivity too)

The two config knobs for this are:

// IgnoreReviewState causes the approve plugin to ignore the GitHub review state. Otherwise:
// * an APPROVE github review is equivalent to leaving an "/approve" message.
// * A REQUEST_CHANGES github review is equivalent to leaving an /approve cancel" message.
IgnoreReviewState *bool `json:"ignore_review_state,omitempty"`

// ReviewActsAsLgtm indicates that a GitHub review of "approve" or "request changes"
// acts as adding or removing the lgtm label
ReviewActsAsLgtm bool `json:"review_acts_as_lgtm,omitempty"`

@wlynch
Copy link
Author

wlynch commented Jul 16, 2020

But the most fundamental thing here is you should just leave an approving github review to approve, which you cannot get wrong.

The only counterpoint I have is that the GitHub code review Approve button only shows up in the Review Changes reply under /files

image

and not under any replies in the base pull request view (this is a consequence of this PRs being represented as an Issue):

image

though perhaps this is more a feature request for GitHub to implement. :)

Once we allow this, why just these two and not also /approved, /approving? Why only English? What about what is common in other companies?

That's fair. I'll close this out. Thanks!

@wlynch wlynch closed this Jul 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/prow/plugins Issues or PRs related to prow's plugins for the hook component area/prow Issues or PRs related to prow cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants