-
Notifications
You must be signed in to change notification settings - Fork 2
Feature 40 v115 #74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Feature 40 v115 #74
Changes from 4 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
dc37967
[TESTS] Initial hardening with pinned dependencies (- WIP #40 -)
reactive-firewall 507029d
[REGRESSION] Revert test-requirement of pytest-cov back down to v4+ t…
reactive-firewall 2c020f6
[REGRESSION] revert pytyest-enabler back to v1.0.1 in CI to continue …
reactive-firewall 715705c
[TESTS] Testing prototype tool to fetch and verify the cc-test-report…
reactive-firewall 86f5dcd
[REGRESSION] chmod 755 new tool :hear_no_evil: (- WIP #40 -)
reactive-firewall a53dd67
[STYLE] numerous style fixes to satisfy shellcheck and improve consis…
reactive-firewall e07e301
[REGRESSION] fix syntax by reverting (- WIP #74 -)
reactive-firewall 590cbdf
[REGRESSION] fix syntax by reverting - OPS MISSED ON (- WIP #74 -)
reactive-firewall 4cdc900
[REGRESSION] fix syntax by reverting - back to a working CI (- WIP #7…
reactive-firewall File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
reactive-firewall marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| #python | ||
| # time - builtin - PSF licence | ||
| # re - builtin - PSF licence? | ||
| # subprocess - PSF licence | ||
| # sphinx | ||
| # argparse - builtin - PSF licence | ||
| argparse>=1.4.0 | ||
| # argparse - builtin - PSF licence | ||
| setuptools>=38.0 | ||
| # virtualenv - MIT | ||
| virtualenv>=15.0.1 | ||
| # six - MIT | ||
| six>=1.0.0 | ||
| # pgpy - BSD 3-Clause licensed | ||
| #pgpy>=0.4.1 | ||
| tox>=3.0.0 | ||
| #py>=1.4.33 | ||
| # pip>=19.0 | ||
| ### | ||
| # TESTING ONLY - Do NOT report issues with these optionals on python-repo | ||
| ### | ||
| flake8>=5.0 | ||
| pyflakes>=2.5.0 | ||
| pep8>=1.0 | ||
| pytest>=7 | ||
| pytest-checkdocs>=2.4 | ||
| pytest-cov>=4.0.0 | ||
| pytest-enabler>=1.0.1 | ||
| pytest-flake8>=1.0 | ||
| coverage >= 6.3 | ||
| pytest-cov >= 4.0.0; | ||
| pytest-enabler >= 1.0.1 | ||
| wheel >= 0.37.0 | ||
| pip >= 21.0 | ||
reactive-firewall marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,166 @@ | ||
| #! /bin/bash | ||
reactive-firewall marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # Disclaimer of Warranties. | ||
| # A. YOU EXPRESSLY ACKNOWLEDGE AND AGREE THAT, TO THE EXTENT PERMITTED BY | ||
| # APPLICABLE LAW, USE OF THIS SHELL SCRIPT AND ANY SERVICES PERFORMED | ||
| # BY OR ACCESSED THROUGH THIS SHELL SCRIPT IS AT YOUR SOLE RISK AND | ||
| # THAT THE ENTIRE RISK AS TO SATISFACTORY QUALITY, PERFORMANCE, ACCURACY AND | ||
| # EFFORT IS WITH YOU. | ||
| # | ||
| # B. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SHELL SCRIPT | ||
| # AND SERVICES ARE PROVIDED "AS IS" AND “AS AVAILABLE”, WITH ALL FAULTS AND | ||
| # WITHOUT WARRANTY OF ANY KIND, AND THE AUTHOR OF THIS SHELL SCRIPT'S LICENSORS | ||
| # (COLLECTIVELY REFERRED TO AS "THE AUTHOR" FOR THE PURPOSES OF THIS DISCLAIMER) | ||
| # HEREBY DISCLAIM ALL WARRANTIES AND CONDITIONS WITH RESPECT TO THIS SHELL SCRIPT | ||
| # SOFTWARE AND SERVICES, EITHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT | ||
| # NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF | ||
| # MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, | ||
| # ACCURACY, QUIET ENJOYMENT, AND NON-INFRINGEMENT OF THIRD PARTY RIGHTS. | ||
| # | ||
| # C. THE AUTHOR DOES NOT WARRANT AGAINST INTERFERENCE WITH YOUR ENJOYMENT OF THE | ||
| # THE AUTHOR's SOFTWARE AND SERVICES, THAT THE FUNCTIONS CONTAINED IN, OR | ||
| # SERVICES PERFORMED OR PROVIDED BY, THIS SHELL SCRIPT WILL MEET YOUR | ||
| # REQUIREMENTS, THAT THE OPERATION OF THIS SHELL SCRIPT OR SERVICES WILL | ||
| # BE UNINTERRUPTED OR ERROR-FREE, THAT ANY SERVICES WILL CONTINUE TO BE MADE | ||
| # AVAILABLE, THAT THIS SHELL SCRIPT OR SERVICES WILL BE COMPATIBLE OR | ||
| # WORK WITH ANY THIRD PARTY SOFTWARE, APPLICATIONS OR THIRD PARTY SERVICES, | ||
| # OR THAT DEFECTS IN THIS SHELL SCRIPT OR SERVICES WILL BE CORRECTED. | ||
| # INSTALLATION OF THIS THE AUTHOR SOFTWARE MAY AFFECT THE USABILITY OF THIRD | ||
| # PARTY SOFTWARE, APPLICATIONS OR THIRD PARTY SERVICES. | ||
| # | ||
| # D. YOU FURTHER ACKNOWLEDGE THAT THIS SHELL SCRIPT AND SERVICES ARE NOT | ||
| # INTENDED OR SUITABLE FOR USE IN SITUATIONS OR ENVIRONMENTS WHERE THE FAILURE | ||
| # OR TIME DELAYS OF, OR ERRORS OR INACCURACIES IN, THE CONTENT, DATA OR | ||
| # INFORMATION PROVIDED BY THIS SHELL SCRIPT OR SERVICES COULD LEAD TO | ||
| # DEATH, PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE, | ||
| # INCLUDING WITHOUT LIMITATION THE OPERATION OF NUCLEAR FACILITIES, AIRCRAFT | ||
| # NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL, LIFE SUPPORT OR | ||
| # WEAPONS SYSTEMS. | ||
| # | ||
| # E. NO ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY THE AUTHOR | ||
| # SHALL CREATE A WARRANTY. SHOULD THIS SHELL SCRIPT OR SERVICES PROVE DEFECTIVE, | ||
| # YOU ASSUME THE ENTIRE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. | ||
| # | ||
| # Limitation of Liability. | ||
| # F. TO THE EXTENT NOT PROHIBITED BY APPLICABLE LAW, IN NO EVENT SHALL THE AUTHOR | ||
| # BE LIABLE FOR PERSONAL INJURY, OR ANY INCIDENTAL, SPECIAL, INDIRECT OR | ||
| # CONSEQUENTIAL DAMAGES WHATSOEVER, INCLUDING, WITHOUT LIMITATION, DAMAGES | ||
| # FOR LOSS OF PROFITS, CORRUPTION OR LOSS OF DATA, FAILURE TO TRANSMIT OR | ||
| # RECEIVE ANY DATA OR INFORMATION, BUSINESS INTERRUPTION OR ANY OTHER | ||
| # COMMERCIAL DAMAGES OR LOSSES, ARISING OUT OF OR RELATED TO YOUR USE OR | ||
| # INABILITY TO USE THIS SHELL SCRIPT OR SERVICES OR ANY THIRD PARTY | ||
| # SOFTWARE OR APPLICATIONS IN CONJUNCTION WITH THIS SHELL SCRIPT OR | ||
| # SERVICES, HOWEVER CAUSED, REGARDLESS OF THE THEORY OF LIABILITY (CONTRACT, | ||
| # TORT OR OTHERWISE) AND EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE | ||
| # POSSIBILITY OF SUCH DAMAGES. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION | ||
| # OR LIMITATION OF LIABILITY FOR PERSONAL INJURY, OR OF INCIDENTAL OR | ||
| # CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY TO YOU. In no event | ||
| # shall THE AUTHOR's total liability to you for all damages (other than as may | ||
| # be required by applicable law in cases involving personal injury) exceed | ||
| # the amount of five dollars ($5.00). The foregoing limitations will apply | ||
| # even if the above stated remedy fails of its essential purpose. | ||
| ################################################################################ | ||
|
|
||
| ulimit -t 1200 | ||
| PATH="/bin:/sbin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:${PATH}" | ||
| LANG=${LANG:-"en_US"} | ||
| LC_ALL="${LANG:1:5}.utf-8" | ||
| umask 127 | ||
reactive-firewall marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| LOCK_FILE="${TMPDIR:-/tmp}/org.pak.tests.scripts.code-climate.lock" | ||
| EXIT_CODE=0 | ||
|
|
||
| test -x $(command -v grep) || exit 126 ; | ||
| test -x $(command -v curl) || exit 126 ; | ||
| hash -p ./.github/tool_shlock_helper.sh shlock || exit 255 ; | ||
| test -x "$(command -v shlock)" || exit 126 ; | ||
| test -x $(command -v gpgv) || exit 126 ; | ||
| test -x $(command -v shasum) || exit 126 ; | ||
|
|
||
| # sorry no windows support here | ||
| if [[ $( \uname -s ) == "*arwin" ]] ; then | ||
| CI_OS="darwin" | ||
| else | ||
| CI_OS="linux" | ||
| fi | ||
reactive-firewall marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| function cleanup() { | ||
| rm -f ${LOCK_FILE} 2>/dev/null || true ; wait ; | ||
| rm -f ./test-reporter-latest-*-amd64.SHA*.sig 2>/dev/null || true ; wait ; | ||
| hash -d shlock 2>/dev/null > /dev/null || true ; | ||
| } | ||
|
|
||
| if [[ ( $(shlock -f ${LOCK_FILE} -p $$ ) -eq 0 ) ]] ; then | ||
| trap 'cleanup 2>/dev/null || rm -f ${LOCK_FILE} 2>/dev/null > /dev/null || true ; wait ; exit 129 ;' SIGHUP || EXIT_CODE=129 | ||
| trap 'cleanup 2>/dev/null || rm -f ${LOCK_FILE} 2>/dev/null > /dev/null || true ; wait ; exit 143 ;' SIGTERM || EXIT_CODE=143 | ||
| trap 'cleanup 2>/dev/null || rm -f ${LOCK_FILE} 2>/dev/null > /dev/null || true ; wait ; exit 131 ;' SIGQUIT || EXIT_CODE=131 | ||
| # SC2173 - https://github.com/koalaman/shellcheck/wiki/SC2173 | ||
| #trap 'cleanup 2>/dev/null || rm -f ${LOCK_FILE} 2>/dev/null > /dev/null || true ; wait ; exit 1 ;' SIGSTOP || EXIT_CODE=7 | ||
| trap 'cleanup 2>/dev/null || rm -f ${LOCK_FILE} 2>/dev/null > /dev/null || true ; wait ; exit 130 ;' SIGINT || EXIT_CODE=130 | ||
| trap 'cleanup 2>/dev/null || rm -f ${LOCK_FILE} 2>/dev/null > /dev/null || true || true ; wait ; exit 137 ;' SIGABRT || EXIT_CODE=137 | ||
| trap 'cleanup 2>/dev/null || rm -f ${LOCK_FILE} 2>/dev/null > /dev/null || true ; wait ; exit ${EXIT_CODE} ;' EXIT || EXIT_CODE=1 | ||
| trap 'cleanup ; wait ; exit ${EXIT_CODE} ;' EXIT || EXIT_CODE=1 | ||
| else | ||
| echo "CodeCov already in progress by "`head ${LOCK_FILE}` ; | ||
| false ; | ||
| exit 126 ; | ||
| fi | ||
reactive-firewall marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| # this is how test files are found: | ||
|
|
||
| # THIS IS THE ACTUAL TEST DIR USED (update _TEST_ROOT_DIR as needed) | ||
| _TEST_ROOT_DIR="./" ; | ||
| if [[ -d ./.git ]] ; then | ||
| _TEST_ROOT_DIR="./" ; | ||
| elif [[ -d ./tests ]] ; then | ||
| _TEST_ROOT_DIR="./" ; | ||
| else | ||
| echo "FAIL: missing valid folder or file" | ||
| EXIT_CODE=1 | ||
| fi | ||
|
|
||
| # This File MUST BE GIT-IGNORED | ||
| # to be SAFELY USED to store Tokens and env vars (update logic as needed) | ||
| if [[ ( -r ./codecov_env ) ]] ; then | ||
| source ./codecov_env 2>/dev/null || true ; | ||
| fi | ||
|
|
||
|
|
||
| ######################### | ||
| # actual Work starts here | ||
| ######################### | ||
| curl -fLso ./test-reporter-latest-${CI_OS:-linux}-amd64 https://codeclimate.com/downloads/test-reporter/test-reporter-latest-${CI_OS:-linux}-amd64 ; | ||
| for i in 1 256 512 ; do | ||
| curl -fLso test-reporter-latest-${CI_OS:-linux}-amd64.SHA${i} "https://codeclimate.com/downloads/test-reporter/test-reporter-latest-${CI_OS:-linux}-amd64.SHA${i}" ; wait ; | ||
| curl -fLso test-reporter-latest-${CI_OS:-linux}-amd64.SHA${i}.sig "https://codeclimate.com/downloads/test-reporter/test-reporter-latest-${CI_OS:-linux}-amd64.SHA${i}.sig" ; wait ; | ||
| # test sha1/sha512 signatures if found and sha256 even if not found | ||
| if [[ ( -r test-reporter-latest-${CI_OS:-linux}-amd64.SHA${i} ) ]] || [[ ( ${i} -eq 256 ) ]] ; then | ||
| if [[ ( -r test-reporter-latest-${CI_OS:-linux}-amd64.SHA${i}.sig ) ]] ; then | ||
| # configure your CI evironment to trust the key at ???? | ||
| # FP: KEY FP | ||
| # OR... | ||
| # Set CI=true to continue on missing keys | ||
| gpgv test-reporter-latest-${CI_OS:-linux}-amd64.SHA${i}.sig test-reporter-latest-${CI_OS:-linux}-amd64.SHA${i} || ${CI} || EXIT_CODE=126 | ||
| rm -vf codecov.SHA${i}SUM.sig 2>/dev/null ; | ||
| fi | ||
| shasum -a $i -c --ignore-missing test-reporter-latest-${CI_OS:-linux}-amd64.SHA${i} || EXIT_CODE=126 | ||
| rm -vf test-reporter-latest-${CI_OS:-linux}-amd64.SHA${i} 2>/dev/null ; | ||
| fi | ||
| done | ||
|
|
||
| if [[ ( ${EXIT_CODE} -eq 0 ) ]] ; then | ||
| mv -f test-reporter-latest-${CI_OS:-linux}-amd64 ./cc-test-reporter 2>/dev/null || EXIT_CODE=126 | ||
| chmod -v 751 ./cc-test-reporter || EXIT_CODE=126 | ||
| fi | ||
reactive-firewall marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| if [[ ( ${EXIT_CODE} -eq 0 ) ]] ; then | ||
| ./cc-test-reporter || EXIT_CODE=10 ; | ||
| fi | ||
|
|
||
|
|
||
| unset _TEST_ROOT_DIR 2>/dev/null || true ; | ||
|
|
||
| rm -f ./test-reporter-latest-*-amd64.SHA* 2>/dev/null > /dev/null || true ; wait ; | ||
| rm -f ${LOCK_FILE} 2>/dev/null > /dev/null || true ; wait ; | ||
|
|
||
| # goodbye | ||
| exit ${EXIT_CODE:-255} ; | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.