Skip to content

feat: allow specific OWNERS reviewers to be excluded from auto-review-request while still counting toward lgtm #1218

Open

Description

@RoniKishner

Feature Request

(Not a bug — current behavior is working as designed, this is a request for a
new opt-out capability.)

Problem

Every entry in an OWNERS file's reviewers: list is treated identically by
OwnersFileHandler:

  • Auto-requested as a GitHub PR reviewer via create_review_request() on every
    PR whose changed files match that OWNERS file's scope
    (assign_reviewers() in owners_files_handler.py)
  • Eligible to have their /lgtm (or native GitHub "Approve" review) count
    toward minimum-lgtm for that same scope (_check_if_pr_approved() in
    pull_request_handler.py)

Both behaviors are driven by the same aggregated list
(all_pull_request_reviewers / root_reviewers), so there is no way to keep
one without the other.

For maintainers listed as reviewers in a repo-root OWNERS file, this means
being auto-added as a requested reviewer on every PR in the repo, with no
way to opt out without also losing the ability to /lgtm PRs repo-wide.

Request

Add a way, configurable per reviewer name (not a blanket per-file toggle),
to exclude a specific person from auto-review-request while keeping their
/lgtm eligible to count toward minimum-lgtm for that OWNERS file's scope.

Desired behavior for an opted-out name at the root OWNERS level:

  • ✅ Can /lgtm (or GitHub "Approve") any PR in the repo, and it counts toward
    minimum-lgtm, same as today
  • ❌ Not included in create_review_request() when only root scope applies
  • ✅ (if possible) Still auto-assigned as a requested reviewer when a
    more specific, smaller-scope OWNERS file (e.g. a subdirectory) lists
    the same name without the opt-out flag — i.e. the opt-out should only
    suppress auto-assignment at the level(s) where it's actually set, not
    globally across every OWNERS file that happens to include that name.

Proposed syntax (name-specific, not file-wide)

# root OWNERS
approvers:
  - alice
reviewers:
  - alice
  - bob
  - name: carol
    auto-assign: false   # carol: lgtm counts, but not auto-requested at this scope
# subdir/OWNERS (no opt-out here — carol still gets auto-requested for this scope)
reviewers:
  - carol

Alternative, simpler-to-implement syntax if per-entry objects are undesirable:

reviewers:
  - alice
  - bob
no-auto-assign-reviewers:   # subset of `reviewers`, name-specific opt-out
  - carol

Either way, carol remains in all_pull_request_reviewers (lgtm-counting) for
this file's scope, but is excluded from the create_review_request() call in
assign_reviewers().

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions