This is an automated email from the ASF dual-hosted git repository.
ivandika3 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git
The following commit(s) were added to refs/heads/master by this push:
new 23aeb7b6080 HDDS-15378. Add component labels for PRs based on changed
files (#10851)
23aeb7b6080 is described below
commit 23aeb7b608096a0afbdbb82c182f3abab7ffe56c
Author: Chi-Hsuan Huang <[email protected]>
AuthorDate: Wed Sep 23 10:29:50 2026 +0800
HDDS-15378. Add component labels for PRs based on changed files (#10851)
Co-authored-by: Doroszlai, Attila
<[email protected]>
---
.github/labeler.yml | 90 +++++++++++++++++++++++++++++++++
.github/workflows/label-pr.yml | 39 +++++++++++++-
.github/workflows/schedule-label-pr.yml | 5 +-
3 files changed, 131 insertions(+), 3 deletions(-)
diff --git a/.github/labeler.yml b/.github/labeler.yml
new file mode 100644
index 00000000000..a22ad428b01
--- /dev/null
+++ b/.github/labeler.yml
@@ -0,0 +1,90 @@
+# 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 added based on the files changed in the pull request.
+# They are never removed, so labels applied manually are left alone.
+
+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*/**'
+
+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 2792a5ae38f..a4585421980 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
@@ -22,6 +24,11 @@ on:
# allow running the workflow manually from GitHub UI
workflow_dispatch:
+# component-labeler scans every open PR, so a slow run must not overlap the
next one
+concurrency:
+ group: label-pull-requests
+ cancel-in-progress: false
+
jobs:
labeler:
permissions:
@@ -51,3 +58,33 @@ 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@3d3c42e5aac5ba805825da76410c181273ba90b1 #
v7.0.1
+ with:
+ persist-credentials: false
+ sparse-checkout: |
+ .github
+ - name: "List open PRs"
+ id: prs
+ run: |
+ {
+ echo 'numbers<<EOF'
+ gh pr list --repo "$GITHUB_REPOSITORY" --state open --limit 1000
--json number --jq '.[].number'
+ echo 'EOF'
+ } >> "$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 }}
+ # add only: path rules cannot express why a label was applied
manually,
+ # so removing labels here would override human judgement
+ sync-labels: false
diff --git a/.github/workflows/schedule-label-pr.yml
b/.github/workflows/schedule-label-pr.yml
index 00e516d5685..012c49ac0be 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
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]