From fb73b2d5f4d106f53ba519d87af6cdb8422ef29c Mon Sep 17 00:00:00 2001 From: Chi-Hsuan Huang Date: Thu, 23 Jul 2026 22:29:33 +0800 Subject: [PATCH 1/2] HDDS-15378. Add component labels for PRs based on changed files --- .github/labeler.yml | 95 +++++++++++++++++++++++++ .github/workflows/label-pr.yml | 32 ++++++++- .github/workflows/schedule-label-pr.yml | 5 +- 3 files changed, 129 insertions(+), 3 deletions(-) create mode 100644 .github/labeler.yml diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 000000000000..9e06290e1ce6 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,95 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Configuration for the component-labeler job in label-pr.yml. +# Labels listed here are automation-owned: they are added and removed +# based on the files changed in the pull request (sync-labels). + +scm: + - changed-files: + - any-glob-to-any-file: + - 'hadoop-hdds/server-scm/**' + +om: + - changed-files: + - any-glob-to-any-file: + - 'hadoop-ozone/ozone-manager/**' + - 'hadoop-ozone/interface-storage/**' + +datanode: + - changed-files: + - any-glob-to-any-file: + - 'hadoop-hdds/container-service/**' + - 'hadoop-ozone/datanode/**' + +recon: + - changed-files: + - any-glob-to-any-file: + - 'hadoop-ozone/recon/**' + - 'hadoop-ozone/recon-codegen/**' + - 'hadoop-ozone/integration-test-recon/**' + +s3: + - changed-files: + - any-glob-to-any-file: + - 'hadoop-ozone/s3gateway/**' + - 'hadoop-ozone/s3-secret-store/**' + - 'hadoop-ozone/integration-test-s3/**' + +client: + - changed-files: + - any-glob-to-any-file: + - 'hadoop-hdds/client/**' + - 'hadoop-ozone/client/**' + +ofs: + - changed-files: + - any-glob-to-any-file: + - 'hadoop-ozone/ozonefs*/**' + +EC: + - changed-files: + - any-glob-to-any-file: + - 'hadoop-hdds/erasurecode/**' + +command-line: + - changed-files: + - any-glob-to-any-file: + - 'hadoop-hdds/cli-common/**' + - 'hadoop-ozone/cli-*/**' + +tools: + - changed-files: + - any-glob-to-any-file: + - 'hadoop-ozone/tools/**' + +documentation: + - changed-files: + - any-glob-to-any-file: + - 'hadoop-hdds/docs/**' + - '**/*.md' + +UI: + - changed-files: + - any-glob-to-any-file: + - 'hadoop-ozone/recon/src/main/resources/webapps/recon/**' + +CI: + - changed-files: + - any-glob-to-any-file: + - '.github/**' + - 'dev-support/ci/**' + - 'hadoop-hdds/dev-support/**' + - 'hadoop-ozone/dev-support/checks/**' diff --git a/.github/workflows/label-pr.yml b/.github/workflows/label-pr.yml index b5b71d718368..db9075a497d1 100644 --- a/.github/workflows/label-pr.yml +++ b/.github/workflows/label-pr.yml @@ -13,7 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -# This workflow applies labels for PRs targeted at feature branches. +# This workflow applies labels for PRs: branch labels for PRs targeted at +# feature branches, and component labels based on the files changed +# (rules in .github/labeler.yml). name: label-pull-requests @@ -51,3 +53,31 @@ jobs: BRANCH: ${{ matrix.branch }} LABEL: ${{ matrix.label }} GH_TOKEN: ${{ github.token }} + + component-labeler: + permissions: + contents: read + pull-requests: write + runs-on: ubuntu-slim + steps: + - name: "Checkout project" # provides .github/labeler.yml for the labeler action + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false + sparse-checkout: | + .github + - name: "List open PRs" + id: prs + run: | + { + echo 'numbers<> "$GITHUB_OUTPUT" + env: + GH_TOKEN: ${{ github.token }} + - name: "Apply component labels" + uses: actions/labeler@b8dd2d9be0f68b860e7dae5dae7d772984eacd6d # v6.2.0 + with: + pr-number: ${{ steps.prs.outputs.numbers }} + sync-labels: true diff --git a/.github/workflows/schedule-label-pr.yml b/.github/workflows/schedule-label-pr.yml index 21b099230f09..4c33da996fc1 100644 --- a/.github/workflows/schedule-label-pr.yml +++ b/.github/workflows/schedule-label-pr.yml @@ -18,9 +18,10 @@ name: scheduled-label-pull-requests on: - # every 5 minutes + # every 30 minutes; component labeling scans all open PRs, so keep the + # cadence moderate schedule: - - cron: '*/5 * * * *' + - cron: '*/30 * * * *' permissions: contents: read From 53cce0c9dac94882742ec954bd40ea436b69c104 Mon Sep 17 00:00:00 2001 From: "Doroszlai, Attila" <6454655+adoroszlai@users.noreply.github.com> Date: Sat, 25 Jul 2026 17:36:04 +0200 Subject: [PATCH 2/2] HDDS-15972. Bump actions/checkout to 7.0.1 --- .github/workflows/label-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/label-pr.yml b/.github/workflows/label-pr.yml index db9075a497d1..3000631bea80 100644 --- a/.github/workflows/label-pr.yml +++ b/.github/workflows/label-pr.yml @@ -61,7 +61,7 @@ jobs: runs-on: ubuntu-slim steps: - name: "Checkout project" # provides .github/labeler.yml for the labeler action - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false sparse-checkout: |