Skip to content

Replace usage of Dependabot's reviewers with CODEOWNERS #134

@yeikel

Description

@yeikel

What problem are you trying to solve?

The reviewers field in the dependabot.yml file will be removed soon. For more information, see this blog post.

The recommended replacement is to use a CODEOWNERS file

What precondition(s) should be checked before applying this recipe?

The project is using the reviewers feature in the dependabot.yml file

Describe the situation before applying the recipe

version: 2
updates:

- package-ecosystem: gradle
  directory: "/"
  schedule:
    interval: weekly
    time: "10:00"
    timezone: Europe/London
  reviewers:
    - "kafbat/backend"
  open-pull-requests-limit: 10
  labels:
    - "type/dependencies"
    - "scope/backend"
  groups:
    gradle-dependencies:
      patterns:
        - "*"
      update-types:
        - "patch"
        - "minor"

- package-ecosystem: docker
  directory: "/api"
  schedule:
    interval: weekly
    time: "10:00"
    timezone: Europe/London
  reviewers:
    - "kafbat/backend"
  open-pull-requests-limit: 10
  ignore:
  - dependency-name: "azul/zulu-openjdk-alpine"
    update-types: ["version-update:semver-major"]
  labels:
    - "type/dependencies"
    - "scope/backend"

- package-ecosystem: npm
  directory: "/frontend"
  schedule:
    interval: weekly
    time: "10:00"
    timezone: Europe/London
  reviewers:
    - "kafbat/frontend"
  open-pull-requests-limit: 10
  versioning-strategy: increase-if-necessary
  labels:
    - "type/dependencies"
    - "scope/frontend"
  groups:
    pnpm-dependencies:
      patterns:
        - "*"
      update-types:
        - "patch"
        - "minor"

- package-ecosystem: "github-actions"
  directory: "/"
  schedule:
    interval: weekly
    time: "10:00"
    timezone: Europe/London
  reviewers:
    - "kafbat/devops"
  open-pull-requests-limit: 10
  labels:
    - "type/dependencies"
    - "scope/infra"

Describe the situation after applying the recipe

---
 .github/dependabot.yml | 8 --------
 CODEOWNERS             | 4 ++++
 2 files changed, 4 insertions(+), 8 deletions(-)
 create mode 100644 CODEOWNERS

diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index 22132c9d5..009421455 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -7,8 +7,6 @@ updates:
     interval: weekly
     time: "10:00"
     timezone: Europe/London
-  reviewers:
-    - "kafbat/backend"
   open-pull-requests-limit: 10
   labels:
     - "type/dependencies"
@@ -27,8 +25,6 @@ updates:
     interval: weekly
     time: "10:00"
     timezone: Europe/London
-  reviewers:
-    - "kafbat/backend"
   open-pull-requests-limit: 10
   ignore:
   - dependency-name: "azul/zulu-openjdk-alpine"
@@ -43,8 +39,6 @@ updates:
     interval: weekly
     time: "10:00"
     timezone: Europe/London
-  reviewers:
-    - "kafbat/frontend"
   open-pull-requests-limit: 10
   versioning-strategy: increase-if-necessary
   labels:
@@ -64,8 +58,6 @@ updates:
     interval: weekly
     time: "10:00"
     timezone: Europe/London
-  reviewers:
-    - "kafbat/devops"
   open-pull-requests-limit: 10
   labels:
     - "type/dependencies"
diff --git a/CODEOWNERS b/CODEOWNERS
new file mode 100644
index 000000000..acbfe29c4
--- /dev/null
+++ b/CODEOWNERS
@@ -0,0 +1,4 @@
+gradle/libs.versions.toml kafbat/backend
+api/* kafbat/backend
+frontend/* kafbat/frontend
+.github/workflows/* kafbat/devops

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    Recipes Wanted

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions