diff --git a/docs/community-automations.md b/docs/community-automations.md index 2737448..f0c8f0e 100644 --- a/docs/community-automations.md +++ b/docs/community-automations.md @@ -5,17 +5,17 @@ Manages GitHub issue comments. Sends Slack notifications and GitHub bot replies. | Contributor type | Issue type | Comment type | #support-dev | #support-dev-notifications | GitHub bot | GitHub bot message | |------------------|------------|--------------|--------------|---------------------------|------------|-------------------| | **Core team** | Any | Any | No | No | No | - | -| **Close contributor** | Any | regular, [assign keyword](https://github.com/learningequality/.github/blob/main/scripts/constants.js#L44) | **Yes** | No | No | - | -| **Issue creator** | `help-wanted` | regular, [assign keyword](https://github.com/learningequality/.github/blob/main/scripts/constants.js#L44) | **Yes** | No | No | - | -| **Issue creator** | Private | regular, [assign keyword](https://github.com/learningequality/.github/blob/main/scripts/constants.js#L44) | No | Yes | No | - | +| **Close contributor** | Any | regular, [assign keyword][assign-keywords] | **Yes** | No | No | - | +| **Issue creator** | `help-wanted` | regular, [assign keyword][assign-keywords] | **Yes** | No | No | - | +| **Issue creator** | Private | regular, [assign keyword][assign-keywords] | No | Yes | No | - | | **Other** | Private | regular | No | Yes | No | - | -| **Other** | Private | [assign keyword](https://github.com/learningequality/.github/blob/main/scripts/constants.js#L44) | No | Yes | Yes`*` | `BOT_MESSAGE_ISSUE_NOT_OPEN` | -| **Other** | Unassigned `help-wanted` (not good first issue) | regular, [assign keyword](https://github.com/learningequality/.github/blob/main/scripts/constants.js#L44) | **Yes** | No | No | - | +| **Other** | Private | [assign keyword][assign-keywords] | No | Yes | Yes`*` | `BOT_MESSAGE_ISSUE_NOT_OPEN` | +| **Other** | Unassigned `help-wanted` (not good first issue) | regular, [assign keyword][assign-keywords] | **Yes** | No | No | - | | **Other** | Unassigned `help-wanted` + good first issue | regular | **Yes** | No | No | - | -| **Other** | Unassigned `help-wanted` + good first issue | [assign keyword](https://github.com/learningequality/.github/blob/main/scripts/constants.js#L44) | **Yes** | No | Yes`*` | `BOT_MESSAGE_KEYWORD_GOOD_FIRST_ISSUE` | -| **Other** | `help-wanted` assigned to commenter | regular, [assign keyword](https://github.com/learningequality/.github/blob/main/scripts/constants.js#L44) | **Yes** | No | No | - | +| **Other** | Unassigned `help-wanted` + good first issue | [assign keyword][assign-keywords] | **Yes** | No | Yes`*` | `BOT_MESSAGE_KEYWORD_GOOD_FIRST_ISSUE` | +| **Other** | `help-wanted` assigned to commenter | regular, [assign keyword][assign-keywords] | **Yes** | No | No | - | | **Other** | `help-wanted` assigned to someone else | regular | No | Yes | No | - | -| **Other** | `help-wanted` assigned to someone else | [assign keyword](https://github.com/learningequality/.github/blob/main/scripts/constants.js#L44) | No | Yes | Yes`*` | `BOT_MESSAGE_ALREADY_ASSIGNED` | +| **Other** | `help-wanted` assigned to someone else | [assign keyword][assign-keywords] | No | Yes | Yes`*` | `BOT_MESSAGE_ALREADY_ASSIGNED` | | **Close contributor** | Private | `/assign` command | No | Yes | Yes | `BOT_MESSAGE_ISSUE_NOT_OPEN` | | **Close contributor** | `help-wanted` assigned to commenter | `/assign` command | No | No | No | - (silent no-op) | | **Close contributor** | `help-wanted` assigned to someone else | `/assign` command | No | Yes | Yes | `BOT_MESSAGE_ALREADY_ASSIGNED` | @@ -48,6 +48,8 @@ In `scripts/constants.js` set: - `BOT_MESSAGE_ASSIGN_NOT_GOOD_FIRST_ISSUE`: Decline message for non-good-first-issue issues - `BOT_MESSAGE_KEYWORD_GOOD_FIRST_ISSUE`: Keyword reply with `/assign` guidance +[assign-keywords]: https://github.com/learningequality/.github/blob/main/scripts/constants.js#L51 + # `good-first-issue-comment` Posts a guidance comment when the `good first issue` or `help wanted` label is applied to an issue. Explains the `/assign` command, issue limits, cooldown, and links to contributing guidelines. diff --git a/scripts/constants.js b/scripts/constants.js index b77e167..3401ee5 100644 --- a/scripts/constants.js +++ b/scripts/constants.js @@ -11,7 +11,12 @@ const BOT_USERNAMES = [ RTIBBLESBOT_USERNAME, ]; -const MAINTAINER_TEAMS = ['le-admins-team', 'read-only-coding-agents', 'triaging-coding-agents']; +const MAINTAINER_TEAMS = [ + 'le-admins-team', + 'read-only-coding-agents', + 'triaging-coding-agents', + 'learning-equality-code-reviewers', +]; // close contributors are treated a bit special in some workflows, // for example, we receive a high priority notification about their diff --git a/scripts/is-contributor.test.js b/scripts/is-contributor.test.js index 732d58e..bb0f786 100644 --- a/scripts/is-contributor.test.js +++ b/scripts/is-contributor.test.js @@ -110,6 +110,16 @@ test('an org member outside the maintainer teams is a contributor', async () => assert.equal(core.outputs.is_contributor, true); }); +test('a code reviewer is not a contributor whatever the event reports', async () => { + for (const association of ['MEMBER', 'CONTRIBUTOR', 'NONE']) { + const core = await run('reviewer', association, { + teams: { 'learning-equality-code-reviewers': ['reviewer'] }, + }); + + assert.equal(core.outputs.is_contributor, false, association); + } +}); + test('a failed membership check fails rather than guessing', async () => { const github = { rest: {