From abaecf2f284c09d385f3ddd82fd712b8bda1a3c2 Mon Sep 17 00:00:00 2001 From: Yong Zhang Date: Fri, 5 Mar 2021 15:46:34 +0800 Subject: [PATCH 1/4] [CI] Add apache-rat check in Ci --- *Motivation* Add apache-rat check in CI for checking the src license header. --- .github/workflows/ci-license.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/ci-license.yaml b/.github/workflows/ci-license.yaml index 461b73cc53565..f36c8165c20ad 100644 --- a/.github/workflows/ci-license.yaml +++ b/.github/workflows/ci-license.yaml @@ -78,3 +78,13 @@ jobs: - name: license check if: steps.docs.outputs.changed_only == 'no' run: src/check-binary-license ./distribution/server/target/apache-pulsar-*-bin.tar.gz + + - name: license headers check in src package + if: steps.docs.outputs.changed_only == 'no' + run: | + version=`src/get-project-version.py` + cd distribution/server/target + tar -xf apache-pulsar-${version}-src.tar.gz + cd apache-pulsar-${version} + mvn apache-rat:check + From 4b87c7861d3ac350637c858e9119e18688e0faa4 Mon Sep 17 00:00:00 2001 From: Yong Zhang Date: Fri, 5 Mar 2021 18:17:39 +0800 Subject: [PATCH 2/4] Fix the apache-rat include and exclude file --- .github/workflows/ci-license.yaml | 12 +----- pom.xml | 63 +++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci-license.yaml b/.github/workflows/ci-license.yaml index f36c8165c20ad..afc647b93f015 100644 --- a/.github/workflows/ci-license.yaml +++ b/.github/workflows/ci-license.yaml @@ -73,18 +73,8 @@ jobs: - name: build and check license if: steps.docs.outputs.changed_only == 'no' - run: mvn -q -B -ntp -DskipTests initialize license:check install + run: mvn -q -B -ntp -DskipTests apache-rat:check initialize license:check install - name: license check if: steps.docs.outputs.changed_only == 'no' run: src/check-binary-license ./distribution/server/target/apache-pulsar-*-bin.tar.gz - - - name: license headers check in src package - if: steps.docs.outputs.changed_only == 'no' - run: | - version=`src/get-project-version.py` - cd distribution/server/target - tar -xf apache-pulsar-${version}-src.tar.gz - cd apache-pulsar-${version} - mvn apache-rat:check - diff --git a/pom.xml b/pom.xml index 0e7e935a1f6c5..2a49eb75b222d 100644 --- a/pom.xml +++ b/pom.xml @@ -1302,6 +1302,23 @@ flexible messaging model and an intuitive client API. org.apache.rat apache-rat-plugin + + **/README.md + **/LICENSE + **/NOTICE + **/pom.xml + **/src/** + **/pulsar-client-cpp/** + **/pulsar-client-go/** + **/pulsar-function-go/** + **/conf/** + **/bin/** + **/*.txt + pulsar-common/*.sh + docker/** + dashboard/** + deployment/** + licenses/LICENSE-*.txt @@ -1385,6 +1402,52 @@ flexible messaging model and an intuitive client API. **/.helmignore **/_helpers.tpl + + + .git/** + **/*.nar + **/.terraform/** + **/.gitignore + **/.svn + **/*.iws + **/*.ipr + **/*.iml + **/*.cbp + **/*.pyc + **/.classpath + **/.project + **/.settings + **/target/** + **/CMakeFiles/** + **/CMakeCache.txt + **/cmake_install.cmake + pulsar-client-cpp/**/Makefile + pulsar-client-cpp/tests/main + pulsar-client-cpp/examples/SampleAsyncProducer + pulsar-client-cpp/examples/SampleConsumer + pulsar-client-cpp/examples/SampleConsumerListener + pulsar-client-cpp/examples/SampleProducer + pulsar-client-cpp/perf/perfProducer + pulsar-client-cpp/perf/perfConsumer + **/python/dist/** + **/pulsar-client-cpp/pkg/rpm/RPMS/** + **/pulsar-client-cpp/pkg/rpm/SOURCES/** + **/pulsar-client-cpp/pkg/deb/BUILD/** + **/python/wheelhouse/** + **/python/MANIFEST + **/*.egg-info/** + + **/*.log + **/build/** + **/file:/** + **/SecurityAuth.audit* + **/site2/** + **/.idea/** + **/*.a + **/*.so + **/*.so.* + **/*.dylib + From 318778c0c4a141f5db72db7ee0641a9d624c5513 Mon Sep 17 00:00:00 2001 From: Yong Zhang Date: Fri, 5 Mar 2021 21:07:42 +0800 Subject: [PATCH 3/4] only use exclude for the apache-rat --- pom.xml | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/pom.xml b/pom.xml index 2a49eb75b222d..f5b5b1b519fba 100644 --- a/pom.xml +++ b/pom.xml @@ -1302,23 +1302,6 @@ flexible messaging model and an intuitive client API. org.apache.rat apache-rat-plugin - - **/README.md - **/LICENSE - **/NOTICE - **/pom.xml - **/src/** - **/pulsar-client-cpp/** - **/pulsar-client-go/** - **/pulsar-function-go/** - **/conf/** - **/bin/** - **/*.txt - pulsar-common/*.sh - docker/** - dashboard/** - deployment/** - licenses/LICENSE-*.txt @@ -1404,7 +1387,8 @@ flexible messaging model and an intuitive client API. **/_helpers.tpl - .git/** + *.md + .github/** **/*.nar **/.terraform/** **/.gitignore From e690dc37b627c9505557ed4beb37105fc1001d41 Mon Sep 17 00:00:00 2001 From: Yong Zhang Date: Sat, 6 Mar 2021 10:14:12 +0800 Subject: [PATCH 4/4] Fix the ci --- pom.xml | 2 +- .../scripts/python/setup.py.template | 19 +++++++++++++++++++ tests/certificate-authority/index.txt.attr | 1 - .../certificate-authority/index.txt.attr.old | 1 - tests/certificate-authority/index.txt.old | 5 ----- tests/certificate-authority/serial.old | 1 - 6 files changed, 20 insertions(+), 9 deletions(-) delete mode 100644 tests/certificate-authority/index.txt.attr delete mode 100644 tests/certificate-authority/index.txt.attr.old delete mode 100644 tests/certificate-authority/index.txt.old delete mode 100644 tests/certificate-authority/serial.old diff --git a/pom.xml b/pom.xml index dd2ac372599bd..1d564580548e3 100644 --- a/pom.xml +++ b/pom.xml @@ -1369,6 +1369,7 @@ flexible messaging model and an intuitive client API. src/test/resources/athenz.conf.test deployment/terraform-ansible/templates/myid certificate-authority/index.txt + certificate-authority/serial certificate-authority/README.md @@ -1419,7 +1420,6 @@ flexible messaging model and an intuitive client API. **/python/wheelhouse/** **/python/MANIFEST **/*.egg-info/** - **/*.log **/build/** **/file:/** diff --git a/pulsar-functions/scripts/python/setup.py.template b/pulsar-functions/scripts/python/setup.py.template index ec36403e0f897..502fa91e5dae3 100644 --- a/pulsar-functions/scripts/python/setup.py.template +++ b/pulsar-functions/scripts/python/setup.py.template @@ -1,3 +1,22 @@ +# +# 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. +# + """pulsar functions setuptools based setup module""" import os, re, sys from setuptools import setup, find_packages diff --git a/tests/certificate-authority/index.txt.attr b/tests/certificate-authority/index.txt.attr deleted file mode 100644 index 8f7e63a3475ce..0000000000000 --- a/tests/certificate-authority/index.txt.attr +++ /dev/null @@ -1 +0,0 @@ -unique_subject = yes diff --git a/tests/certificate-authority/index.txt.attr.old b/tests/certificate-authority/index.txt.attr.old deleted file mode 100644 index 8f7e63a3475ce..0000000000000 --- a/tests/certificate-authority/index.txt.attr.old +++ /dev/null @@ -1 +0,0 @@ -unique_subject = yes diff --git a/tests/certificate-authority/index.txt.old b/tests/certificate-authority/index.txt.old deleted file mode 100644 index 4d69c9bb037e6..0000000000000 --- a/tests/certificate-authority/index.txt.old +++ /dev/null @@ -1,5 +0,0 @@ -V 22920406085532Z 1000 unknown /CN=broker.pulsar.apache.org -V 22920406085706Z 1001 unknown /CN=admin -V 210318101354Z 1002 unknown /CN=ivan -V 22920409135604Z 1003 unknown /CN=proxy -V 22920410132517Z 1004 unknown /CN=superproxy diff --git a/tests/certificate-authority/serial.old b/tests/certificate-authority/serial.old deleted file mode 100644 index 49bc2728c7a08..0000000000000 --- a/tests/certificate-authority/serial.old +++ /dev/null @@ -1 +0,0 @@ -1005