Skip to content
Draft
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
63 changes: 63 additions & 0 deletions .github/workflows/cleanup-pr-comments.yml
Original file line number Diff line number Diff line change
@@ -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
38 changes: 0 additions & 38 deletions .github/workflows/yetus-general-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,44 +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()
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()
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
Expand Down
42 changes: 15 additions & 27 deletions dev-support/hbase-personality.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -879,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
Expand All @@ -896,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."
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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";
}