[trafficserver] branch 9.0.x updated: Adding autopep8 as a pre-commit hook. (#7071)
This is an automated email from the ASF dual-hosted git repository. zwoop pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/9.0.x by this push: new c1aafe4 Adding autopep8 as a pre-commit hook. (#7071) c1aafe4 is described below commit c1aafe4296c3ec0d0d48d7eb8ba2f31b6bc4c3c6 Author: Brian Neradt AuthorDate: Wed Aug 12 10:27:18 2020 -0500 Adding autopep8 as a pre-commit hook. (#7071) Co-authored-by: bneradt (cherry picked from commit b52746404089beb414f7da5a4f5e796aed93b9f4) --- CONTRIBUTING.md| 7 ++-- Makefile.am| 10 +- ci/jenkins/bin/clang-format.sh | 3 ++ tools/autopep8.sh | 79 ++ tools/clang-format.sh | 2 +- tools/git/pre-commit | 46 6 files changed, 128 insertions(+), 19 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2534478..b2f5f57 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -58,10 +58,13 @@ are a few simple rules to follow: 8. Make sure you run **clang-format** before making the _PR_. This is easiest done with e.g. "make clang-format", which works on OSX and Linux. -9. When making backports, make sure you mark the _PR_ for the appropriate +9. Make sure you run **autopep8** before making the _PR_. This is easiest + done with e.g. "make autopep8". + +10. When making backports, make sure you mark the _PR_ for the appropriate Github branch (e.g. **6.2.x**). -10. If you are making backports to an LTS branch, remember that the job of +11. If you are making backports to an LTS branch, remember that the job of merging such a _PR_ is the duty of the release manager. diff --git a/Makefile.am b/Makefile.am index 8eda411..756b97c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -112,15 +112,7 @@ rat: java -jar $(top_srcdir)/ci/apache-rat-0.13-SNAPSHOT.jar -E $(top_srcdir)/ci/rat-regex.txt -d $(top_srcdir) autopep8: - @autopep8 \ - --ignore-local-config \ - -i \ - -j 0 \ - --exclude $(top_srcdir)/lib/yamlcpp \ - --max-line-length 132 \ - --aggressive \ - --aggressive \ - -r $(top_srcdir) + @$(top_srcdir)/tools/autopep8.sh $(top_srcdir) # # These are rules to make clang-format easy and fast to run. Run it with e.g. diff --git a/ci/jenkins/bin/clang-format.sh b/ci/jenkins/bin/clang-format.sh index e6d1bc2..44e7c97 100755 --- a/ci/jenkins/bin/clang-format.sh +++ b/ci/jenkins/bin/clang-format.sh @@ -23,6 +23,9 @@ autoreconf -if && ./configure ${ATS_MAKE} -j clang-format [ "0" != "$?" ] && exit -1 +${ATS_MAKE} autopep8 +[ "0" != "$?" ] && exit 1 + git diff --exit-code [ "0" != "$?" ] && exit -1 diff --git a/tools/autopep8.sh b/tools/autopep8.sh new file mode 100755 index 000..f1a02b9 --- /dev/null +++ b/tools/autopep8.sh @@ -0,0 +1,79 @@ +#! /usr/bin/env bash +# +# Simple wrapper to run autopep8 on a directory. +# +# 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. + +# Update the PKGVERSION with the new desired autopep8 tag when a new autopep8 +# version is desired. +# See: +# https://github.com/hhatto/autopep8/tags +AUTOPEP8_VERSION="1.5.3" + +VERSION="autopep8 1.5.3 (pycodestyle: 2.6.0)" + +# Tie this to exactly the pycodestyle version that shows up in the setup.py of +# autopep8 so we know we run with the same version each time. +# See: +# https://github.com/hhatto/autopep8/blob/master/setup.py +PYCODESTYLE_TAG="2.6.0" + +function main() { + set -e # exit on error + + if ! type virtualenv >/dev/null 2>/dev/null + then +pip install -q virtualenv + fi + + AUTOPEP8_VENV=${AUTOPEP8_VENV:-$(cd $(dirname $0) && git rev-parse --show-toplevel)/.git/fmt/autopep8_${AUTOPEP8_VERSION}_venv} + if [ ! -e ${AUTOPEP8_VENV} ] + then +virtualenv ${AUTOPEP8_VENV} + fi + source ${AUTOPEP8_VENV}/bin/activate + + pip install -q "pycodestyle==${PYCODESTYLE_TAG}" + pip install -q "autopep8==${AUTOPEP8_VERSION}" + + ver=$(autopep8 --version) + if [ "$ver" != "$VERSION" ] + then + echo "Wrong
[trafficserver] branch 9.0.x updated: Fix #7167, make autopep8 failure (#7168)
This is an automated email from the ASF dual-hosted git repository. zwoop pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/9.0.x by this push: new 052b535 Fix #7167, make autopep8 failure (#7168) 052b535 is described below commit 052b535b0066f3e009b4a1b66e060d483d25c680 Author: Zizhong Zhang AuthorDate: Thu Sep 3 18:59:14 2020 -0700 Fix #7167, make autopep8 failure (#7168) (cherry picked from commit 62be4defe3bf61146ea736d8012cf09275e741e2) --- tools/autopep8.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/autopep8.sh b/tools/autopep8.sh index f1a02b9..76b5a1b 100755 --- a/tools/autopep8.sh +++ b/tools/autopep8.sh @@ -50,7 +50,7 @@ function main() { pip install -q "pycodestyle==${PYCODESTYLE_TAG}" pip install -q "autopep8==${AUTOPEP8_VERSION}" - ver=$(autopep8 --version) + ver=$(autopep8 --version 2>&1) if [ "$ver" != "$VERSION" ] then echo "Wrong version of autopep8!"
[trafficserver] branch 9.0.x updated: Build test C/C++ files with Automake. (#6945) (#7165)
This is an automated email from the ASF dual-hosted git repository. zwoop pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/9.0.x by this push: new bd1f902 Build test C/C++ files with Automake. (#6945) (#7165) bd1f902 is described below commit bd1f9024c386d3610f88069362ae66f6cec07d15 Author: Brian Neradt AuthorDate: Fri Sep 4 10:28:23 2020 -0500 Build test C/C++ files with Automake. (#6945) (#7165) Many AuTests have test plugins or test executables that are used as a part of the test. Before this change these were built by ad hoc calls to g++ or gcc via shell executions from within the test or one of a couple AuTest extensions. This patch removes the building of these files from AuTest and instead uses the Automake build system to build these. This will build these utilities in a way that is consistent with the rest of the system, using the same warning and error flags, the same clang tool configurations, etc. (cherry picked from commit 61f8ee3bfdea2690677d6ef3697b5aa272ffd297) --- .gitignore | 2 + Makefile.am| 2 +- configure.ac | 1 + .../cppapi/cppapi.test.py => Makefile.am} | 32 +--- tests/gold_tests/autest-site/build.test.ext| 53 -- tests/gold_tests/autest-site/setup.cli.ext | 1 + .../autest-site/trafficserver_plugins.test.ext | 56 ++ .../body_factory/http204_response_plugin.test.py | 2 +- .../Makefile.inc} | 16 +--- .../chunked_encoding/chunked_encoding.test.py | 7 +- .../command_argument/verify_global_plugin.test.py | 67 ++--- .../command_argument/verify_remap_plugin.test.py | 18 ++--- tests/gold_tests/cont_schedule/schedule.test.py| 2 +- .../cont_schedule/schedule_on_pool.test.py | 2 +- .../cont_schedule/schedule_on_thread.test.py | 2 +- .../cont_schedule/thread_affinity.test.py | 2 +- tests/gold_tests/continuations/double.test.py | 4 +- tests/gold_tests/continuations/double_h2.test.py | 4 +- tests/gold_tests/continuations/openclose.test.py | 4 +- .../gold_tests/continuations/openclose_h2.test.py | 4 +- .../plugins/Makefile.inc} | 15 +--- tests/gold_tests/logging/log_retention.test.py | 2 +- .../null_transform/null_transform.test.py | 2 +- .../pluginTest/cert_update/cert_update.test.py | 5 +- .../client_context_dump.test.py| 5 +- tests/gold_tests/pluginTest/cppapi/cppapi.test.py | 5 +- .../pluginTest/test_hooks/hook_add.test.py | 5 +- .../pluginTest/test_hooks/test_hooks.test.py | 5 +- tests/gold_tests/pluginTest/tsapi/tsapi.test.py| 5 +- tests/gold_tests/shutdown/emergency.test.py| 2 +- tests/gold_tests/shutdown/fatal.test.py| 2 +- tests/gold_tests/slow_post/slow_post.test.py | 2 +- .../cppapi/cppapi.test.py => tls/Makefile.inc} | 16 +--- tests/gold_tests/tls/ssl-post.c| 19 + tests/gold_tests/tls/tls.test.py | 6 +- .../gold_tests/tls/tls_hooks_client_verify.test.py | 8 +- tests/gold_tests/tls/tls_hooks_verify.test.py | 8 +- tests/gold_tests/tls/tls_keepalive.test.py | 2 +- tests/gold_tests/tls_hooks/tls_hooks.test.py | 2 +- tests/gold_tests/tls_hooks/tls_hooks10.test.py | 2 +- tests/gold_tests/tls_hooks/tls_hooks11.test.py | 2 +- tests/gold_tests/tls_hooks/tls_hooks12.test.py | 2 +- tests/gold_tests/tls_hooks/tls_hooks13.test.py | 2 +- tests/gold_tests/tls_hooks/tls_hooks14.test.py | 2 +- tests/gold_tests/tls_hooks/tls_hooks15.test.py | 2 +- tests/gold_tests/tls_hooks/tls_hooks16.test.py | 2 +- tests/gold_tests/tls_hooks/tls_hooks17.test.py | 2 +- tests/gold_tests/tls_hooks/tls_hooks18.test.py | 2 +- tests/gold_tests/tls_hooks/tls_hooks2.test.py | 2 +- tests/gold_tests/tls_hooks/tls_hooks3.test.py | 2 +- tests/gold_tests/tls_hooks/tls_hooks4.test.py | 2 +- tests/gold_tests/tls_hooks/tls_hooks6.test.py | 2 +- tests/gold_tests/tls_hooks/tls_hooks7.test.py | 2 +- tests/gold_tests/tls_hooks/tls_hooks8.test.py | 2 +- tests/gold_tests/tls_hooks/tls_hooks9.test.py | 2 +- tests/tools/plugins/Makefile.inc | 85 ++ ...definition.c => missing_mangled_definition_c.c} | 0 ...nition.cc => missing_mangled_definition_cpp.cc} | 0 tests/tools/plugins/ssl_client_verify_test.cc | 12 ++- tests/tools/plugins/test_cppapi.cc | 10 +++ 60 files changed, 277 insertions(+), 259 deletions(-) diff --git a/.gitignore b/.gitignore index 0b83c6c..493a99c 100644 --- a/.gitignore +++ b/.gitignore @@ -194,6
[trafficserver] branch 9.0.x updated: MicroDNS Extension: handle different 'default' types (#7159)
This is an automated email from the ASF dual-hosted git repository. zwoop pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/9.0.x by this push: new 9e79f08 MicroDNS Extension: handle different 'default' types (#7159) 9e79f08 is described below commit 9e79f08300f052ae9ad9a1a48ec8650cd98f56cb Author: Brian Neradt AuthorDate: Thu Sep 3 18:19:51 2020 -0500 MicroDNS Extension: handle different 'default' types (#7159) The MicroDNS extension supports populating the 'otherwise' node with a list of hosts via the default parameter. The Traffic Server tests only pass a string to default, but tests could also pass a list. This makes the extension deal with either of these input types. As it is, without this change, tests cannot pass a list because the list itself would be wrapped as a list. This change fixes the use of MicroDNS for plugins that use the Traffic Server extensions, such as txn_box.so. (cherry picked from commit c63704852a093556cc461b9a123f8848d67296e2) --- tests/gold_tests/autest-site/microDNS.test.ext | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/gold_tests/autest-site/microDNS.test.ext b/tests/gold_tests/autest-site/microDNS.test.ext index e508f5d..f33b095 100644 --- a/tests/gold_tests/autest-site/microDNS.test.ext +++ b/tests/gold_tests/autest-site/microDNS.test.ext @@ -82,7 +82,10 @@ def MakeDNServer(obj, name, filename="dns_file.json", port=False, ip='INADDR_LOO jsondata = {'mappings': []} if default: -jsondata['otherwise'] = [default] +if isinstance(default, str): +# MicroDNS expects 'otherwise' to be a sequence. +default = [default] +jsondata['otherwise'] = default with open(filepath, 'w') as f: f.write(json.dumps(jsondata))
[trafficserver] branch 9.0.x updated: Updated ChangeLog
This is an automated email from the ASF dual-hosted git repository. zwoop pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/trafficserver.git The following commit(s) were added to refs/heads/9.0.x by this push: new 24bdf15 Updated ChangeLog 24bdf15 is described below commit 24bdf15b0e91fe2c92c3582da6d83d0f11a673cf Author: Leif Hedstrom AuthorDate: Fri Sep 4 09:21:52 2020 -0600 Updated ChangeLog --- CHANGELOG-9.0.0 | 14 ++ 1 file changed, 14 insertions(+) diff --git a/CHANGELOG-9.0.0 b/CHANGELOG-9.0.0 index 5ea7bc1..35163b5 100644 --- a/CHANGELOG-9.0.0 +++ b/CHANGELOG-9.0.0 @@ -752,6 +752,7 @@ Changes with Apache Traffic Server 9.0.0 #6193 - Fixes various crashers loading/reloading parent.config #6197 - Fix problems with "Probe" option for X-Debug MIME header field. #6198 - Move logging before session could be freed + #6200 - Cleanup: Remove useless UDPConnection function #6201 - ssl_session_reuse optimization to check if diags is on #6203 - Fix the relative path for template_sets_dir to be install directory #6204 - Lua plugin fix: Account for null in output from TSUrlPercentDecode. @@ -864,6 +865,7 @@ Changes with Apache Traffic Server 9.0.0 #6519 - Adds support for configure option --enable-yaml-headers #6523 - Removes noisy log statement from xdebug #6524 - Require 1.1.1 as minimum openssl lib version for tls_check_dual_cert_selection Au test. + #6530 - Convert Mime and URL unit tests in proxy/hdrs to Catch. #6532 - Add FetchSM support to dechunking in non-streaming mode with new TS API TSFetchFlagSet #6538 - Adds partial_blind_route sni action #6542 - Rework stats over http so that it supports both a config file and the original path parameter @@ -894,6 +896,7 @@ Changes with Apache Traffic Server 9.0.0 #6618 - Fix missing virtual destructor for PluginUserArgsMixin. #6628 - Use default rwlock attributes on initialize #6632 - Fixes a bug where the nexthop markNextHop method to mark a host down is not called. + #6635 - Optimize HTTPHdr conversion of HTTP/1.1 to HTTP/2 #6642 - Fixes crash loading combined(cert+key) certs #6645 - Traffic Dump: Adding an SNI filtering option. #6650 - Extendible asan simple @@ -1052,7 +1055,9 @@ Changes with Apache Traffic Server 9.0.0 #7104 - Don't send image/webp responses from cache to broswers that don't support it #7110 - Add QUIC draft-29 support #7113 - Updating our autest suite to require Python3.6 + #7117 - Fix #7116, skip the insertion of the same continuation to pending dns #7118 - Backing out my update of our jenkin's autest file. + #7119 - URL::parse fixes for empty paths #7120 - Check VIO availability before checking whether the VIO has data #7121 - Don't return QUIC frame if the size exceeds maximum frame size #7122 - Make tls_hooks tests more likely to pass particularly for 9.0.x branch @@ -1062,7 +1067,16 @@ Changes with Apache Traffic Server 9.0.0 #7126 - Replaces "smart" quotes with ASCII equivalents #7128 - Protect TSActionCancel from null INKContInternal actions #7129 - Comment out a wrong assertion in QUIC Loss Detection logic + #7131 - Don't make an error on duplicated RETIRE_CONNECTION frames + #7135 - Replace ACTION_RESULT_NONE with nullptr #7137 - Removes duplicated listing of files in same Makefile target #7138 - Remove useless shortopt #7140 - Fixes garbled logs when using % log tag + #7143 - Deprecate cqhv field + #7144 - Fix typo in cache docs #7145 - Check VIO availability before acquiring a lock for it + #7147 - slice: check if vio is still valid before calling TSVIODone* on shutdown + #7148 - Fix stale pointer due to SSL config reload + #7155 - PluginFactory - Remove unused code. + #7157 - rc: fixes systemd unit file stopping + #7160 - Fix memory leaks in multiplexer plugin