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
3 changes: 3 additions & 0 deletions dev-support/jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ pipeline {
SET_JAVA_HOME = "/usr/lib/jvm/java-17"
JAVA8_HOME = "/usr/lib/jvm/java-8"
JAVA17_HOME = "/usr/lib/jvm/java-17"
WORKDIR_REL = "yetus-precommit-check"
WORKDIR = "${WORKSPACE}/${WORKDIR_REL}"
PLUGINS = 'all'
PERSONALITY = "${WORKDIR}/${SRC_REL}/dev-support/jenkins/hbase-personality.sh"
}


Expand Down
83 changes: 83 additions & 0 deletions dev-support/jenkins/hbase-personality.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
#!/usr/bin/env bash
# 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.

personality_plugins "all"

## @description Globals specific to this personality
## @audience private
## @stability evolving
function personality_globals
{
#shellcheck disable=SC2034
PROJECT_NAME=hbase-thirdparty
#shellcheck disable=SC2034
PATCH_BRANCH_DEFAULT=master
#shellcheck disable=SC2034
JIRA_ISSUE_RE='^HBASE-[0-9]+$'
#shellcheck disable=SC2034
GITHUB_REPO="apache/hbase-thirdparty"
}

######################################
# Below plugin is copied from https://github.com/apache/hbase/blob/master/dev-support/hbase-personality.sh
######################################

add_test_type spotless

## @description spotless file filter
## @audience private
## @stability evolving
## @param filename
function spotless_filefilter
{
# always add spotless check as it can format almost all types of files
add_test spotless
}
## @description run spotless:check to check format issues
## @audience private
## @stability evolving
## @param repostatus
function spotless_rebuild
{
local repostatus=$1
local logfile="${PATCH_DIR}/${repostatus}-spotless.txt"

if ! verify_needed_test spotless; then
return 0
fi

big_console_header "Checking spotless on ${repostatus}"

start_clock

local -a maven_args=('spotless:check')

# disabled because "maven_executor" needs to return both command and args
# shellcheck disable=2046
echo_and_redirect "${logfile}" $(maven_executor) "${maven_args[@]}"

count=$(${GREP} -c '\[ERROR\]' "${logfile}")
if [[ ${count} -gt 0 ]]; then
add_vote_table -1 spotless "${repostatus} has ${count} errors when running spotless:check, run spotless:apply to fix."
add_footer_table spotless "@@BASE@@/${repostatus}-spotless.txt"
return 1
fi

add_vote_table +1 spotless "${repostatus} has no errors when running spotless:check."
return 0
}

######################################
3 changes: 3 additions & 0 deletions dev-support/jenkins/jenkins_precommit_github_yetus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ declare -a required_envs=(
"SET_JAVA_HOME"
"SOURCEDIR"
"YETUSDIR"
"PERSONALITY"
)
# Validate params
for required_env in "${required_envs[@]}"; do
Expand Down Expand Up @@ -85,6 +86,8 @@ fi
YETUS_ARGS+=("--patch-dir=${PATCHDIR}")
# where the source is located
YETUS_ARGS+=("--basedir=${SOURCEDIR}")
YETUS_ARGS+=("--project=hbase-thirdparty")
YETUS_ARGS+=("--personality=${PERSONALITY}")
# lots of different output formats
YETUS_ARGS+=("--console-report-file=${PATCHDIR}/console.txt")
# enable writing back to Github
Expand Down