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-python-plugin-runner.git
The following commit(s) were added to refs/heads/master by this push:
new b0ccefe ci: add license checker (#20)
b0ccefe is described below
commit b0ccefed021d025b5e91c673e017cbe3dd4e09b5
Author: 帅进超 <[email protected]>
AuthorDate: Wed Aug 18 10:27:46 2021 +0800
ci: add license checker (#20)
---
.../{runner-lint.yml => runner-license.yml} | 19 ++++++++---------
.github/workflows/runner-lint.yml | 2 +-
apisix/plugins/say.py => .licenserc.yaml | 24 ++++++++++++----------
README.md | 5 +++--
apisix/plugins/say.py | 1 +
pytest.ini | 1 +
tests/conftest.py | 17 +++++++++++++++
7 files changed, 44 insertions(+), 25 deletions(-)
diff --git a/.github/workflows/runner-lint.yml
b/.github/workflows/runner-license.yml
similarity index 76%
copy from .github/workflows/runner-lint.yml
copy to .github/workflows/runner-license.yml
index e460ca9..f8527b0 100644
--- a/.github/workflows/runner-lint.yml
+++ b/.github/workflows/runner-license.yml
@@ -17,7 +17,7 @@
# under the License.
#
-name: Runner Lint Check
+name: Runner License Checker
on:
push:
@@ -26,17 +26,14 @@ on:
pull_request:
branches:
- master
+
jobs:
Run:
runs-on: ubuntu-latest
+
steps:
- - name: Checkout source codes
- uses: actions/checkout@v2
- with:
- submodules: true
- - name: Set up Python
- uses: actions/setup-python@v2
- with:
- python-version: 3.6
- - name: Lint codes
- run: make lint
+ - uses: actions/checkout@v2
+ - name: Check License Header
+ uses: apache/[email protected]
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/runner-lint.yml
b/.github/workflows/runner-lint.yml
index e460ca9..6222861 100644
--- a/.github/workflows/runner-lint.yml
+++ b/.github/workflows/runner-lint.yml
@@ -17,7 +17,7 @@
# under the License.
#
-name: Runner Lint Check
+name: Runner Lint Checker
on:
push:
diff --git a/apisix/plugins/say.py b/.licenserc.yaml
similarity index 62%
copy from apisix/plugins/say.py
copy to .licenserc.yaml
index 5dd1608..66451b4 100644
--- a/apisix/plugins/say.py
+++ b/.licenserc.yaml
@@ -14,17 +14,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-from apisix.runner.plugin.base import Base
-from apisix.runner.http.request import Request
-from apisix.runner.http.response import Response
+header:
+ license:
+ spdx-id: Apache-2.0
+ copyright-owner: Apache Software Foundation
-class Say(Base):
- def __init__(self):
- super(Say, self).__init__(self.__class__.__name__)
+ paths-ignore:
+ - '.gitignore'
+ - '.pytest_cache/**'
+ - 'LICENSE'
+ - 'NOTICE'
+ - 'pytest.ini'
+ - '**/__pycache__/**'
+ - '**/images/**'
- def filter(self, request: Request, response: Response):
- headers = request.headers
- headers["X-Resp-A6-Runner"] = "Python"
- response.body = "Hello, Python Runner of APISIX"
- response.headers = headers
+ comment: on-failure
diff --git a/README.md b/README.md
index 014165a..accdcfe 100644
--- a/README.md
+++ b/README.md
@@ -19,8 +19,9 @@
# Python Plugin Runner for Apache APISIX
-[](https://github.com/apache/apisix-python-plugin-runner/actions)
-[](https://github.com/apache/apisix-python-plugin-runner/actions)
+[](https://github.com/apache/apisix-python-plugin-runner/actions)
+[](https://github.com/apache/apisix-python-plugin-runner/actions)
+[](https://github.com/apache/apisix-python-plugin-runner/actions)
Runs [Apache APISIX](http://apisix.apache.org/) plugins written in Python.
Implemented as a sidecar that accompanies
APISIX.
diff --git a/apisix/plugins/say.py b/apisix/plugins/say.py
index 5dd1608..d2481bf 100644
--- a/apisix/plugins/say.py
+++ b/apisix/plugins/say.py
@@ -14,6 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
+
from apisix.runner.plugin.base import Base
from apisix.runner.http.request import Request
from apisix.runner.http.response import Response
diff --git a/pytest.ini b/pytest.ini
index 6d3dba5..b51a3c0 100644
--- a/pytest.ini
+++ b/pytest.ini
@@ -14,6 +14,7 @@
; See the License for the specific language governing permissions and
; limitations under the License.
;
+
[pytest]
addopts = --cov=apisix/runner -p no:warnings
testpaths = tests
diff --git a/tests/conftest.py b/tests/conftest.py
index 8e25b19..cf8821d 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -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.
+#
+
import os
import sys