You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "chihsuan (via GitHub)" <gi...@apache.org> on 2026/07/23 15:37:44 UTC

[PR] HDDS-15378. Add component labels for PRs based on changed files [ozone]

chihsuan opened a new pull request, #10851:
URL: https://github.com/apache/ozone/pull/10851

   ## What changes were proposed in this pull request?
   
   **Problem.** Component labels are not applied consistently, so reviewers cannot reliably filter PRs by area such as SCM, OM, datanode, Recon, or S3.
   
   HDDS-10450 previously added `actions/labeler` using `pull_request_target`. HDDS-13777 removed it because the labeler-only green checkmark could be mistaken for completed CI.
   
   **Solution.** Extend the existing scheduled labeling workflow without using `pull_request` or `pull_request_target`, so labeling does not produce a check on individual PRs.
   
   - Add `.github/labeler.yml`, mapping changed paths to 13 existing labels: `scm`, `om`, `datanode`, `recon`, `s3`, `client`, `ofs`, `EC`, `command-line`, `tools`, `documentation`, `UI`, and `CI`. No new labels are created.
   - Add a `component-labeler` job that lists all open PRs and passes their numbers to the SHA-pinned `actions/labeler`.
   - Enable `sync-labels: true`. Labels in `.github/labeler.yml` are automation-owned and are added or removed according to the current changed files. Unlisted labels, such as `zdu` and `needs review`, are not modified.
   - Use a sparse checkout of `.github` so the configuration is read locally rather than fetched through the API for every PR.
   - Keep the existing `zdu` branch-labeling logic. `base-branch` matching does not work when `actions/labeler` is invoked through `pr-number` from a scheduled workflow because the event payload contains no PR branch information.
   - Reduce the schedule from every 5 minutes to every 30 minutes. With approximately 125 open PRs and three API requests per PR, the previous cadence would exceed the `GITHUB_TOKEN` limit of 1,000 requests per hour. The tradeoff is that labels may take up to 30 minutes to appear.
   
   **Expected first-run impact.** Simulating the rules against the current 125 open PRs would add approximately 146 labels and remove approximately five existing managed labels that do not match the changed paths.
   
   One open question is the meaning of `s3`: some PRs use it as a topic label without modifying S3 Gateway paths. For example, #10006 is an S3 design doc, labeled `s3` by topic, but it only changes `hadoop-hdds/docs`, so the sync would replace `s3` with `documentation` there. A path-based rule cannot reproduce that usage. If `s3` should remain manually managed, its rule can be removed from `.github/labeler.yml`.
   
   Release/backport, patch-size, review-state, and Jira labels are left for separate changes.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-15378
   
   ## How was this patch tested?
   
   - `rat.sh` passed; `actionlint` and `zizmor` reported no new findings.
   - Tested end-to-end with six PRs on a fork:
     https://github.com/chihsuan/ozone/actions/runs/30018395798
   - Covered single and multiple component paths, root Markdown files, UI and CI paths, a `zdu` PR, and multiple PR numbers in one invocation.
   - Verified that:
     - labels are added after new component files are pushed;
     - managed labels are removed after a revert or when manually applied to a non-matching PR;
     - unmanaged labels such as `zdu` and `needs review` remain unchanged; and
     - the configuration is read from the sparse checkout.
   - Simulated the rules against all current open PRs to measure the first-run impact.
   
   Generated-by: Claude Code (Opus 4.8)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-15378. Add component labels for PRs based on changed files [ozone]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #10851:
URL: https://github.com/apache/ozone/pull/10851#issuecomment-5737672068

   Thank you for your contribution. This PR is being closed due to inactivity. Please contact a maintainer if you would like to reopen it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-15378. Add component labels for PRs based on changed files [ozone]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #10851:
URL: https://github.com/apache/ozone/pull/10851#issuecomment-5642039164

   This PR has been marked as stale due to 21 days of inactivity. Please comment or remove the stale label to keep it open. Otherwise, it will be automatically closed in 7 days.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-15378. Add component labels for PRs based on changed files [ozone]

Posted by "chihsuan (via GitHub)" <gi...@apache.org>.
chihsuan commented on PR #10851:
URL: https://github.com/apache/ozone/pull/10851#issuecomment-5777404747

   Hi @adoroszlai, this PR was auto-closed by the stale bot and it seems only a maintainer can reopen it. Would you be able to reopen it when you have time? The change and your earlier feedback still apply. Thank you.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-15378. Add component labels for PRs based on changed files [ozone]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #10851: HDDS-15378. Add component labels for PRs based on changed files
URL: https://github.com/apache/ozone/pull/10851


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-15378. Add component labels for PRs based on changed files [ozone]

Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on code in PR #10851:
URL: https://github.com/apache/ozone/pull/10851#discussion_r3650431178


##########
.github/workflows/label-pr.yml:
##########
@@ -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

Review Comment:
   HDDS-15972
   
   ```suggestion
           uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-15378. Add component labels for PRs based on changed files [ozone]

Posted by "chihsuan (via GitHub)" <gi...@apache.org>.
chihsuan commented on code in PR #10851:
URL: https://github.com/apache/ozone/pull/10851#discussion_r3831412765


##########
.github/workflows/label-pr.yml:
##########
@@ -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

Review Comment:
   Good point! I changed this to add-only so that manually applied labels are preserved, and I removed the ineffective EC path rule.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-15378. Add component labels for PRs based on changed files [ozone]

Posted by "rich7420 (via GitHub)" <gi...@apache.org>.
rich7420 commented on code in PR #10851:
URL: https://github.com/apache/ozone/pull/10851#discussion_r3830193351


##########
.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 * * * *'

Review Comment:
   nit: no `concurrency` guard. `component-labeler` scans every open PR and scales with their count; if a run overruns 30 min under API throttling it overlaps the next, doubling API spend and racing add/remove on labels. Add at workflow level:
   
   ```yaml
   concurrency:
     group: scheduled-label-pull-requests
     cancel-in-progress: false
   ```



##########
.github/workflows/label-pr.yml:
##########
@@ -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

Review Comment:
   `sync-labels: true` makes all 13 labels automation-owned — it strips any applied by topic rather than path, every 30 min. The `s3` case (#10006) generalizes: simulating the globs, a docs-only PR resolves to `documentation` (strips a manual `s3`); an OM erasure-coding change resolves to `om` (strips a manual `EC`); a code-only PR strips a manual `documentation`. Worth deciding `s3` / `EC` / `documentation` together — keep them path-based, drop those rules, or namespace them (`comp:s3`…) so they can't collide with human topic labels.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-15378. Add component labels for PRs based on changed files [ozone]

Posted by "chihsuan (via GitHub)" <gi...@apache.org>.
chihsuan commented on code in PR #10851:
URL: https://github.com/apache/ozone/pull/10851#discussion_r3831419747


##########
.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 * * * *'

Review Comment:
   Added. Thanks.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-15378. Add component labels for PRs based on changed files [ozone]

Posted by "rich7420 (via GitHub)" <gi...@apache.org>.
rich7420 commented on PR #10851:
URL: https://github.com/apache/ozone/pull/10851#issuecomment-5369849889

   thanks for the patch! @chihsuan 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-15378. Add component labels for PRs based on changed files [ozone]

Posted by "ivandika3 (via GitHub)" <gi...@apache.org>.
ivandika3 merged PR #10851:
URL: https://github.com/apache/ozone/pull/10851


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org