From e49f6f7d3c1622cdbc72429ccc154791f21223b4 Mon Sep 17 00:00:00 2001 From: Jeremy Wiebe Date: Fri, 6 Dec 2024 17:28:15 -0800 Subject: [PATCH] Switch from Gerald to use native CODEOWNERS file (#1968) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary: I would like to start using Dependabot to help keep some deps up to date. We already have Dependabot configured to update two Khan Academy lint packages, but currently the Gerald check fails because it needs access to an org-wide secret (which it doesn't have access to). The good news is that this repo doesn't really use Gerald very much (only two rules). These rules are easily re-created with the [`CODEOWNERS`](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners#example-of-a-codeowners-file) file instead. Issue: "none" ## Test plan: We'll need to land this PR and watch the next few PRs and see if it tags the team correctly. The failure mode is just that we won't be tagged as a team. Author: jeremywiebe Reviewers: SonicScrewdriver Required Reviewers: Approved By: SonicScrewdriver Checks: ✅ Publish npm snapshot (ubuntu-latest, 20.x), ✅ Cypress (ubuntu-latest, 20.x), ✅ Lint, Typecheck, Format, and Test (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ Publish Storybook to Chromatic (ubuntu-latest, 20.x), ✅ Check builds for changes in size (ubuntu-latest, 20.x) Pull Request URL: https://github.com/Khan/perseus/pull/1968 --- .github/CODEOWNERS | 5 +++ .github/REVIEWERS | 55 --------------------------------- .github/workflows/gerald-pr.yml | 13 -------- 3 files changed, 5 insertions(+), 68 deletions(-) create mode 100644 .github/CODEOWNERS delete mode 100644 .github/REVIEWERS delete mode 100644 .github/workflows/gerald-pr.yml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000000..dc289313c7 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,5 @@ +# Khan/perseus is tagged for all PRs +@Khan/perseus + +# AI Utils are owned by Tutor Platform +widget-ai-utils/* @Khan/tut diff --git a/.github/REVIEWERS b/.github/REVIEWERS deleted file mode 100644 index 91068019d2..0000000000 --- a/.github/REVIEWERS +++ /dev/null @@ -1,55 +0,0 @@ -[ REVIEWER RULES] - -Be sure to read through https://khanacademy.atlassian.net/wiki/spaces/FRONTEND/pages/598278672/Gerald+Documentation before adding any rules! - -Examples: - -# This rule will request @owner1 for review on changes to all files. This rule will also request @owner2 for a blocking review. -# **/* @owner1 @owner2! - -# This rule will request @owner1 and @Org/team1 for review on changes to all .js files -# **/*.js @owner1 @Org/team1 - -# This rule will request @owner1 and @owner2 for review on changes to all files in the src/ directory. It will not match files in nested directories, such as src/about/about.js -# src/* @owner1 @owner2 - -# This rule will request @owner1 and @owner2 for review on changes to all files in the src/ directory, recursively. In contrast to the rule above, it WILL match src/about/about.js -# src/** @owner1 @owner2 - -# This rule will request @owner1 for review on changes to all files that have the word "gerald" in its name -# **/*gerald* @owner1 - -# The following rules will both request @owner1 for review on changes to any file that ends with .js, .txt, or .yml -# **/*.(js|txt|yml) @owner1 # This is in the style of Regex groups (https://www.regular-expressions.info/brackets.html) -# **/*.{js,txt,yml} @owner1 # This is in the style of Bash brace expansions (https://github.com/micromatch/braces) - -# This rule will request @owner1 for review on changes made to main.js or main.test.js. Read more about extended globbing: https://github.com/micromatch/micromatch#extglobs -# main?(.test).js @owner1 - -# This rule will request @owner1 for review on changes made to file-1, file-2, and file-3. -# file-[1-5] @owner1 # This is in the style of Regex character glasses (https://github.com/micromatch/micromatch#regex-character-classes) - -# This rule will request @owner1 for review on changes made to file-0, file-2, file-3, ..., file-9. -# file-[[:digit:]] @owner1 # This uses POSIX character classes (https://github.com/micromatch/picomatch#posix-brackets) - -Regex Examples: - -# This rule will request @owner1 for review on changes that include the word "gerald" -# "/gerald/ig" @owner1 - -# This rule will request @owner1 for review on changes that *add* the word "gerald" -# "/^\+.*gerald/igm" @owner1 - -# This rule will request @owner1 for review on changes that *remove* the word "gerald" -# "/^\-.*gerald/igm" @owner1 - -# This rule will request @owner1 for review on changes that *add OR remove* the word "gerald" -# "/^(\-|\+).*gerald/igm" @owner1 - -----Everything above this line will be ignored!---- -[ON PULL REQUEST] (DO NOT DELETE THIS LINE) - -**/* @Khan/perseus! - -# AI Utils are owned by Tutor Platform -widget-ai-utils/* @Khan/tut diff --git a/.github/workflows/gerald-pr.yml b/.github/workflows/gerald-pr.yml deleted file mode 100644 index fe157eaa35..0000000000 --- a/.github/workflows/gerald-pr.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: Gerald - Notify and Request Reviewers On Pull Request -"on": - pull_request: - types: [opened, synchronize, reopened, ready_for_review, edited] - -jobs: - gerald: - runs-on: ubuntu-latest - steps: - - uses: Khan/actions@gerald-pr-v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - admin-token: ${{ secrets.KHAN_ACTIONS_BOT_TOKEN }}