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

Bug in action-required-review #41933

Open
tureck1y opened this issue Feb 20, 2025 · 4 comments · May be fixed by #41966
Open

Bug in action-required-review #41933

tureck1y opened this issue Feb 20, 2025 · 4 comments · May be fixed by #41966

Comments

@tureck1y
Copy link

Impacted plugin

Jetpack

Quick summary

action-required-review will never satisfy requirements if @someuser is an author of a PR and requirements are configured like this:

  teams:
    - all-of:
      - some-team
      - '@someUser'

It's impossible to make a self-review and impossible to merge the PR. An empty team should be excluded from the requirements check. An empty virtual team for @someuser in this case/

Steps to reproduce

  1. Configure requirements
- name: Misc
  paths: unmatched
  teams:
    - all-of:
      - some-team
      - '@someUser'
  1. Open a PR by @someuser as an author
  2. Get approval from any user of "some-team"

Result: Requirement "Misc" is not satisfied by the existing reviews.

Expected result: Requirement "Misc" is satisfied by the existing reviews.

Site owner impact

Fewer than 20% of the total website/platform users

Severity

Major

What other impact(s) does this issue have?

No response

If a workaround is available, please outline it here.

No response

Platform (Simple and/or Atomic)

No response

@tureck1y tureck1y added [Type] Bug When a feature is broken and / or not performing as intended Needs triage Ticket needs to be triaged labels Feb 20, 2025
@github-actions github-actions bot added [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Pri] Normal [Feature Group] Content Management Features related to the tools and screens that admins use to manage their sites core content. [Feature] Jetpack CLI [Feature] Performance History labels Feb 20, 2025
Copy link
Contributor

OpenAI suggested the following labels for this issue:

  • [Feature Group] Content Management: The issue pertains to how content requirements are managed within the Jetpack plugin.
  • [Feature] Jetpack CLI: This feature may relate to the command line interface used for managing plugin configurations and settings.
  • [Feature] Performance History: The problem ties into performance metrics, as it affects the review and approval process of pull requests.

@jeherve jeherve added [Action] Required Review Triaged and removed [Feature] Jetpack CLI [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ Needs triage Ticket needs to be triaged [Feature Group] Content Management Features related to the tools and screens that admins use to manage their sites core content. [Feature] Performance History labels Feb 21, 2025
@jeherve jeherve moved this from Needs Triage to Triaged in Automattic Prioritization: The One Board ™ Feb 21, 2025
@anomiex
Copy link
Contributor

anomiex commented Feb 21, 2025

I'm hesitant to consider this a bug. Ideally your organization shouldn't have a single point of failure in @someuser being personally required to approve everything.

If we do decide to do something about this, I'd prefer adding a condition (name TBD), which for everything under it effectively considers the author as having self-reviewed. That way you would do like

    - all-of:
      - some-team
      - new-condition-name-TBD:
        - '@someUser'

to allow @someUser to auto-"self-review".

Or possibly we could do is-author to more specifically check, like

    - all-of:
      - some-team
      - any-of:
        - '@someUser'
        - is-author:
          - '@someUser'

@tureck1y
Copy link
Author

Thanks for the quick reply.

In general, it is a common situation when one user is a codeowner of some part of the repository and he can make a pull-request to this part.

And now we have a situation that it will be impossible to merge such PR.

An author is excluded from the team at the review request stage. In my opinion, the same thing should be done here.
And if the team becomes empty, there is no point in awaiting a review from an empty team, this condition will never be fulfilled.

anomiex added a commit that referenced this issue Feb 21, 2025
Sometimes people want to allow someone (or some team) to "self-review"
code. GitHub doesn't support self-reviews directly, but we can assume
that the author has reviewed their own PR in the writing of it.

Also, this is well past needing some automated testing. Add some for the
file being touched here.

Fixes #41933
@anomiex anomiex linked a pull request Feb 21, 2025 that will close this issue
3 tasks
@anomiex
Copy link
Contributor

anomiex commented Feb 21, 2025

Or possibly we could do is-author to more specifically check

Decided against this once I realized that you could wind up with a config that only allowed PRs with a particular author, and then the "request review" feature would have nothing to request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

4 participants