From f4473afccd94affdd1506cbf2a797af31d719110 Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Tue, 30 Jan 2024 09:26:34 -0800 Subject: [PATCH] feat: configuring an extensible PR auto-labeler (#26880) --- .github/labeler.yml | 20 +++++++++++++++++++ .github/workflows/label-migration-pr.yml | 25 ------------------------ .github/workflows/labeler.yml | 12 ++++++++++++ superset/migrations/env.py | 1 + 4 files changed, 33 insertions(+), 25 deletions(-) create mode 100644 .github/labeler.yml delete mode 100644 .github/workflows/label-migration-pr.yml create mode 100644 .github/workflows/labeler.yml diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 0000000000000..0557e4277a724 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,20 @@ +"risk:db-migration": +- changed-files: + - any-glob-to-any-file: + - 'superset/migrations/**' + +"dependencies:python": +- changed-files: + - any-glob-to-any-file: + - 'superset/requirements/**' + +"dependencies:npm": +- changed-files: + - any-glob-to-any-file: + - 'superset-frontend/package.json' + - 'superset-frontend/package-lock.json' + +"doc": +- changed-files: + - any-glob-to-any-file: + - 'docs/**' diff --git a/.github/workflows/label-migration-pr.yml b/.github/workflows/label-migration-pr.yml deleted file mode 100644 index e0b46e163cf24..0000000000000 --- a/.github/workflows/label-migration-pr.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Label Migration PR - -on: - pull_request: - paths: - - 'superset/migrations/**' - -jobs: - label: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Add label - uses: actions/github-script@v3 - with: - github-token: ${{github.token}} - script: | - github.issues.addLabels({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - labels: ['risk:db-migration'] - }) diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml new file mode 100644 index 0000000000000..9b8195b51a7e8 --- /dev/null +++ b/.github/workflows/labeler.yml @@ -0,0 +1,12 @@ +name: "Pull Request Labeler" +on: +- pull_request + +jobs: + labeler: + permissions: + contents: read + pull-requests: write + runs-on: ubuntu-latest + steps: + - uses: actions/labeler@v5 diff --git a/superset/migrations/env.py b/superset/migrations/env.py index 130fb367fb6f6..ab9dea78554a8 100755 --- a/superset/migrations/env.py +++ b/superset/migrations/env.py @@ -14,6 +14,7 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. + import logging import urllib.parse from logging.config import fileConfig