diff --git a/apps/docs/automations.mdx b/apps/docs/automations.mdx index 711775471..fa9f14540 100644 --- a/apps/docs/automations.mdx +++ b/apps/docs/automations.mdx @@ -36,10 +36,9 @@ These automations react to pull requests and repository state. | **Resolve PR Conflicts** | Looks for merge conflicts and helps fix them on open PRs | Keep long-running branches from getting stuck | For **Review Code**, decide whether Roomote should review new commits -automatically, whether automatic reviews stay limited to PRs created by Roomote -or cover PRs from everyone, and whether draft pull requests should be included. -If your team treats drafts as active collaboration, include them. If drafts are -noisy or half-formed, keep them out until they are ready. +automatically and whether draft pull requests should be included. If your team +treats drafts as active collaboration, include them. If drafts are noisy or +half-formed, keep them out until they are ready. For **Resolve PR Conflicts**, pick a schedule, PR age cap, and label. The label is the team-controlled opt-in for scheduled scans. Make sure the label diff --git a/apps/web/src/components/settings/automations/AutomationsSettings.render.client.test.tsx b/apps/web/src/components/settings/automations/AutomationsSettings.render.client.test.tsx index 0b1044d1f..1d279b3f7 100644 --- a/apps/web/src/components/settings/automations/AutomationsSettings.render.client.test.tsx +++ b/apps/web/src/components/settings/automations/AutomationsSettings.render.client.test.tsx @@ -598,76 +598,16 @@ describe('AutomationsSettings', () => { await openReviewerCard(); expect( - screen.getByRole('radio', { name: /prs from everyone/i }), + screen.getByRole('switch', { name: /review prs from other authors/i }), ).toBeChecked(); - expect( - screen.getByRole('radio', { name: /only prs created by roomote/i }), - ).not.toBeChecked(); expect( screen.getByText(/all pull requests in connected repositories/), ).toBeInTheDocument(); expect( - screen.queryByText( - /When background auto-review is on, reviews run on pull requests opened by Roomote/, - ), - ).not.toBeInTheDocument(); - }); - - it('defaults automatic review scope to only Roomote-created PRs', async () => { - state.settingsQuery.data.reviewer.enabled = true; - state.settingsQuery.data.reviewer.reviewAllPullRequestAuthors = false; - state.settingsQuery.data.settings.reviewer.reviewAllPullRequestAuthors = false; - - render(); - await openReviewerCard(); - - expect( - screen.getByRole('radio', { name: /only prs created by roomote/i }), - ).toBeChecked(); - expect( - screen.getByRole('radio', { name: /prs from everyone/i }), - ).not.toBeChecked(); - expect( - screen.getByText( - /When background auto-review is on, reviews run on pull requests opened by Roomote/, - ), - ).toBeInTheDocument(); - expect( - screen.queryByText(/all pull requests in connected repositories/), + screen.queryByText(/pull requests opened by Roomote/), ).not.toBeInTheDocument(); }); - it('updates review scope copy when switching automatic review authors', async () => { - state.settingsQuery.data.reviewer.enabled = true; - state.settingsQuery.data.reviewer.reviewAllPullRequestAuthors = false; - state.settingsQuery.data.settings.reviewer.reviewAllPullRequestAuthors = false; - - render(); - await openReviewerCard(); - - fireEvent.click(screen.getByRole('radio', { name: /prs from everyone/i })); - - expect( - screen.getByRole('radio', { name: /prs from everyone/i }), - ).toBeChecked(); - expect( - await screen.findByText(/all pull requests in connected repositories/), - ).toBeInTheDocument(); - - fireEvent.click( - screen.getByRole('radio', { name: /only prs created by roomote/i }), - ); - - expect( - screen.getByRole('radio', { name: /only prs created by roomote/i }), - ).toBeChecked(); - expect( - await screen.findByText( - /When background auto-review is on, reviews run on pull requests opened by Roomote/, - ), - ).toBeInTheDocument(); - }); - it('keeps the legacy suggester textarea when grouped routing is disabled', async () => { state.settingsQuery.data.settings.suggesterFrequency = 'daily' as never; diff --git a/apps/web/src/components/settings/automations/AutomationsSettings.tsx b/apps/web/src/components/settings/automations/AutomationsSettings.tsx index c29deeaf4..bafce8f86 100644 --- a/apps/web/src/components/settings/automations/AutomationsSettings.tsx +++ b/apps/web/src/components/settings/automations/AutomationsSettings.tsx @@ -3905,79 +3905,33 @@ If unclear, send to manager channel.`} -
-
-

- Which PRs get automatic reviews? -

-

- Choose whether automatic reviews stay limited to PRs - created by {PRODUCT_NAME}, or include PRs from - everyone. -

-
- +
+ setFormState((prev) => prev ? { ...prev, - reviewerReviewAllPullRequestAuthors: - value === 'all_authors', + reviewerReviewAllPullRequestAuthors, } : prev, ) } - className="space-y-3" - > -
- -
- -

- Automatic reviews stay limited to pull requests - opened by {PRODUCT_NAME}. -

-
-
-
- -
- -

- Include pull requests opened by people or bots - outside {PRODUCT_NAME}. -

-
-
- + /> +
+

+ Review PRs from other authors +

+

+ Include pull requests opened by people or bots outside + {` ${PRODUCT_NAME}`} in automatic reviews. +

+