Skip to content
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

Add copyright #391

Merged
merged 6 commits into from
Jun 3, 2021
Merged

Add copyright #391

merged 6 commits into from
Jun 3, 2021

Conversation

style95
Copy link
Member

@style95 style95 commented May 31, 2021

This it to make the copyright year configurable.

@@ -94,7 +96,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 %s %s" % (r.id, r.name, version.v, version.rc, r.copyright), components)
Copy link
Member Author

Choose a reason for hiding this comment

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

It generates the usage like this:

Usage:
curl -s "https://gitbox.apache.org/repos/asf?p=openwhisk-release.git;a=blob_plain;f=tools/rcverify.sh;hb=12cc460" -o rcverify.sh
chmod +x rcverify.sh
./rcverify.sh openwhisk-vscode-extension 'OpenWhisk VSCode Extension' 1.1.0 rc1 2020-2021

if [ ! -n "$COPYRIGHT" ]
then
echo "no copyright year provided, fallback to the default: 2016-2020"
COPYRIGHT="2016-2020"
Copy link
Member Author

Choose a reason for hiding this comment

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

If no copyright year is provided it will be used.

@@ -69,7 +72,7 @@ KEYS=$RC-$V-KEYS

NOTICE=$(cat << END
Apache $DESCRIPTION
Copyright 2016-2021 The Apache Software Foundation
Copyright $COPYRIGHT The Apache Software Foundation
Copy link
Member Author

Choose a reason for hiding this comment

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

@style95 style95 requested review from dgrove-oss and rabbah and removed request for dgrove-oss May 31, 2021 05:57
@dgrove-oss
Copy link
Member

What we really should be scanning for is a copyright of the form:

Copyright 20NN-2021 The Apache Software Foundation

Where NN are any number that is <= the end year (21).

It's important that we check for the end year being the same as the current year; we don't want to make that configurable

Copy link
Member

@dgrove-oss dgrove-oss left a comment

Choose a reason for hiding this comment

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

Having the end year of the copyright be configurable is not desirable; will lead to failure to update the end year when making a release

@style95
Copy link
Member Author

style95 commented Jun 1, 2021

@dgrove-oss Now only the starting year is configurable.

Copy link
Member

@dgrove-oss dgrove-oss left a comment

Choose a reason for hiding this comment

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

Thanks; this will work.

It would be nice if we used a regex to validate the NOTICE file so we could avoid specifying both the r.name and r.copyright, but that's more work than needs to be done to unblock the ide-plugin releases.

@style95 style95 added the WIP label Jun 2, 2021
@style95 style95 removed the WIP label Jun 2, 2021
@@ -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

@style95 style95 merged commit 27769a9 into apache:master Jun 3, 2021
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants