Skip to content

Add copyright #391

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 3, 2021
Merged
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
2 changes: 1 addition & 1 deletion tools/gen-release-vote.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def gitHashes(components):
return '\n'.join(list(s))

def rcverify(components, version):
s = map(lambda r: "./rcverify.sh %s '%s' %s %s" % (r.id, r.name, version.v, version.rc), components)
s = map(lambda r: "./rcverify.sh %s %s %s" % (r.id, version.v, version.rc), components)
return '\n'.join(list(s))

def releaseVersion(config):
Expand Down
4 changes: 1 addition & 3 deletions tools/local_verify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,5 @@ source "$SCRIPTDIR/load_config.sh" "$1"
for repo in $(echo $repos | sed "s/,/ /g")
do
repo_name=$(echo "$repo" | sed -e 's/^"//' -e 's/"$//')
NAME_KEY=${repo_name//-/_}.name
NAME=$(json_by_key "$CONFIG" $NAME_KEY)
LOCAL_DIR="$OPENWHISK_ARTIFACT_DIR" DL=0 "$SCRIPTDIR"/rcverify.sh $repo_name "$NAME" $version $pre_release_version
LOCAL_DIR="$OPENWHISK_ARTIFACT_DIR" DL=0 "$SCRIPTDIR"/rcverify.sh $repo_name $version $pre_release_version
done
37 changes: 23 additions & 14 deletions tools/rcverify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,14 @@ KEYS_DIST=https://dist.apache.org/repos/dist/release/openwhisk
# the artifact being released
NAME=${1?"missing artifact name e.g., openwhisk-client-js"}

# the name of the project (to match what is in the NOTICE file)
DESCRIPTION=${2?"missing project description e.g., 'OpenWhisk JavaScript Client Library'"}

# the version of the release artifact
V=${3?"missing version e.g., '3.19.0'"}
V=${2?"missing version e.g., '3.19.0'"}

# the release candidate, usually 'rc1'
RC=${4:-rc1}
RC=${3:-rc1}

# the last argument is optional and if set to 'cleanup', the script deletes the scratch space at completion
REMOVE_DIR=${5:-cleanup}
REMOVE_DIR=${4:-cleanup}

# set to non-zero to download the artifacts to verify, this is the default
DL=${DL:-1}
Expand Down Expand Up @@ -67,14 +64,11 @@ TGZ=$NAME-$V-sources.tar.gz
# this is a constructed name for the keys file
KEYS=$RC-$V-KEYS

NOTICE=$(cat << END
Apache $DESCRIPTION
Copyright 2016-2021 The Apache Software Foundation
NOTICE_REGEX='^Apache .+
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a positive change - thanks for improving the checks.
Removing the component description from the check could lead to an error where someone copies the notice file from one repo and forgets to update the name. Will have to be diligent about this.

It's nice to have one fewer argument to rcverify.

Copyright [0-9]{4}-2021 The Apache Software Foundation

This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
END
)
The Apache Software Foundation \(http:\/\/www\.apache\.org\/\)\.$'

echo "$(basename $0) (script SHA1: $(gpg --print-md SHA1 $0 | cut -d' ' -f2-))"

Expand Down Expand Up @@ -183,6 +177,21 @@ function analyzeKeyImport() {
fi
}

function validateNotice() {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested all NOTICE.txt files in all repos, and confirmed it works as expected.
But it would be great if anyone cross-checks again.

Some of them require changes so I opened a couple of corresponding PRs.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thank you @style95

output=$1
if [[ "$output" =~ $NOTICE_REGEX ]]; then
printf " $(tput setaf 2)passed$(tput sgr0)\n"
else
ERROR=1
printf " $(tput setaf 1)failed$(tput sgr0)"
if [[ $2 != "" ]]; then
echo " ($2)"
else
printf "\n"
fi
fi
}

if [ $DL -ne 0 ]; then
SRC=$RC_DIST/$RC
echo fetching tarball and signatures from $SRC
Expand Down Expand Up @@ -258,8 +267,8 @@ fi
validate $STATUS 0 "$CMD" "signed-by: $SIGNER"

printf "verifying notice..."
NTXT=$(cat "$DIR/$BASE/NOTICE.txt")
validate "$NOTICE" "$NTXT" "cat '$DIR/$BASE/NOTICE.txt'"
NOTICE=$(cat "$DIR/$BASE/NOTICE.txt")
validateNotice "$NOTICE" "cat '$DIR/$BASE/NOTICE.txt'"

printf "verifying absence of DISCLAIMER.txt"
CMD="test -f '$DIR/$BASE/DISCLAIMER.txt'"
Expand Down