Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 95 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -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/**'
32 changes: 31 additions & 1 deletion .github/workflows/label-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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@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 }}
sync-labels: true
5 changes: 3 additions & 2 deletions .github/workflows/schedule-label-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down