Skip to content

Commit

Permalink
Merge pull request kubernetes-csi#124 from sachinkumarsingh092/fix-sp…
Browse files Browse the repository at this point in the history
…ellcheck-boilerplate-tests

Fix spelling and boilerplate errors
  • Loading branch information
k8s-ci-robot committed Jan 12, 2021
2 parents 71690af + 48186eb commit 5f06d02
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 13 deletions.
16 changes: 16 additions & 0 deletions .prow.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
#! /bin/bash -e

# Copyright 2021 The Kubernetes Authors.
#
# Licensed 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.

# This is for testing csi-release-tools itself in Prow. All other
# repos use prow.sh for that, but as csi-release-tools isn't a normal
# repo with some Go code in it, it has a custom Prow test script.

./verify-shellcheck.sh "$(pwd)"
./verify-spelling.sh "$(pwd)"
./verify-boilerplate.sh "$(pwd)"
2 changes: 1 addition & 1 deletion SIDECAR_RELEASE_PROCESS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The release manager must:
kubernetes/org to request membership
* Be a top level approver for the repository. To become a top level approver,
the candidate must demonstrate ownership and deep knowledge of the repository
through active maintainence, responding to and fixing issues, reviewing PRs,
through active maintenance, responding to and fixing issues, reviewing PRs,
test triage.
* Be part of the maintainers or admin group for the repository. admin is a
superset of maintainers, only maintainers level is required for cutting a
Expand Down
14 changes: 14 additions & 0 deletions cloudbuild.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
#! /bin/bash

# Copyright 2021 The Kubernetes Authors.
#
# Licensed 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.

# shellcheck disable=SC1091
. release-tools/prow.sh

Expand Down
8 changes: 4 additions & 4 deletions prow.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /bin/bash
#

# Copyright 2019 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -73,7 +73,7 @@ configvar CSI_PROW_BUILD_PLATFORMS "linux amd64; windows amd64 .exe; linux ppc64
# which is disabled with GOFLAGS=-mod=vendor).
configvar GOFLAGS_VENDOR "$( [ -d vendor ] && echo '-mod=vendor' )" "Go flags for using the vendor directory"

# Go versions can be specified seperately for different tasks
# Go versions can be specified separately for different tasks
# If the pre-installed Go is missing or a different
# version, the required version here will get installed
# from https://golang.org/dl/.
Expand Down Expand Up @@ -293,7 +293,7 @@ configvar CSI_PROW_E2E_FOCUS_LATEST '\[Feature:VolumeSnapshotDataSource\]' "non-
configvar CSI_PROW_E2E_FOCUS "$(get_versioned_variable CSI_PROW_E2E_FOCUS "${csi_prow_kubernetes_version_suffix}")" "non-alpha, feature-tagged tests"

# Serial vs. parallel is always determined by these regular expressions.
# Individual regular expressions are seperated by spaces for readability
# Individual regular expressions are separated by spaces for readability
# and expected to not contain spaces. Use dots instead. The complete
# regex for Ginkgo will be created by joining the individual terms.
configvar CSI_PROW_E2E_SERIAL '\[Serial\] \[Disruptive\]' "tags for serial E2E tests"
Expand Down Expand Up @@ -998,7 +998,7 @@ make_test_to_junit () {
echo "$line" # pass through
if echo "$line" | grep -q "^### [^ ]*:$"; then
if [ "$testname" ]; then
# previous test succesful
# previous test successful
echo " </system-out>" >>"$out"
echo " </testcase>" >>"$out"
fi
Expand Down
10 changes: 7 additions & 3 deletions verify-boilerplate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,16 @@ if [[ -z "$(command -v python)" ]]; then
update-alternatives --install /usr/bin/python python /usr/bin/python3 1
fi

REPO_ROOT=$(dirname "${BASH_SOURCE[0]}")
# The csi-release-tools directory.
TOOLS="$(dirname "${BASH_SOURCE[0]}")"

boilerDir="${REPO_ROOT}/boilerplate"
# Directory to check. Default is the parent of the tools themselves.
ROOT="${1:-${TOOLS}/..}"

boilerDir="${ROOT}/boilerplate"
boiler="${boilerDir}/boilerplate.py"

files_need_boilerplate=("$("${boiler}" --rootdir="${REPO_ROOT}" --verbose)")
mapfile -t files_need_boilerplate < <("${boiler}" --rootdir="${ROOT}" --verbose)

# Run boilerplate.py unit tests
unitTestOut="$(mktemp)"
Expand Down
10 changes: 6 additions & 4 deletions verify-spelling.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ set -o pipefail

TOOL_VERSION="v0.3.4"

# cd to the root path
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)"
cd "${ROOT}"
# The csi-release-tools directory.
TOOLS="$(dirname "${BASH_SOURCE[0]}")"

# Directory to check. Default is the parent of the tools themselves.
ROOT="${1:-${TOOLS}/..}"

# create a temporary directory
TMP_DIR=$(mktemp -d)
Expand All @@ -42,12 +44,12 @@ if [[ -z "$(command -v misspell)" ]]; then
GO111MODULE=on GOBIN="${TMP_DIR}" go get "github.com/client9/misspell/cmd/misspell@${TOOL_VERSION}"
export PATH="${TMP_DIR}:${PATH}"
fi
cd "${ROOT}"

# check spelling
RES=0
echo "Checking spelling..."
ERROR_LOG="${TMP_DIR}/errors.log"
cd "${ROOT}"
git ls-files | grep -v vendor | xargs misspell > "${ERROR_LOG}"
if [[ -s "${ERROR_LOG}" ]]; then
sed 's/^/error: /' "${ERROR_LOG}" # add 'error' to each line to highlight in e2e status
Expand Down
2 changes: 1 addition & 1 deletion verify-subtree.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /bin/sh -e
#

# Copyright 2019 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down

0 comments on commit 5f06d02

Please sign in to comment.