From 64dd0e7a393f341d6949a0d23fb7a676ad704834 Mon Sep 17 00:00:00 2001 From: Nick Dimiduk Date: Thu, 15 Jan 2026 17:36:00 +0100 Subject: [PATCH 1/5] HBASE-29787 Run Yetus General Checks as a GitHub Action (addendum) Conditionally execute publishing to nightlies. --- .github/workflows/yetus-general-check.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/yetus-general-check.yml b/.github/workflows/yetus-general-check.yml index 664ef27624e4..86e943286a3d 100644 --- a/.github/workflows/yetus-general-check.yml +++ b/.github/workflows/yetus-general-check.yml @@ -111,7 +111,9 @@ jobs: - name: Create Nightlies Directory Structure # this version of rsync doesn't support --mkdirs so we do this step manually - if: always() + if: always() && env.NIGHTLIES_RSYNC_KEY + env: + NIGHTLIES_RSYNC_KEY: ${{ secrets.NIGHTLIES_RSYNC_KEY }} run: | eval $(ssh-agent -s) ssh-add - <<< "${{ secrets.NIGHTLIES_RSYNC_KEY }}" @@ -122,7 +124,9 @@ jobs: ssh-agent -k - name: Publish to Nightlies - if: always() + if: always() && env.NIGHTLIES_RSYNC_KEY + env: + NIGHTLIES_RSYNC_KEY: ${{ secrets.NIGHTLIES_RSYNC_KEY }} uses: burnett01/rsync-deployments@0dc935cdecc5f5e571865e60d2a6cdc673704823 with: switches: -avzr --no-o From 32e1164a2114e6c49b2129c7203925aff8910fc8 Mon Sep 17 00:00:00 2001 From: Nick Dimiduk Date: Fri, 16 Jan 2026 09:12:21 +0100 Subject: [PATCH 2/5] remove dependency on secrets --- .github/workflows/yetus-general-check.yml | 42 ----------------------- dev-support/hbase-personality.sh | 27 --------------- 2 files changed, 69 deletions(-) diff --git a/.github/workflows/yetus-general-check.yml b/.github/workflows/yetus-general-check.yml index 86e943286a3d..fa2e95be3a87 100644 --- a/.github/workflows/yetus-general-check.yml +++ b/.github/workflows/yetus-general-check.yml @@ -95,48 +95,6 @@ jobs: cd "${{ github.workspace }}" bash src/dev-support/jenkins_precommit_github_yetus.sh - - name: Hide Old Comments - if: always() - env: - DEBUG: 'true' - run: | - # github-actions[bot] has a known user ID: 41898282 - # Verify: curl -s "https://api.github.com/users/github-actions%5Bbot%5D" | jq .id - export DEBUG="${DEBUG:-false}" - export GITHUB_TOKEN="${{ secrets.GITHUB_TOKEN }}" - export BUILD_BOT_USER_ID="41898282" - export JOB_NAME="HBase-PreCommit-GH-Actions-PR" - export REPO="${{ github.repository }}" - bash src/dev-support/gh_hide_old_comments.sh ${{ github.event.pull_request.number }} || true - - - name: Create Nightlies Directory Structure - # this version of rsync doesn't support --mkdirs so we do this step manually - if: always() && env.NIGHTLIES_RSYNC_KEY - env: - NIGHTLIES_RSYNC_KEY: ${{ secrets.NIGHTLIES_RSYNC_KEY }} - run: | - eval $(ssh-agent -s) - ssh-add - <<< "${{ secrets.NIGHTLIES_RSYNC_KEY }}" - ssh -p ${{ secrets.NIGHTLIES_RSYNC_PORT }} \ - -o StrictHostKeyChecking=no \ - ${{ secrets.NIGHTLIES_RSYNC_USER }}@${{ secrets.NIGHTLIES_RSYNC_HOST }} \ - "mkdir -p ${{ secrets.NIGHTLIES_RSYNC_PATH }}/hbase/HBase-PreCommit-GH-Actions-PR/PR-${{ github.event.pull_request.number }}/${{ github.run_number }}" - ssh-agent -k - - - name: Publish to Nightlies - if: always() && env.NIGHTLIES_RSYNC_KEY - env: - NIGHTLIES_RSYNC_KEY: ${{ secrets.NIGHTLIES_RSYNC_KEY }} - uses: burnett01/rsync-deployments@0dc935cdecc5f5e571865e60d2a6cdc673704823 - with: - switches: -avzr --no-o - path: yetus-general-check - remote_path: ${{ secrets.NIGHTLIES_RSYNC_PATH }}/hbase/HBase-PreCommit-GH-Actions-PR/PR-${{ github.event.pull_request.number }}/${{ github.run_number }}/ - remote_host: ${{ secrets.NIGHTLIES_RSYNC_HOST }} - remote_port: ${{ secrets.NIGHTLIES_RSYNC_PORT }} - remote_user: ${{ secrets.NIGHTLIES_RSYNC_USER }} - remote_key: ${{ secrets.NIGHTLIES_RSYNC_KEY }} - - name: Publish Test Results if: always() uses: actions/upload-artifact@v4 diff --git a/dev-support/hbase-personality.sh b/dev-support/hbase-personality.sh index 168443384dc6..a1e467fd301f 100755 --- a/dev-support/hbase-personality.sh +++ b/dev-support/hbase-personality.sh @@ -88,20 +88,6 @@ function personality_globals # See HBASE-19902 for how we arrived at 20g. #shellcheck disable=SC2034 DOCKERMEMLIMIT=20g - - # Override BUILD_URL for GitHub Actions to point to nightlies - # instead of the GitHub Actions run page - # The robot sets BUILD_URL to the GHA run page, but we want nightlies URLs - if [[ "${GITHUB_ACTIONS}" == "true" ]] && [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]]; then - local pr_number - # GITHUB_REF is a standard GitHub Actions environment variable - # shellcheck disable=SC2153 - pr_number=$(echo "${GITHUB_REF}" | cut -f3 -d/) - #shellcheck disable=SC2034 - BUILD_URL="https://nightlies.apache.org/hbase/HBase-PreCommit-GH-Actions-PR/PR-${pr_number}/${GITHUB_RUN_NUMBER}/" - #shellcheck disable=SC2034 - BUILD_URL_ARTIFACTS="yetus-general-check/output" - fi } ## @description Parse extra arguments required by personalities, if any. @@ -849,19 +835,6 @@ function hbaseanti_patchfile add_test_type spotless -## @description Build artifact URL for GitHub Actions -## @audience private -## @stability evolving -## @replaceable no -if ! declare -f githubactions_artifact_url >/dev/null; then - function githubactions_artifact_url - { - if [[ -n "${BUILD_URL}" ]] && [[ -n "${BUILD_URL_ARTIFACTS}" ]]; then - echo "${BUILD_URL}${BUILD_URL_ARTIFACTS}" - fi - } -fi - ## @description spotless file filter ## @audience private ## @stability evolving From c9ecc65e8440cc972c582abaa89415f46871dc65 Mon Sep 17 00:00:00 2001 From: Nick Dimiduk Date: Fri, 16 Jan 2026 09:12:45 +0100 Subject: [PATCH 3/5] add a workflow to periodically hide old comments --- .github/workflows/cleanup-pr-comments.yml | 63 +++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/cleanup-pr-comments.yml diff --git a/.github/workflows/cleanup-pr-comments.yml b/.github/workflows/cleanup-pr-comments.yml new file mode 100644 index 000000000000..378dae44c101 --- /dev/null +++ b/.github/workflows/cleanup-pr-comments.yml @@ -0,0 +1,63 @@ +# 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. + +# yamllint disable rule:line-length +--- +name: Cleanup Old PR Comments + +"on": + schedule: + - cron: '0 */6 * * *' + workflow_dispatch: + +permissions: + pull-requests: write + issues: write + +jobs: + cleanup: + runs-on: ubuntu-latest + steps: + - name: Checkout HBase + uses: actions/checkout@v4 + + - name: Clean up old comments on recently active PRs + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BUILD_BOT_USER_ID: "41898282" + JOB_NAME: "HBase-PreCommit-GH-Actions-PR" + REPO: ${{ github.repository }} + DEBUG: 'false' + run: | + # Find open PRs updated in last 7 hours (buffer beyond 6hr cron interval) + prs=$(gh pr list \ + --state open \ + --search "updated:>$(date -u -d '7 hours ago' +%Y-%m-%dT%H:%M:%SZ)" \ + --json number \ + --jq '.[].number') + + if [ -z "$prs" ]; then + echo "No recently active PRs found" + exit 0 + fi + + echo "Processing $(echo "$prs" | wc -w) recently active PRs" + for pr in $prs; do + echo "Cleaning PR #$pr" + bash dev-support/gh_hide_old_comments.sh "$pr" || true + sleep 2 + done From a78a5ff462a3090d3e3c3068d76df2280985184f Mon Sep 17 00:00:00 2001 From: Nick Dimiduk Date: Fri, 16 Jan 2026 09:13:09 +0100 Subject: [PATCH 4/5] add support for line comments to our spotless extension --- dev-support/hbase-personality.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/dev-support/hbase-personality.sh b/dev-support/hbase-personality.sh index a1e467fd301f..5900bab072e0 100755 --- a/dev-support/hbase-personality.sh +++ b/dev-support/hbase-personality.sh @@ -852,6 +852,7 @@ function spotless_rebuild { local repostatus=$1 local logfile="${PATCH_DIR}/${repostatus}-spotless.txt" + local linecommentsfile="${PATCH_DIR}/${repostatus}-spotless-linecomments.txt" if ! verify_needed_test spotless; then return 0 @@ -869,6 +870,20 @@ function spotless_rebuild count=$(${GREP} -c '\[ERROR\]' "${logfile}") if [[ ${count} -gt 0 ]]; then + # Generate file-level annotations for GitHub Actions + if [[ -n "${BUGLINECOMMENTS}" ]]; then + # Extract files with violations: lines like "[ERROR] src/path/to/file.java" + # with leading whitespace after [ERROR] + ${GREP} '^\[ERROR\][[:space:]]\+[^[:space:]]' "${logfile}" \ + | ${SED} 's/^\[ERROR\][[:space:]]*//g' \ + | while read -r file; do + echo "${file}:1:Spotless formatting required, run mvn spotless:apply" + done > "${linecommentsfile}" + if [[ -s "${linecommentsfile}" ]]; then + bugsystem_linecomments_queue spotless "${linecommentsfile}" + fi + fi + add_vote_table_v2 -1 spotless \ "@@BASE@@/${repostatus}-spotless.txt" \ "${repostatus} has ${count} errors when running spotless:check, run spotless:apply to fix." From e3af4483855031c7d49de3a4ec7db4a5e679de28 Mon Sep 17 00:00:00 2001 From: Nick Dimiduk Date: Mon, 22 Dec 2025 13:48:32 +0100 Subject: [PATCH 5/5] introduce some breakages --- .../hbase/testclassification/ClientTests.java | 20 ++----------------- 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/hbase-annotations/src/test/java/org/apache/hadoop/hbase/testclassification/ClientTests.java b/hbase-annotations/src/test/java/org/apache/hadoop/hbase/testclassification/ClientTests.java index b0e259e1f9e2..ff98ebbc81fa 100644 --- a/hbase-annotations/src/test/java/org/apache/hadoop/hbase/testclassification/ClientTests.java +++ b/hbase-annotations/src/test/java/org/apache/hadoop/hbase/testclassification/ClientTests.java @@ -1,25 +1,9 @@ -/* - * 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. - */ package org.apache.hadoop.hbase.testclassification; /** * Tag a test as related to the client. This tests the hbase-client package and all of the client * tests in hbase-server. + * @author ndimiduk * @see org.apache.hadoop.hbase.testclassification.ClientTests * @see org.apache.hadoop.hbase.testclassification.CoprocessorTests * @see org.apache.hadoop.hbase.testclassification.FilterTests @@ -36,5 +20,5 @@ * @see org.apache.hadoop.hbase.testclassification.VerySlowMapReduceTests */ public interface ClientTests { - public static final String TAG = "org.apache.hadoop.hbase.testclassification.ClientTests"; + public static final String TAG = "org.apache.hadoop.hbase.testclassification.ClientTests"; }