Browse Source

chore: Use codeowners instead of workflow to assign reviewers

The workflow does not work as it needs a PAT or GitHub App token.
So this will add the teams as code owners to assign people.

By default backend is assigned, but if something below matches it
overwrites the backend assignment, so frontend code will only be
assigned to the frontend team.

Also ensure that for everything there are at least two reviewers.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
pull/51147/head
Ferdinand Thiessen 10 months ago
parent
commit
96a96aae0d
No known key found for this signature in database GPG Key ID: 45FAE7268762B400
  1. 57
      .github/CODEOWNERS
  2. 78
      .github/workflows/request-reviews.yml

57
.github/CODEOWNERS

@ -1,3 +1,20 @@
# Fallback owners for code review - ensure all PRs have someone assigned for review.
# (the last match will used so this is only used if there is no more specific code owner below)
# Backend
# is the first and gets everything to make things easier from matching syntax
* @nextcloud/server-backend
# Frontend
# this will override the backend code owners if needed
/__mocks__ @nextcloud/server-frontend
/__tests__ @nextcloud/server-frontend
/cypress @nextcloud/server-frontend
**/js @nextcloud/server-frontend
**/src @nextcloud/server-frontend
*.js @nextcloud/server-frontend
*.ts @nextcloud/server-frontend
# App maintainers
/apps/admin_audit/appinfo/info.xml @luka-nextcloud @blizzz
/apps/cloud_federation_api/appinfo/info.xml @mejo-
@ -34,14 +51,14 @@
/apps/workflowengine/appinfo/info.xml @blizzz @juliusknorr
# Frontend expertise
/apps/files/src* @skjnldsv
/apps/files_external/src* @skjnldsv
/apps/files_reminders/src* @skjnldsv
/apps/files_sharing/src/actions* @skjnldsv
/apps/files_trashbin/src* @skjnldsv
/apps/files/src* @skjnldsv @nextcloud/server-frontend
/apps/files_external/src* @skjnldsv @nextcloud/server-frontend
/apps/files_reminders/src* @skjnldsv @nextcloud/server-frontend
/apps/files_sharing/src/actions* @skjnldsv @nextcloud/server-frontend
/apps/files_trashbin/src* @skjnldsv @nextcloud/server-frontend
# Security team
/build/psalm-baseline-security.xml @nickvergessen
/build/psalm-baseline-security.xml @nickvergessen @nextcloud/server-backend
/resources/codesigning @mgallien @miaulalala @nickvergessen
/resources/config/ca-bundle.crt @miaulalala @nickvergessen
@ -53,28 +70,26 @@
# Limit login to IP
# Watch login routes for https://github.com/nextcloud/limit_login_to_ip
/core/routes.php @Altahrim
/core/routes.php @Altahrim @nextcloud/server-backend
# OpenAPI
openapi*.json @provokateurin
ResponseDefinitions.php @provokateurin
openapi*.json @provokateurin
ResponseDefinitions.php @provokateurin
# Talk team
/lib/private/Comments @nickvergessen
/lib/private/Federation @nickvergessen
/lib/private/Talk @nickvergessen
/lib/public/Comments @nickvergessen
/lib/public/Federation @nickvergessen
/lib/public/OCM @nickvergessen
/lib/public/Talk @nickvergessen
/lib/public/UserStatus @nickvergessen
/lib/private/Comments @nickvergessen @nextcloud/server-backend
/lib/private/Federation @nickvergessen @nextcloud/server-backend
/lib/private/Talk @nickvergessen @nextcloud/server-backend
/lib/public/Comments @nickvergessen @nextcloud/server-backend
/lib/public/Federation @nickvergessen @nextcloud/server-backend
/lib/public/OCM @nickvergessen @nextcloud/server-backend
/lib/public/Talk @nickvergessen @nextcloud/server-backend
/lib/public/UserStatus @nickvergessen @nextcloud/server-backend
# Groupware
/build/integration/dav_features/caldav.feature @st3iny @SebastianKrupinski
/build/integration/dav_features/carddav.feature @st3iny @SebastianKrupinski
# Personal interest
*/Activity/* @nickvergessen
*/Notifications/* @nickvergessen
/lib/private/Profiler @CarlSchwan
/lib/public/Profiler @CarlSchwan
*/Activity/* @nickvergessen @nextcloud/server-backend
*/Notifications/* @nickvergessen @nextcloud/server-backend

78
.github/workflows/request-reviews.yml

@ -1,78 +0,0 @@
# SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: MIT
name: Assign reviews
on:
pull_request:
types: [opened, reopened, ready_for_review]
permissions:
contents: read
jobs:
changes:
runs-on: ubuntu-latest-low
outputs:
backend: ${{ steps.changes.outputs.backend }}
frontend: ${{ steps.changes.outputs.frontend }}
steps:
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: changes
continue-on-error: true
with:
filters: |
backend:
- '3rdparty/**'
- '**/appinfo/**'
- '**/lib/**'
- '**/templates/**'
- '.php-cs-fixer.dist.php'
- 'composer.json'
- 'psalm*'
- 'build/psalm*'
- '**.php'
frontend:
- 'apps/*/src/**'
- 'core/src/**'
- 'tsconfig.json'
- '**.js'
- '**.ts'
- '**.vue'
assign-reviews:
name: Assign reviews
runs-on: ubuntu-latest-low
needs: changes
# Only if there are not already reviews requested
if: github.event.pull_request.requested_reviewers[1] == null
permissions:
pull-requests: write
steps:
- name: Assign backend engineers
if: needs.changes.outputs.backend == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
'/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/requested_reviewers' \
-f "team_reviewers[]=server-backend"
- name: Assign frontend engineers
if: needs.changes.outputs.frontend == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
'/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/requested_reviewers' \
-f "team_reviewers[]=server-frontend"
Loading…
Cancel
Save