dongjoon-hyun commented on code in PR #59862: URL: https://github.com/apache/spark/pull/59862#discussion_r4464070386
########## .github/workflows/labeler.yml: ########## @@ -0,0 +1,80 @@ +# +# 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. +# + +# Scheduled to avoid pull_request_target; never check out or run PR code here. +# Labels in .github/labeler.yml must already exist; this job cannot create them. +# +# To retry or backfill beyond the default 12-hour window: +# gh workflow run labeler.yml --repo apache/spark --ref master -f hours=24 + +name: Label pull requests + +on: + schedule: + - cron: "5,20,35,50 * * * *" + workflow_dispatch: + inputs: + hours: + description: Label open PRs updated within this many hours + type: number + default: 12 + +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: false + +jobs: + label: + name: Label pull requests + if: github.repository == 'apache/spark' && github.ref == 'refs/heads/master' + runs-on: ubuntu-slim Review Comment: **[1] `ubuntu-slim` jobs are limited to 15 minutes, which a backfill of today's unlabeled PRs is unlikely to fit in.** 691 of the 725 open PRs have no labels, and after merge only the ones updated in the last 12 hours get labeled. A backfill with a large `hours` value sends all of them to one `actions/labeler` invocation, which handles PRs one at a time: it fetches each PR and its changed files (30 per page) and then writes the labels, so the run makes a few thousand REST calls in sequence. For scale, `update_build_status.yml` already takes 7.5 to 9.5 minutes per run on the same runner. A job that reaches the limit is killed partway, and a rerun starts again from the newest PR. Could manual runs use `ubuntu-latest`, as the removed workflow did, e.g. `runs-on: ${{ github.event_name == 'schedule' && 'ubuntu-slim' || 'ubuntu-latest' }}`? ########## .github/workflows/labeler.yml: ########## @@ -0,0 +1,80 @@ +# +# 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. +# + +# Scheduled to avoid pull_request_target; never check out or run PR code here. +# Labels in .github/labeler.yml must already exist; this job cannot create them. +# +# To retry or backfill beyond the default 12-hour window: +# gh workflow run labeler.yml --repo apache/spark --ref master -f hours=24 + +name: Label pull requests + +on: + schedule: + - cron: "5,20,35,50 * * * *" + workflow_dispatch: + inputs: + hours: + description: Label open PRs updated within this many hours + type: number + default: 12 + +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: false + +jobs: + label: + name: Label pull requests + if: github.repository == 'apache/spark' && github.ref == 'refs/heads/master' + runs-on: ubuntu-slim + permissions: + contents: read + pull-requests: write + steps: + - name: Checkout labeler configuration + uses: actions/checkout@v7 + with: + persist-credentials: false + sparse-checkout: .github + - name: List recently updated PRs + id: prs + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + HOURS: ${{ inputs.hours }} + run: | + hours=${HOURS:-12} + if ! [[ "$hours" =~ ^[1-9][0-9]*$ ]]; then + echo "::error::hours must be a positive integer" + exit 1 + fi + since=$(date -u -d "$hours hours ago" +%Y-%m-%dT%H:%M:%SZ) + numbers=$(gh api --method GET --paginate "repos/$GITHUB_REPOSITORY/pulls" \ + -f state=open -f per_page=100 \ + --jq ".[] | select(.updated_at >= \"$since\") | .number") + echo "Open PRs updated since $since: $(tr '\n' ' ' <<< "$numbers")" + if [ -n "$numbers" ]; then + printf 'numbers<<EOF\n%s\nEOF\n' "$numbers" >> "$GITHUB_OUTPUT" + fi + - name: Label PRs + if: steps.prs.outputs.numbers != '' + uses: actions/labeler@v7 + with: + pr-number: ${{ steps.prs.outputs.numbers }} + sync-labels: true Review Comment: **[2] With `sync-labels: true` and a rescan every 15 minutes, a configured label added by hand is removed within about 15 minutes.** Adding a label bumps the PR's `updated_at`, so the next run picks the PR up again and removes every configured label that its files do not match. For example, a committer who adds `SQL` or `CORE` to route a PR to reviewers sees it disappear on the next run, and adding it again repeats the cycle. The removed workflow also used `sync-labels: true`, but it ran only on `pull_request_target` events, so such a label stayed until the author's next push. The description says configured labels are kept in sync with changed files, but not that a label added by hand now lasts only until the next run. Is that intended? If so, could the description say so; if not, could `sync-labels` be dropped so that the job only adds labels? ########## .github/workflows/labeler.yml: ########## @@ -0,0 +1,80 @@ +# +# 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. +# + +# Scheduled to avoid pull_request_target; never check out or run PR code here. +# Labels in .github/labeler.yml must already exist; this job cannot create them. +# +# To retry or backfill beyond the default 12-hour window: +# gh workflow run labeler.yml --repo apache/spark --ref master -f hours=24 + +name: Label pull requests + +on: + schedule: + - cron: "5,20,35,50 * * * *" + workflow_dispatch: + inputs: + hours: + description: Label open PRs updated within this many hours + type: number + default: 12 + +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: false + +jobs: + label: + name: Label pull requests + if: github.repository == 'apache/spark' && github.ref == 'refs/heads/master' + runs-on: ubuntu-slim + permissions: + contents: read + pull-requests: write + steps: + - name: Checkout labeler configuration + uses: actions/checkout@v7 + with: + persist-credentials: false + sparse-checkout: .github + - name: List recently updated PRs + id: prs + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + HOURS: ${{ inputs.hours }} + run: | + hours=${HOURS:-12} + if ! [[ "$hours" =~ ^[1-9][0-9]*$ ]]; then + echo "::error::hours must be a positive integer" + exit 1 + fi + since=$(date -u -d "$hours hours ago" +%Y-%m-%dT%H:%M:%SZ) + numbers=$(gh api --method GET --paginate "repos/$GITHUB_REPOSITORY/pulls" \ + -f state=open -f per_page=100 \ Review Comment: **[3] Only open PRs are listed, so a backfill cannot reach PRs that were merged or closed during a gap.** The description says "Longer gaps can be backfilled with the command documented in the workflow", but `state=open` skips PRs merged in the meantime (Spark merges show up as Closed on GitHub) and PRs opened and closed between two runs, so those stay unlabeled. Could the listing also include closed PRs updated in the window (item 11's search query would keep that cheap), or could the description say that only open PRs are backfilled? ########## .github/workflows/labeler.yml: ########## @@ -0,0 +1,80 @@ +# +# 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. +# + +# Scheduled to avoid pull_request_target; never check out or run PR code here. +# Labels in .github/labeler.yml must already exist; this job cannot create them. +# +# To retry or backfill beyond the default 12-hour window: +# gh workflow run labeler.yml --repo apache/spark --ref master -f hours=24 + +name: Label pull requests + +on: + schedule: + - cron: "5,20,35,50 * * * *" + workflow_dispatch: + inputs: + hours: + description: Label open PRs updated within this many hours + type: number + default: 12 + +concurrency: + group: ${{ github.workflow }} Review Comment: **[4] A manual backfill that waits in this concurrency group is cancelled by the next scheduled run.** With `cancel-in-progress: false`, GitHub keeps at most one pending run per group and cancels the older pending one when another run is queued. So if a run is in progress when a maintainer dispatches `-f hours=48`, the dispatch waits as pending until the next cron tick (:05, :20, :35 or :50) replaces it, and only a 12-hour pass runs. Could the group include the event name, e.g. `${{ github.workflow }}-${{ github.event_name }}`, so that a manual run only waits for other manual runs? ########## .github/labeler.yml: ########## @@ -0,0 +1,317 @@ +# +# 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. +# + +# Keep labels and globs sorted, with exclusions (!) after the globs they narrow. + +AVRO: + - changed-files: + - any-glob-to-any-file: [ + 'connector/avro/**/*', + 'python/**/avro/**/*', + ] + +BLOCK MANAGER: + - changed-files: + - all-globs-to-any-file: [ + 'core/src/**/storage/**/*', + '!**/ui/**/*', + ] + - any-glob-to-any-file: [ + 'common/utils/src/**/storage/**/*', + ] + +BUILD: + - changed-files: + - all-globs-to-any-file: [ + 'dev/**/*', + '!dev/merge_spark_pr.py', + ] + - any-glob-to-any-file: [ + '**/pom.xml', + '.mvn/**/*', + '.pre-commit-config.yaml', + '.sbtopts', + 'assembly/**/*', + 'bin/docker-image-tool.sh', + 'bin/find-spark-home*', + 'build/**/*', + 'project/**/*', + 'pyproject.toml', + 'scalastyle-config.xml', + ] + +CONNECT: + - changed-files: + - any-glob-to-any-file: [ + 'bin/spark-connect-shell', + 'python/**/connect/**/*', + 'sbin/*-connect-server.sh', + 'sql/connect/**/*', + ] + +CORE: + - changed-files: + - all-globs-to-any-file: [ + 'common/utils/**/*', + '!common/utils/src/main/resources/error/**', + ] + - all-globs-to-any-file: [ + 'core/**/*', + '!**/*UI.scala', + '!**/ui/**/*', + ] + - any-glob-to-any-file: [ + 'common/config/**/*', Review Comment: **[6] `common/config/**/*` gives CORE to SQL PRs that only add a SQL config.** common/config/README.md says "Currently, SQL configs go in `sql.textproto`", under `resources/org/apache/spark/config/session_configs/` and `cluster_configs/`. So a SQL PR that only adds a config there gets CORE but not SQL, since `**/sql/**/*` (L246) needs a `sql` directory. That is the same kind of shared registry as `error-conditions.json`, which L72 now excludes. Could `common/config/**/*` move into an `all-globs-to-any-file` entry with `'!common/config/**/sql.textproto'`, and could SQL list `'common/config/**/sql.textproto'`? ########## .github/labeler.yml: ########## @@ -0,0 +1,317 @@ +# +# 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. +# + +# Keep labels and globs sorted, with exclusions (!) after the globs they narrow. + +AVRO: + - changed-files: + - any-glob-to-any-file: [ + 'connector/avro/**/*', + 'python/**/avro/**/*', + ] + +BLOCK MANAGER: + - changed-files: + - all-globs-to-any-file: [ + 'core/src/**/storage/**/*', + '!**/ui/**/*', + ] + - any-glob-to-any-file: [ + 'common/utils/src/**/storage/**/*', + ] + +BUILD: + - changed-files: + - all-globs-to-any-file: [ + 'dev/**/*', + '!dev/merge_spark_pr.py', + ] + - any-glob-to-any-file: [ + '**/pom.xml', + '.mvn/**/*', + '.pre-commit-config.yaml', + '.sbtopts', + 'assembly/**/*', + 'bin/docker-image-tool.sh', + 'bin/find-spark-home*', + 'build/**/*', + 'project/**/*', + 'pyproject.toml', + 'scalastyle-config.xml', + ] + +CONNECT: + - changed-files: + - any-glob-to-any-file: [ + 'bin/spark-connect-shell', + 'python/**/connect/**/*', + 'sbin/*-connect-server.sh', + 'sql/connect/**/*', + ] + +CORE: + - changed-files: + - all-globs-to-any-file: [ + 'common/utils/**/*', + '!common/utils/src/main/resources/error/**', + ] + - all-globs-to-any-file: [ + 'core/**/*', + '!**/*UI.scala', + '!**/ui/**/*', + ] + - any-glob-to-any-file: [ + 'common/config/**/*', + 'common/kvstore/**/*', + 'common/network-common/**/*', + 'common/network-shuffle/**/*', + 'common/tags/**/*', + 'common/utils-java/**/*', + 'python/pyspark/*.py', + 'python/pyspark/core/**/*', + 'python/pyspark/resource/**/*', + 'python/pyspark/tests/**/*.py', + ] + +DECLARATIVE PIPELINES: + - changed-files: + - any-glob-to-any-file: [ + 'bin/spark-pipelines', + 'docs/**/declarative-pipelines*', + 'python/docs/source/reference/pyspark.pipelines.rst', + 'python/pyspark/pipelines/**/*', + 'python/pyspark/sql/connect/proto/pipelines_pb2.*', + 'sql/**/pipelines/**/*', + 'sql/connect/common/src/main/protobuf/spark/connect/pipelines.proto', + ] + +DEPLOY: + - changed-files: + - any-glob-to-any-file: [ + 'bin/load-spark-env*', + 'bin/spark-class*', + 'conf/**/*', + 'sbin/**/*', + ] + +DOCS: + - changed-files: + - any-glob-to-any-file: [ + '**/CONTRIBUTING.md', + '**/README*', + 'docs/**/*', + 'python/docs/**/*', + ] + +DSTREAM: + - changed-files: + - any-glob-to-any-file: [ + 'connector/kafka-0-10/**/*', + 'connector/kafka-0-10-assembly/**/*', + 'connector/kafka-0-10-token-provider/**/*', + 'connector/kinesis-asl/**/*', + 'connector/kinesis-asl-assembly/**/*', + 'data/streaming/**/*', + 'python/pyspark/streaming/**/*', + 'streaming/**/*', + ] + +EXAMPLES: + - changed-files: + - any-glob-to-any-file: [ + 'bin/run-example*', + 'examples/**/*', + ] + +GRAPHX: + - changed-files: + - any-glob-to-any-file: [ + 'data/graphx/**/*', + 'graphx/**/*', + ] + +INFRA: + - changed-files: + - any-glob-to-any-file: [ + '.asf.yaml', + '.gitattributes', + '.github/**/*', + '.gitignore', + 'dev/create-release/**/*', + 'dev/merge_spark_pr.py', Review Comment: **[8] Nit: the other committer scripts in `dev/` get BUILD instead of INFRA.** Only `dev/merge_spark_pr.py` is listed here and excluded from BUILD (L42-L43), so `dev/pr_merge_status.py`, `create_spark_jira.py`, `spark_jira_utils.py`, `spark_merge_footer.py`, `next_version_candidates.py` and `create_jira_and_branch.py` match BUILD through `dev/**/*`. On master, 7 of the 8 commits that touch them are titled `[INFRA]`, e.g. SPARK-57862 and SPARK-57674. Could they be listed here and in the L43 exclusion too? ########## .github/workflows/labeler.yml: ########## @@ -0,0 +1,80 @@ +# +# 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. +# + +# Scheduled to avoid pull_request_target; never check out or run PR code here. +# Labels in .github/labeler.yml must already exist; this job cannot create them. +# +# To retry or backfill beyond the default 12-hour window: +# gh workflow run labeler.yml --repo apache/spark --ref master -f hours=24 + +name: Label pull requests + +on: + schedule: + - cron: "5,20,35,50 * * * *" + workflow_dispatch: + inputs: + hours: + description: Label open PRs updated within this many hours + type: number + default: 12 + +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: false + +jobs: + label: + name: Label pull requests + if: github.repository == 'apache/spark' && github.ref == 'refs/heads/master' + runs-on: ubuntu-slim + permissions: + contents: read + pull-requests: write + steps: + - name: Checkout labeler configuration + uses: actions/checkout@v7 + with: + persist-credentials: false + sparse-checkout: .github + - name: List recently updated PRs + id: prs + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + HOURS: ${{ inputs.hours }} + run: | + hours=${HOURS:-12} + if ! [[ "$hours" =~ ^[1-9][0-9]*$ ]]; then + echo "::error::hours must be a positive integer" + exit 1 + fi + since=$(date -u -d "$hours hours ago" +%Y-%m-%dT%H:%M:%SZ) Review Comment: **[5] The fixed 12-hour lookback re-checks each updated PR about 48 times, but still misses gaps longer than 12 hours.** A PR stays in the window for 48 runs, and each run fetches it and its files again, although usually only the first run after an update can change its labels. With 93 PRs in the window right now, that is about 200 REST calls per run and about 19,000 per day, almost all without a write. A scheduling gap longer than 12 hours still needs someone to notice it and backfill by hand. Could the cut-off be the start time of this workflow's last successful run minus a small overlap, e.g. from `gh run list --workflow labeler.yml --status success --limit 1 --json startedAt` (which needs `actions: read`), with `hours` kept as an override? That would cover any gap and check each update about once. ########## .github/labeler.yml: ########## @@ -0,0 +1,317 @@ +# +# 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. +# + +# Keep labels and globs sorted, with exclusions (!) after the globs they narrow. + +AVRO: + - changed-files: + - any-glob-to-any-file: [ + 'connector/avro/**/*', + 'python/**/avro/**/*', + ] + +BLOCK MANAGER: + - changed-files: + - all-globs-to-any-file: [ + 'core/src/**/storage/**/*', + '!**/ui/**/*', + ] + - any-glob-to-any-file: [ + 'common/utils/src/**/storage/**/*', + ] + +BUILD: + - changed-files: + - all-globs-to-any-file: [ + 'dev/**/*', + '!dev/merge_spark_pr.py', + ] + - any-glob-to-any-file: [ + '**/pom.xml', + '.mvn/**/*', + '.pre-commit-config.yaml', + '.sbtopts', + 'assembly/**/*', + 'bin/docker-image-tool.sh', + 'bin/find-spark-home*', + 'build/**/*', + 'project/**/*', + 'pyproject.toml', + 'scalastyle-config.xml', + ] + +CONNECT: + - changed-files: + - any-glob-to-any-file: [ + 'bin/spark-connect-shell', + 'python/**/connect/**/*', + 'sbin/*-connect-server.sh', + 'sql/connect/**/*', + ] + +CORE: + - changed-files: + - all-globs-to-any-file: [ + 'common/utils/**/*', + '!common/utils/src/main/resources/error/**', + ] + - all-globs-to-any-file: [ + 'core/**/*', + '!**/*UI.scala', + '!**/ui/**/*', + ] + - any-glob-to-any-file: [ + 'common/config/**/*', + 'common/kvstore/**/*', + 'common/network-common/**/*', + 'common/network-shuffle/**/*', + 'common/tags/**/*', + 'common/utils-java/**/*', + 'python/pyspark/*.py', + 'python/pyspark/core/**/*', + 'python/pyspark/resource/**/*', + 'python/pyspark/tests/**/*.py', + ] + +DECLARATIVE PIPELINES: + - changed-files: + - any-glob-to-any-file: [ + 'bin/spark-pipelines', + 'docs/**/declarative-pipelines*', + 'python/docs/source/reference/pyspark.pipelines.rst', + 'python/pyspark/pipelines/**/*', + 'python/pyspark/sql/connect/proto/pipelines_pb2.*', + 'sql/**/pipelines/**/*', + 'sql/connect/common/src/main/protobuf/spark/connect/pipelines.proto', + ] + +DEPLOY: + - changed-files: + - any-glob-to-any-file: [ + 'bin/load-spark-env*', + 'bin/spark-class*', + 'conf/**/*', + 'sbin/**/*', + ] + +DOCS: + - changed-files: + - any-glob-to-any-file: [ + '**/CONTRIBUTING.md', + '**/README*', + 'docs/**/*', + 'python/docs/**/*', + ] + +DSTREAM: + - changed-files: + - any-glob-to-any-file: [ + 'connector/kafka-0-10/**/*', + 'connector/kafka-0-10-assembly/**/*', + 'connector/kafka-0-10-token-provider/**/*', + 'connector/kinesis-asl/**/*', + 'connector/kinesis-asl-assembly/**/*', + 'data/streaming/**/*', + 'python/pyspark/streaming/**/*', + 'streaming/**/*', + ] + +EXAMPLES: + - changed-files: + - any-glob-to-any-file: [ + 'bin/run-example*', + 'examples/**/*', + ] + +GRAPHX: + - changed-files: + - any-glob-to-any-file: [ + 'data/graphx/**/*', + 'graphx/**/*', + ] + +INFRA: + - changed-files: + - any-glob-to-any-file: [ + '.asf.yaml', + '.gitattributes', + '.github/**/*', + '.gitignore', + 'dev/create-release/**/*', + 'dev/merge_spark_pr.py', + 'tools/**/*', + ] + +KUBERNETES: + - changed-files: + - any-glob-to-any-file: [ + 'bin/docker-image-tool.sh', + 'resource-managers/kubernetes/**/*', + ] + +ML: + - changed-files: + - any-glob-to-any-file: [ + '**/*mllib_*.R', + '**/ml/**/*', + ] + +MLLIB: + - changed-files: + - any-glob-to-any-file: [ + '**/mllib/**/*', + 'mllib-local/**/*', + ] + +PANDAS API ON SPARK: + - changed-files: + - any-glob-to-any-file: [ + 'python/pyspark/pandas/**/*', + ] + +PROTOBUF: + - changed-files: + - any-glob-to-any-file: [ + 'connector/protobuf/**/*', + 'python/**/protobuf/**/*', + ] + +PYTHON: + - changed-files: + - any-glob-to-any-file: [ + '**/python/**/*', + 'bin/pyspark*', + 'pyproject.toml', + ] + +R: + - changed-files: + - any-glob-to-any-file: [ + '**/R/**/*', + '**/r/**/*', + 'bin/sparkR*', + ] + +SCHEDULER: + - changed-files: + - any-glob-to-any-file: [ + 'common/utils/src/**/scheduler/**/*', + 'core/src/**/scheduler/**/*', + ] + +SHUFFLE: + - changed-files: + - any-glob-to-any-file: [ + 'common/network-common/**/shuffle/**/*', + 'common/network-shuffle/**/*', + 'common/network-yarn/**/*', + 'core/src/**/shuffle/**/*', + 'resource-managers/**/shuffle/**/*', + ] + +SPARK SHELL: + - changed-files: + - any-glob-to-any-file: [ + 'bin/spark-shell*', + 'repl/**/*', + ] + +SPARK SUBMIT: + - changed-files: + - any-glob-to-any-file: [ + 'bin/spark-submit*', + 'core/src/**/SparkSubmit*', + 'launcher/**/*', + ] + +SQL: + - changed-files: + - all-globs-to-any-file: [ + '**/sql/**/*', + '!python/**/avro/**/*', + '!python/**/protobuf/**/*', + '!python/**/streaming/**/*', + ] + - any-glob-to-any-file: [ + '**/*catalog.R', + '**/*column.R', + '**/*functions.R', + '**/*group.R', + '**/*schema.R', + '**/*SQL*.R', + '**/*types.R', + '**/*WindowSpec.R', + '**/DataFrame.R', + 'bin/beeline*', + 'bin/spark-sql*', + 'common/sketch/**/*', + 'common/unsafe/**/*', + 'common/variant/**/*', + 'connector/docker-integration-tests/**/*', + 'sbin/*thriftserver*.sh', + ] + +STRUCTURED STREAMING: + - changed-files: + - any-glob-to-any-file: [ + '**/*streaming.R', + '**/sql/**/streaming/**/*', + 'connector/kafka-0-10-sql/**/*', + 'connector/kafka-0-10-token-provider/**/*', + ] + +UDF: + - changed-files: + - any-glob-to-any-file: [ + '**/*UDAF*', + '**/*udaf*', + '**/*UDF*', Review Comment: **[9] Nit: the UDF globs also match SQL golden files and benchmark results.** `**/*UDF*`, `**/*udf*` and `**/udf/**/*` match files such as `sql-tests/results/udf/udf-window.sql.out` and `sql/core/benchmarks/UDFBenchmark-results.txt`. So SPARK-58213 (`corr` returning NULL for zero variance, which regenerates `udf-window.sql.out`) and SPARK-60831 (BenchmarkBase on Java 21, which regenerates `UDFBenchmark-*results.txt`) would get UDF. Could these globs exclude `'!**/*.sql.out'` and `'!**/benchmarks/**'`, e.g. as `all-globs-to-any-file` entries like CORE's UI exclusions? ########## .github/workflows/labeler.yml: ########## @@ -0,0 +1,80 @@ +# +# 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. +# + +# Scheduled to avoid pull_request_target; never check out or run PR code here. +# Labels in .github/labeler.yml must already exist; this job cannot create them. +# +# To retry or backfill beyond the default 12-hour window: +# gh workflow run labeler.yml --repo apache/spark --ref master -f hours=24 + +name: Label pull requests + +on: + schedule: + - cron: "5,20,35,50 * * * *" + workflow_dispatch: + inputs: + hours: + description: Label open PRs updated within this many hours + type: number + default: 12 + +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: false + +jobs: + label: + name: Label pull requests + if: github.repository == 'apache/spark' && github.ref == 'refs/heads/master' + runs-on: ubuntu-slim + permissions: + contents: read + pull-requests: write + steps: + - name: Checkout labeler configuration + uses: actions/checkout@v7 + with: + persist-credentials: false + sparse-checkout: .github + - name: List recently updated PRs + id: prs + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + HOURS: ${{ inputs.hours }} + run: | + hours=${HOURS:-12} + if ! [[ "$hours" =~ ^[1-9][0-9]*$ ]]; then + echo "::error::hours must be a positive integer" + exit 1 + fi + since=$(date -u -d "$hours hours ago" +%Y-%m-%dT%H:%M:%SZ) + numbers=$(gh api --method GET --paginate "repos/$GITHUB_REPOSITORY/pulls" \ Review Comment: **[11] Nit: each run pages through all open PRs and filters on `updated_at` on the client.** The default `sort=created` returns all 725 open PRs in 8 pages on every run, about 770 list requests a day, mostly for PRs outside the window. Could this use the search API instead, e.g. `gh api -X GET search/issues -f q="repo:$GITHUB_REPOSITORY is:pr is:open updated:>=$since" --paginate --jq '.items[].number'`, which returns only the PRs in the window? ########## .github/labeler.yml: ########## @@ -0,0 +1,317 @@ +# +# 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. +# + +# Keep labels and globs sorted, with exclusions (!) after the globs they narrow. + +AVRO: + - changed-files: + - any-glob-to-any-file: [ + 'connector/avro/**/*', + 'python/**/avro/**/*', + ] + +BLOCK MANAGER: + - changed-files: + - all-globs-to-any-file: [ + 'core/src/**/storage/**/*', + '!**/ui/**/*', + ] + - any-glob-to-any-file: [ + 'common/utils/src/**/storage/**/*', + ] + +BUILD: + - changed-files: + - all-globs-to-any-file: [ + 'dev/**/*', + '!dev/merge_spark_pr.py', + ] + - any-glob-to-any-file: [ + '**/pom.xml', + '.mvn/**/*', + '.pre-commit-config.yaml', + '.sbtopts', + 'assembly/**/*', + 'bin/docker-image-tool.sh', + 'bin/find-spark-home*', + 'build/**/*', + 'project/**/*', + 'pyproject.toml', + 'scalastyle-config.xml', + ] + +CONNECT: + - changed-files: + - any-glob-to-any-file: [ + 'bin/spark-connect-shell', + 'python/**/connect/**/*', + 'sbin/*-connect-server.sh', + 'sql/connect/**/*', + ] + +CORE: + - changed-files: + - all-globs-to-any-file: [ + 'common/utils/**/*', + '!common/utils/src/main/resources/error/**', + ] + - all-globs-to-any-file: [ + 'core/**/*', + '!**/*UI.scala', + '!**/ui/**/*', + ] + - any-glob-to-any-file: [ + 'common/config/**/*', + 'common/kvstore/**/*', + 'common/network-common/**/*', + 'common/network-shuffle/**/*', + 'common/tags/**/*', + 'common/utils-java/**/*', + 'python/pyspark/*.py', + 'python/pyspark/core/**/*', + 'python/pyspark/resource/**/*', + 'python/pyspark/tests/**/*.py', + ] + +DECLARATIVE PIPELINES: + - changed-files: + - any-glob-to-any-file: [ + 'bin/spark-pipelines', + 'docs/**/declarative-pipelines*', + 'python/docs/source/reference/pyspark.pipelines.rst', + 'python/pyspark/pipelines/**/*', + 'python/pyspark/sql/connect/proto/pipelines_pb2.*', + 'sql/**/pipelines/**/*', + 'sql/connect/common/src/main/protobuf/spark/connect/pipelines.proto', + ] + +DEPLOY: + - changed-files: + - any-glob-to-any-file: [ + 'bin/load-spark-env*', + 'bin/spark-class*', + 'conf/**/*', + 'sbin/**/*', + ] + +DOCS: + - changed-files: + - any-glob-to-any-file: [ + '**/CONTRIBUTING.md', + '**/README*', Review Comment: **[10] Nit: `**/README*` also matches README files that are data notes or test fixtures, not docs.** For example, `mllib/src/main/resources/org/apache/spark/ml/feature/stopwords/README` and `sql/hive/src/test/noclasspath/README` would get DOCS. The removed config had `**/README.md`. Could it stay that way, or is the wider glob meant for specific files? ########## .github/labeler.yml: ########## @@ -0,0 +1,317 @@ +# +# 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. +# + +# Keep labels and globs sorted, with exclusions (!) after the globs they narrow. + +AVRO: + - changed-files: + - any-glob-to-any-file: [ + 'connector/avro/**/*', + 'python/**/avro/**/*', + ] + +BLOCK MANAGER: + - changed-files: + - all-globs-to-any-file: [ + 'core/src/**/storage/**/*', + '!**/ui/**/*', + ] + - any-glob-to-any-file: [ + 'common/utils/src/**/storage/**/*', + ] + +BUILD: + - changed-files: + - all-globs-to-any-file: [ + 'dev/**/*', + '!dev/merge_spark_pr.py', + ] + - any-glob-to-any-file: [ + '**/pom.xml', + '.mvn/**/*', + '.pre-commit-config.yaml', + '.sbtopts', + 'assembly/**/*', + 'bin/docker-image-tool.sh', + 'bin/find-spark-home*', + 'build/**/*', + 'project/**/*', + 'pyproject.toml', + 'scalastyle-config.xml', + ] + +CONNECT: + - changed-files: + - any-glob-to-any-file: [ + 'bin/spark-connect-shell', + 'python/**/connect/**/*', + 'sbin/*-connect-server.sh', + 'sql/connect/**/*', Review Comment: **[7] Spark Connect on branch-3.5 lives under `connector/connect/**`, which this rule does not match.** This config now labels PRs against every base branch, since the job runs from master. branch-3.5's own `.github/labeler.yml` matched `connector/connect/**/*` (L155 there), but here only the Python side matches, through `python/**/connect/**/*`. So a branch-3.5 backport that touches `connector/connect/server/...` gets no CONNECT label, and one added by hand is removed on the next run (item 2). Could this rule also list `'connector/connect/**/*'`? -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
