Browse Source

Add CODEOWNERS for review assignment (#6153)

This disables the autoassign action so that the codeowners approach can
be tested without interference.

Trying this out because it might be a path for vacation handling. See
[GitHub
docs](https://docs.github.com/en/organizations/organizing-members-into-teams/managing-code-review-settings-for-your-team)
and
[#infra](https://discord.com/channels/655572317891461132/707150492370862090/1422985757311635620)

---------

Co-authored-by: Dana Jansens <danakj@orodu.net>
Jon Ross-Perkins 7 months ago
parent
commit
f27ccbf76e
4 changed files with 32 additions and 70 deletions
  1. 0 63
      .github/workflows/auto_assign_prs.yaml
  2. 24 0
      CODEOWNERS
  3. 5 5
      docs/project/code_review.md
  4. 3 2
      proposals/p1367.md

+ 0 - 63
.github/workflows/auto_assign_prs.yaml

@@ -1,63 +0,0 @@
-# Part of the Carbon Language project, under the Apache License v2.0 with LLVM
-# Exceptions. See /LICENSE for license information.
-# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-
-name: 'Auto assign PRs'
-on:
-  pull_request_target:
-    types: [opened, ready_for_review]
-
-permissions:
-  pull-requests: write # For gh to edit assignees.
-
-jobs:
-  assign_reviewer:
-    runs-on: ubuntu-latest
-    steps:
-      - name: Harden Runner
-        uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
-        with:
-          disable-sudo: true
-          egress-policy: block
-          # prettier-ignore
-          allowed-endpoints: >
-            api.github.com:443
-
-      - id: filter
-        uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
-        with:
-          filters: |
-            leads:
-              - '*.md'
-              - 'LICENSE'
-              - 'docs/project/principles/*'
-              - 'docs/project/evolution.md'
-              - 'docs/project/goals.md'
-              - 'docs/project/roadmap.md'
-              - 'proposals/*.md'
-            toolchain:
-              - 'toolchain/**'
-
-      - id: assign-leads
-        if: steps.filter.outputs.leads == 'true'
-        uses: hkusu/review-assign-action@5bee595fdb9765d4a0bd35724b6302fa15569158 # v1.4.0
-        with:
-          reviewers: KateGregory, chandlerc, zygoloid
-          max-num-of-reviewers: 1
-
-      - id: assign-toolchain
-        if: steps.filter.outputs.toolchain == 'true'
-        uses: hkusu/review-assign-action@5bee595fdb9765d4a0bd35724b6302fa15569158 # v1.4.0
-        with:
-          reviewers:
-            chandlerc, danakj, dwblaikie, geoffromer, jonmeow, josh11b, zygoloid
-          max-num-of-reviewers: 1
-
-      - id: assign-fallback
-        if: |
-          steps.filter.outputs.leads != 'true' &&
-          steps.filter.outputs.toolchain != 'true'
-        uses: hkusu/review-assign-action@5bee595fdb9765d4a0bd35724b6302fa15569158 # v1.4.0
-        with:
-          reviewers: chandlerc, danakj, jonmeow, josh11b, zygoloid
-          max-num-of-reviewers: 1

+ 24 - 0
CODEOWNERS

@@ -0,0 +1,24 @@
+# Part of the Carbon Language project, under the Apache License v2.0 with LLVM
+# Exceptions. See /LICENSE for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+
+# This file is only used for PR autoassignment. Branch protections don't enforce
+# it.
+#
+# Syntax:
+# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners#codeowners-syntax
+
+# Toolchain reviewers are used as a fallback.
+*                          @carbon-language/toolchain-reviewers
+
+# Key project documents should be reviewed by leads.
+/*.md                      @carbon-language/leads
+/LICENSE                   @carbon-language/leads
+/docs/project/evolution.md @carbon-language/leads
+/docs/project/goals.md     @carbon-language/leads
+/docs/project/principles/* @carbon-language/leads
+/docs/project/roadmap.md   @carbon-language/leads
+/proposals/*.md            @carbon-language/leads
+
+# Toolchain code.
+/toolchain                 @carbon-language/toolchain-reviewers

+ 5 - 5
docs/project/code_review.md

@@ -86,11 +86,11 @@ In Carbon, developers will focus on particular areas, loosely broken down as:
     -   We split out auto-assignment by explorer, toolchain, and other files
     -   We split out auto-assignment by explorer, toolchain, and other files
         (including documentation).
         (including documentation).
 
 
-[Auto-assignment](/.github/workflows/auto_assign_prs.yaml) will help find
-owners, but won't always be perfect -- developers may take a PR they weren't
-auto-assigned in order to help review go quickly. Contributors can also request
-multiple reviewers, but it can be daunting to get feedback from a large number
-of reviewers, so we suggest keeping the number of reviewers reasonably small.
+[Auto-assignment](/CODEOWNERS) will help find owners, but won't always be
+perfect -- developers may take a PR they weren't auto-assigned in order to help
+review go quickly. Contributors can also request multiple reviewers, but it can
+be daunting to get feedback from a large number of reviewers, so we suggest
+keeping the number of reviewers reasonably small.
 
 
 Any reviews that explicitly request changes should be addressed, either with the
 Any reviews that explicitly request changes should be addressed, either with the
 changes or an explanation of why not, before a pull request is merged. Further,
 changes or an explanation of why not, before a pull request is merged. Further,

+ 3 - 2
proposals/p1367.md

@@ -110,8 +110,9 @@ group access controls are the last word on who can commit PRs.
 
 
 ### Auto-assignment
 ### Auto-assignment
 
 
-This PR [introduces auto-assignment](/.github/workflows/auto_assign_prs.yaml) in
-order to ensure PRs aren't lost. It provides categories of assignment, and a
+This PR
+[introduces auto-assignment](https://github.com/carbon-language/carbon-lang/pull/1367/files#diff-5e5db53c34ec04ba9da95c70d5c797f1be9f390f7e2bf18ca3149cbd99c277df)
+in order to ensure PRs aren't lost. It provides categories of assignment, and a
 fallback for other PRs that don't have explicit assignment.
 fallback for other PRs that don't have explicit assignment.
 
 
 ### Stacked PRs
 ### Stacked PRs