This is an automated email from the ASF dual-hosted git repository.
spacewander pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git
The following commit(s) were added to refs/heads/master by this push:
new b8ae382 ci: use a new license checker (#4872)
b8ae382 is described below
commit b8ae382cd0ae18dfe3dce5f3c0626fb62e894610
Author: 罗泽轩 <[email protected]>
AuthorDate: Tue Aug 24 09:47:51 2021 +0800
ci: use a new license checker (#4872)
---
.github/workflows/license-checker.yml | 38 ++++++++++++
.github/workflows/lint.yml | 3 -
.gitignore | 14 ++---
.licenserc.yaml | 44 +++++++++++++
Makefile | 6 +-
ci/ASF-Release.cfg | 113 ----------------------------------
ci/linux_openresty_common_runner.sh | 3 -
7 files changed, 90 insertions(+), 131 deletions(-)
diff --git a/.github/workflows/license-checker.yml
b/.github/workflows/license-checker.yml
new file mode 100644
index 0000000..586c7a9
--- /dev/null
+++ b/.github/workflows/license-checker.yml
@@ -0,0 +1,38 @@
+#
+# 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.
+#
+name: License checker
+
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+ branches:
+ - master
+
+jobs:
+ check-license:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: Check License Header
+ uses: apache/[email protected]
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index f0f83cd..1c8436f 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -25,9 +25,6 @@ jobs:
- name: Merge conflict
run: |
grep "^<<<<<<< HEAD" $(git ls-files | grep -v "t/toolkit" | xargs)
&& exit 1 || true
- - name: License
- run: |
- make license-check
- name: Plugin Code
run: |
sudo bash ./utils/check-plugins-code.sh
diff --git a/.gitignore b/.gitignore
index c06fa2c..512423b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -61,16 +61,16 @@ t/lib/dubbo-backend/dubbo-backend-provider/target/
*.iml
\.*
!.github/
-ci/openwhisk-utilities/
!.gitmodules
!.markdownlint.yml
!.yamllint
-/conf/apisix.yaml
-/conf/apisix-*.yaml
-/conf/config-*.yaml
-!/conf/config-default.yaml
-/conf/debug-*.yaml
-/build-cache/
+!.licenserc.yaml
+conf/apisix.yaml
+conf/apisix-*.yaml
+conf/config-*.yaml
+!conf/config-default.yaml
+conf/debug-*.yaml
+build-cache/
t/fuzzing/__pycache__/
boofuzz-results/
*.pyc
diff --git a/.licenserc.yaml b/.licenserc.yaml
new file mode 100644
index 0000000..acebab5
--- /dev/null
+++ b/.licenserc.yaml
@@ -0,0 +1,44 @@
+#
+# 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.
+#
+header:
+ license:
+ spdx-id: Apache-2.0
+ copyright-owner: Apache Software Foundation
+
+ paths-ignore:
+ - '.gitignore'
+ - 'LICENSE'
+ - 'NOTICE'
+ - '**/*.json'
+ - '**/*.key'
+ - '**/*.crt'
+ - '**/*.pem'
+ - '.github/'
+ - 'conf/mime.types'
+ # eyes has some limitation to handle git pattern
+ - '**/*.log'
+ # Exclude test toolkit files
+ - 't/toolkit'
+ - 't/chaos/go.mod'
+ - 't/chaos/go.sum'
+ # Exclude non-Apache licensed files
+ - 'apisix/balancer/ewma.lua'
+ # Exclude plugin-specific configuration files
+ - 't/plugin/authz-casbin'
+ - 't/coredns'
+
+ comment: on-failure
diff --git a/Makefile b/Makefile
index 4afde2f..9a9bdab 100644
--- a/Makefile
+++ b/Makefile
@@ -261,11 +261,7 @@ test:
### license-check: Check Lua source code for Apache License
.PHONY: license-check
license-check:
-ifeq ("$(wildcard ci/openwhisk-utilities/scancode/scanCode.py)", "")
- git clone https://github.com/apache/openwhisk-utilities.git
ci/openwhisk-utilities
- cp ci/ASF* ci/openwhisk-utilities/scancode/
-endif
- ci/openwhisk-utilities/scancode/scanCode.py --config ci/ASF-Release.cfg
./
+ docker run -it --rm -v $(shell pwd):/github/workspace
apache/skywalking-eyes header check
.PHONY: release-src
release-src: compress-tar
diff --git a/ci/ASF-Release.cfg b/ci/ASF-Release.cfg
deleted file mode 100644
index e00acac..0000000
--- a/ci/ASF-Release.cfg
+++ /dev/null
@@ -1,113 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
contributor
-# license agreements; and to You under the Apache License, Version 2.0.
-
-# scanCode.py configuration file
-
-# List of filenames containing the text of valid license (headers)
-# These files SHOULD be in the same directory path where scanCode.py
-# resides.
-[Licenses]
-ASFLicenseHeader.txt
-ASFLicenseHeaderBash.txt
-ASFLicenseHeaderMarkdown.txt
-ASFLicenseHeaderLua.txt
-
-# Filters (path/filename) with wildcards and associated scan checks
-# that are to be run against them. The checks are actual valid
-# function names found in scanCode.py.
-[Includes]
-*=is_not_symlink, regex_check
-*.conf=has_block_license, eol_at_eof, regex_check
-*.go=has_block_license, no_trailing_spaces, eol_at_eof, regex_check
-*.gradle=has_block_license, no_trailing_spaces, eol_at_eof, regex_check
-*.groovy=has_block_license, no_trailing_spaces, eol_at_eof, regex_check
-*.html=has_block_license, regex_check
-*.java=no_tabs, has_block_license, no_trailing_spaces, eol_at_eof, regex_check
-*.js=has_block_license, regex_check
-*.lua=has_block_license, no_trailing_spaces, eol_at_eof, regex_check
-*.md=no_tabs, has_block_license, no_trailing_spaces, eol_at_eof, regex_check
-*.properties=no_tabs, has_block_license, no_trailing_spaces, eol_at_eof,
regex_check
-*.py=no_tabs, has_block_license, no_trailing_spaces, eol_at_eof, regex_check
-*.scala=has_block_license, no_tabs, no_trailing_spaces, eol_at_eof, regex_check
-*.sh=has_block_license, no_trailing_spaces, eol_at_eof, regex_check
-*.swift=no_tabs, has_block_license, no_trailing_spaces, eol_at_eof, regex_check
-*.yaml=has_block_license, no_trailing_spaces, eol_at_eof, regex_check
-*.yml=has_block_license, no_trailing_spaces, eol_at_eof, regex_check
-*.css=has_block_license, regex_check
-*Dockerfile*=has_block_license, no_trailing_spaces
-
-# for test case files of test::nginx
-*.t=has_block_license, eol_at_eof, regex_check
-*.pm=has_block_license, no_trailing_spaces, eol_at_eof, regex_check
-
-# for APISIX CLI
-*/bin/apisix=has_block_license, no_trailing_spaces, eol_at_eof, regex_check
-
-# for luarocks spec files
-*.rockspec=has_block_license, no_trailing_spaces, eol_at_eof, regex_check
-
-# Sanity check files not required to have ASF headers because either they
-# are excluded or are not packaged with the Apache source release.
-*.cfg=regex_check
-*.ini=regex_check
-*.j2=regex_check
-*.json=regex_check
-*.txt=regex_check
-*.xml=regex_check
-
-# List of paths (inclusive of subdirectories) to exclude from code scanning
-[Excludes]
-
-# General tooling & binary file exclusions
-.bin
-.dockerignore
-.eslintrc.*
-.git
-.gitattributes
-.github
-.gitignore
-.gradle
-.idea
-.jshintrc
-.pydevproject
-.rat-excludes
-.tox
-
-# Exclude Apache standard legal files
-CREDITS.txt
-DISCLAIMER.txt
-LICENSE*.txt
-NOTICE.txt
-
-# Exclude CI files
-build-cache
-deps
-test-nginx
-grpc_server_example
-grpcurl
-t/servroot
-t/lib/dubbo-backend/dubbo-backend-provider/target
-t/lib/dubbo-backend/dubbo-backend-interface/target
-html
-
-conf
-ci/openwhisk-utilities
-
-# Exclude test toolkit files
-t/toolkit
-
-# Exclude subcomponents files
-apisix/balancer/ewma.lua
-
-# Exclude plugin-specific configuration files
-t/plugin/authz-casbin
-
-[Options]
-# Not all code files allow licenses to appear starting at the first character
-# of the file. This option tells the scan to allow licenses to appear starting
-# within the first 'x' characters of each code file (as provided by this
option's
-# value).
-LICENSE_SLACK_LENGTH=500
-
-# List of regular expressions for forbidden strings, e.g. \[email protected]
-[Regex]
diff --git a/ci/linux_openresty_common_runner.sh
b/ci/linux_openresty_common_runner.sh
index b16f077..b546c06 100755
--- a/ci/linux_openresty_common_runner.sh
+++ b/ci/linux_openresty_common_runner.sh
@@ -41,9 +41,6 @@ do_install() {
git clone https://github.com/iresty/test-nginx.git test-nginx
make utils
- git clone https://github.com/apache/openwhisk-utilities.git
ci/openwhisk-utilities
- cp ci/ASF* ci/openwhisk-utilities/scancode/
-
mkdir -p build-cache
if [ ! -f "build-cache/grpc_server_example_$GRPC_SERVER_EXAMPLE_VER" ];
then
wget
https://github.com/api7/grpc_server_example/releases/download/"$GRPC_SERVER_EXAMPLE_VER"/grpc_server_example-amd64.tar.gz