From 53b0661cbbe705901d7a891c9c6ba34a42f07427 Mon Sep 17 00:00:00 2001 From: Mick Semb Wever Date: Fri, 2 Apr 2021 12:08:44 +0200 Subject: [PATCH] Fix rat checking for files with missing license headers patch by Mick Semb Wever; reviewed by Brandon Williams, Ekaterina Dimitrova for CASSANDRA-16558 --- .build/build-rat.xml | 94 +++++++++++++++++++ .circleci/config-2_1.yml | 18 ++++ .circleci/config.yml | 18 ++++ .circleci/generate.sh | 17 ++++ .circleci/readme.md | 20 ++++ .gitignore | 9 +- .rat-excludes | 34 ------- CONTRIBUTING.md | 20 ++++ build.xml | 91 +----------------- debian/cassandra.in.sh | 17 ++++ doc/cql3/CQL.textile | 20 ++++ doc/native_protocol_v1.spec | 17 ++++ doc/native_protocol_v2.spec | 17 ++++ doc/native_protocol_v3.spec | 17 ++++ doc/native_protocol_v4.spec | 17 ++++ pylib/cqlshlib/test/test_keyspace_init.cql | 18 ++++ redhat/README.md | 20 ++++ redhat/cassandra.in.sh | 17 ++++ redhat/cassandra.spec | 18 ++++ test/conf/cassandra_pig.yaml | 18 ++++ test/conf/commitlog_compression.yaml | 18 ++++ test/resources/byteman/stream_failure.btm | 17 ++++ .../apache/cassandra/stress/WorkManager.java | 17 ++++ 23 files changed, 446 insertions(+), 123 deletions(-) create mode 100644 .build/build-rat.xml delete mode 100644 .rat-excludes diff --git a/.build/build-rat.xml b/.build/build-rat.xml new file mode 100644 index 0000000000..81f2b94a31 --- /dev/null +++ b/.build/build-rat.xml @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.circleci/config-2_1.yml b/.circleci/config-2_1.yml index fc54607ed0..a35be2328d 100644 --- a/.circleci/config-2_1.yml +++ b/.circleci/config-2_1.yml @@ -1,3 +1,21 @@ +# +# 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. +# + version: 2.1 default_env_vars: &default_env_vars diff --git a/.circleci/config.yml b/.circleci/config.yml index 8627e96684..acfd6c9c4b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,3 +1,21 @@ +# +# 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. +# + version: 2 jobs: build: diff --git a/.circleci/generate.sh b/.circleci/generate.sh index f3f4361b15..0ba497b2d1 100755 --- a/.circleci/generate.sh +++ b/.circleci/generate.sh @@ -1,4 +1,21 @@ #!/bin/sh +# +# 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. +# BASEDIR=`dirname $0` diff --git a/.circleci/readme.md b/.circleci/readme.md index 965eaf7450..b3d5ab009d 100644 --- a/.circleci/readme.md +++ b/.circleci/readme.md @@ -1,3 +1,23 @@ + + # CircleCI config files ## Switching to high resource settings diff --git a/.gitignore b/.gitignore index 895483160c..cc25cbc77f 100644 --- a/.gitignore +++ b/.gitignore @@ -71,4 +71,11 @@ lib/jsr223/jython/*.jar lib/jsr223/jython/cachedir lib/jsr223/scala/*.jar -.ant_targets \ No newline at end of file +.ant_targets + +# Python virtual environment +venv/ + +# build-scripts will put cassandra-builds and cassandra-dtest into the directory +cassandra-builds/ +cassandra-dtest/ diff --git a/.rat-excludes b/.rat-excludes deleted file mode 100644 index d95b499154..0000000000 --- a/.rat-excludes +++ /dev/null @@ -1,34 +0,0 @@ -**/*.avpr -debian/** -.classpath -.rat-excludes -**/.project -**/.pydevproject -CHANGES.txt -README.asc -.git/** -**/*.json -**/*.patch -interface/*/gen-*/** -src/gen-java/** -build/** -lib/licenses/*.txt -.settings/** -**/cassandra.yaml -**/cassandra-topology.yaml -**/metrics-reporter-config-sample.yaml -**/*.db -.externalToolBuilders/** -test/data/serialization/*/* -**/*.wpr -doc/** -build.properties.default -test/data/** -examples/pig/** -examples/triggers/build.xml -examples/triggers/conf/* -examples/hadoop_word_count/conf/log4j.properties -pylib/cqlshlib/test/** -src/resources/org/apache/cassandra/config/version.properties -conf/hotspot_compiler -**/*-example.yaml diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8366579ad2..2251fdf5db 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,3 +1,23 @@ + + # Apache Cassandra and Pull Requests Apache Cassandra doesn't use GitHub pull requests as part of the development process. diff --git a/build.xml b/build.xml index 95f85c05a9..52ba87f6dd 100644 --- a/build.xml +++ b/build.xml @@ -779,20 +779,6 @@ - - - - - - - - - - - - - Generating Thrift Python code from ${basedir}/interface/cassandra.thrift... @@ -836,7 +822,7 @@ depends="maven-ant-tasks-retrieve-build,build-project" description="Compile Cassandra classes"/> - @@ -1204,43 +1190,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Unknown licenses: See build/rat-report.log. - - - - RAT: invoking addLicense to write missing headers - - - - - - - - @@ -2130,4 +2043,6 @@ + + diff --git a/debian/cassandra.in.sh b/debian/cassandra.in.sh index 9f69ac9490..2d15c0172c 100644 --- a/debian/cassandra.in.sh +++ b/debian/cassandra.in.sh @@ -1,3 +1,20 @@ +# +# 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. +# # The directory where Cassandra's configs live (required) CASSANDRA_CONF=/etc/cassandra diff --git a/doc/cql3/CQL.textile b/doc/cql3/CQL.textile index 33db748b93..b689532a7a 100644 --- a/doc/cql3/CQL.textile +++ b/doc/cql3/CQL.textile @@ -1,3 +1,23 @@ + + h1. Cassandra Query Language (CQL) v3.3.1 diff --git a/doc/native_protocol_v1.spec b/doc/native_protocol_v1.spec index 9c9b6b52ce..c85ca6c647 100644 --- a/doc/native_protocol_v1.spec +++ b/doc/native_protocol_v1.spec @@ -1,3 +1,20 @@ +# +# 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. +# CQL BINARY PROTOCOL v1 diff --git a/doc/native_protocol_v2.spec b/doc/native_protocol_v2.spec index b9cc51f7c0..dbdfb55799 100644 --- a/doc/native_protocol_v2.spec +++ b/doc/native_protocol_v2.spec @@ -1,3 +1,20 @@ +# +# 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. +# CQL BINARY PROTOCOL v2 diff --git a/doc/native_protocol_v3.spec b/doc/native_protocol_v3.spec index 087e138efe..36bb9355e0 100644 --- a/doc/native_protocol_v3.spec +++ b/doc/native_protocol_v3.spec @@ -1,3 +1,20 @@ +# +# 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. +# CQL BINARY PROTOCOL v3 diff --git a/doc/native_protocol_v4.spec b/doc/native_protocol_v4.spec index 07ddea54ee..5f1d498511 100644 --- a/doc/native_protocol_v4.spec +++ b/doc/native_protocol_v4.spec @@ -1,3 +1,20 @@ +# +# 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. +# CQL BINARY PROTOCOL v4 diff --git a/pylib/cqlshlib/test/test_keyspace_init.cql b/pylib/cqlshlib/test/test_keyspace_init.cql index c64163a8ef..06f087b8b2 100644 --- a/pylib/cqlshlib/test/test_keyspace_init.cql +++ b/pylib/cqlshlib/test/test_keyspace_init.cql @@ -1,3 +1,21 @@ +/* +# 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. +*/ + CREATE TABLE has_all_types ( num int PRIMARY KEY, intcol int, diff --git a/redhat/README.md b/redhat/README.md index cab42a752e..a1f6f15e7e 100644 --- a/redhat/README.md +++ b/redhat/README.md @@ -1,3 +1,23 @@ + + # Apache Cassandra rpmbuild ### Requirements: diff --git a/redhat/cassandra.in.sh b/redhat/cassandra.in.sh index ca71782093..d4cf3d6d25 100644 --- a/redhat/cassandra.in.sh +++ b/redhat/cassandra.in.sh @@ -1,3 +1,20 @@ +# +# 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. +# # The directory where Cassandra's configs live (required) CASSANDRA_CONF=/etc/cassandra/conf diff --git a/redhat/cassandra.spec b/redhat/cassandra.spec index 73d4a425fb..91115e8c63 100644 --- a/redhat/cassandra.spec +++ b/redhat/cassandra.spec @@ -1,3 +1,21 @@ +# +# 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. +# + %define __jar_repack %{nil} # Turn off the brp-python-bytecompile script %global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g') diff --git a/test/conf/cassandra_pig.yaml b/test/conf/cassandra_pig.yaml index 68615cfaa0..9175456283 100644 --- a/test/conf/cassandra_pig.yaml +++ b/test/conf/cassandra_pig.yaml @@ -1,3 +1,21 @@ +# +# 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. +# + # # Warning! # Consider the effects on 'o.a.c.i.s.LegacySSTableTest' before changing schemas in this file. diff --git a/test/conf/commitlog_compression.yaml b/test/conf/commitlog_compression.yaml index 9849d7b15c..d909904477 100644 --- a/test/conf/commitlog_compression.yaml +++ b/test/conf/commitlog_compression.yaml @@ -1,2 +1,20 @@ +# +# 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. +# + commitlog_compression: - class_name: LZ4Compressor diff --git a/test/resources/byteman/stream_failure.btm b/test/resources/byteman/stream_failure.btm index e40f7fe25e..be4f0e58e6 100644 --- a/test/resources/byteman/stream_failure.btm +++ b/test/resources/byteman/stream_failure.btm @@ -1,4 +1,21 @@ # +# 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. +# +# # Inject streaming failure # # Before start streaming files in `StreamSession#prepare()` method, diff --git a/tools/stress/src/org/apache/cassandra/stress/WorkManager.java b/tools/stress/src/org/apache/cassandra/stress/WorkManager.java index c6a3eee769..93b9835b9e 100644 --- a/tools/stress/src/org/apache/cassandra/stress/WorkManager.java +++ b/tools/stress/src/org/apache/cassandra/stress/WorkManager.java @@ -1,3 +1,20 @@ +/* + * 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.cassandra.stress; import java.util.concurrent.atomic.AtomicLong;