-
Notifications
You must be signed in to change notification settings - Fork 580
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
WIP: Split bear execution by runtime #1386
base: master
Are you sure you want to change the base?
Conversation
Thanks for your contribution! Reviewing pull requests take really a lot of time and we're all volunteers. Please make sure you go through the following check list and complete them all before pinging someone for a review.
As you learn things over your Pull Request please help others on the chat and on PRs to get their stuff right as well! |
This is mostly a WIP,, as it needs to be split into multiple commits and some of the voodoo bash stuff needs to be refined, and some additional However, the concept behind it, of not testing non-Python bears on each version of Python, needs some arch review. There are many further improvements that can be made, such as splitting node and ruby and python bears into separate jobs (these are already manageable by Requirement classes), and R and Haskell and Java should follow soon with Requirement classes being added. That will allow testing using multiple versions of each runtime concurrently. |
@jayvdb gorgeous idea! Put th concept explanation into the commit message please or maybe right into the code as a comment. |
.ci/bears.prune.sh
Outdated
# Delete empty bear directories | ||
|
||
for dir in bears/*/; do | ||
if [[ -z "$(ls $dir/ 2>/dev/null | egrep -v '(__|.xml)')" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this looks for directories without any Bear's in it..
The __
is for __init__
and __pycache__
.xml
is because of bears/scala/scalastyle_config.xml
I think a much better approach would be to look for one file matching *Bear.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, the problem with *Bear is we have directories with only subdirectories, like bears/vcs
. Solvable, and probably still clearer to take this approach.
.travis.yml
Outdated
if [[ "$BEARS" != "all" ]]; then | ||
rm $(comm -23 <(ls bears/*/[A-Za-z]*.py | grep -v general | sort) <(grep -l PipRequirement bears/*/*.py | sort)) | ||
rm bears/general/CPDBear.py | ||
rm bears/generate_package.py tests/generate_packageTest.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the special case for bears/generate_package.py
-> tests/generate_packageTest.py
could be added to tests.prune.sh
, instead of here in .travis.yml
.travis.yml
Outdated
# Only keep non-Python bears on Python 3.4 | ||
- > | ||
if [[ "$BEARS" != "all" ]]; then | ||
rm $(comm -23 <(ls bears/*/[A-Za-z]*.py | grep -v general | sort) <(grep -l PipRequirement bears/*/*.py | sort)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
grep -v general
-- all bears/general/
are Python language bears without any dependencies, except CPDBear (see next line).
This needs to be tidied up somehow.
bears/ruby/RuboCopBear.py
Outdated
@@ -19,8 +19,7 @@ class RuboCopBear: | |||
""" | |||
|
|||
LANGUAGES = {'Ruby'} | |||
REQUIREMENTS = {GemRequirement('rubocop'), | |||
PipRequirement('pyyaml', '3.12')} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was done because the shell foo in .travis.yml needs to find non-Python bears. It is using the presence of PipRequirement
, and there are two non-Python bears which use PipRequirement.
.travis.yml logic needs to be rewritten, and then this isnt necessary.
.ci/generate_bear_requirements.py
Outdated
@@ -81,6 +82,15 @@ def get_inherited_requirements(): | |||
in_inherited = False | |||
with open(os.path.join(PROJECT_DIR, 'requirements.txt'), 'r') as file: | |||
for line in file.read().splitlines(): | |||
line = line.strip() | |||
if not line.startswith('#'): | |||
m = re.match('^[A-Za-z._-]+', line) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding more requirements parsing ;-( Should be using an existing tool for this.
This entire modification to this script wont be necessary when the pyyaml related changes are backed-out.
4474917
to
e320695
Compare
Comment on e320695. This commit seems to be marked as work in progress and should not be used in production. Treat carefully. GitCommitBear, severity NORMAL, section |
e320695
to
1b8458a
Compare
Comment on 1b8458a. This commit seems to be marked as work in progress and should not be used in production. Treat carefully. GitCommitBear, severity NORMAL, section |
1 similar comment
Comment on 1b8458a. This commit seems to be marked as work in progress and should not be used in production. Treat carefully. GitCommitBear, severity NORMAL, section |
Note bca64a0 was an intentional breakage to show codecov reports less than 100% coverage when one bear doesnt work. See it on |
585ccdb
to
921ebc6
Compare
The circle breakage has been addressed in #1406 , which only solves part of this as it is easier to test that part by itself. |
Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again! |
Hey! This pull request hasn't been updated for a while :/ It would be nice if we could get this going again! |
go_requirement_bears=$(grep -m 1 -l GoRequirement $requirement_bears) | ||
npm_requirement_bears=$(grep -m 1 -l NpmRequirement $requirement_bears) | ||
rscript_requirement_bears=$(grep -m 1 -l RscriptRequirement $requirement_bears) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to add luarocks_requirement_bears
and julia_requirement_bears
Ref: #1650
|
||
dart_bears=$(ls bears/dart/*Bear.py) | ||
julia_bears=$(ls bears/julia/*Bear.py) | ||
lua_bears=$(ls bears/lua/*Bear.py) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can remove lua_bears
and julia_bears
|
||
non_python_bears=$(comm -23 <(ls $bears) <(ls $python_bears)) | ||
|
||
cabal_requirement_bears="$cabal_requirement_bears bears/haskell/HaskellLintBear.py bears/shell/ShellCheckBear.py" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ShellCheckBear
has a Cabal Requirement now
Ref: #1496
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also this needs to be solved: #1358 so, that we can remove HaskellLintBear
if [[ -z "$bears""$subdirs" ]]; then | ||
echo Removing $dir | ||
rm -rf $dir | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it important to delete the empty directories? What if we left them as it is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forget.
probably another bear will complain about a missing __init__.py
, or we have missing coverage of those __init__.py
@@ -0,0 +1,25 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DESCRIPTION
Outdated
@@ -0,0 +1,3 @@ | |||
Package: coala |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -0,0 +1,6 @@ | |||
use ExtUtils::MakeMaker; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if [[ -z "$bears""$subdirs" ]]; then | ||
echo Removing $dir | ||
rm -rf $dir | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forget.
probably another bear will complain about a missing __init__.py
, or we have missing coverage of those __init__.py
c07e6b2
to
9fe134a
Compare
.ci/bears.prune.sh
Outdated
|
||
yield_result_bears=$(grep -m 1 -l 'yield Result' $bears) | ||
|
||
non_yield_result_bears=$(comm -23 <(ls $bears) <(ls $yield_result_bears)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
non_yield_result_bears appears unused. Verify it or export it. [SC2034]
Origin: ShellCheckBear, Section: bash
.
.ci/bears.prune.sh
Outdated
fi | ||
|
||
pip_only_requirement_bears=$(comm -23 <(ls $pip_requirement_bears) <(ls $non_pip_runtime_requirement_bears)) | ||
pip_plus_requirement_bears=$(comm -23 <(ls $pip_requirement_bears) <(ls $pip_only_requirement_bears)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pip_plus_requirement_bears appears unused. Verify it or export it. [SC2034]
Origin: ShellCheckBear, Section: bash
.
.ci/bears.prune.sh
Outdated
clang_bears='' | ||
other_bears='' | ||
for bear in $no_requirement_bears; do | ||
if [[ ${bear/Clang/} != $bear ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quote the rhs of != in [[ ]] to prevent glob matching. [SC2053]
Origin: ShellCheckBear, Section: bash
.
9fe134a
to
041f05b
Compare
.ci/bears.prune.sh
Outdated
clang_bears='' | ||
other_bears='' | ||
for bear in $no_requirement_bears; do | ||
if [[ ${bear/Clang/} != ${bear} ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quote the rhs of != in [[ ]] to prevent glob matching. [SC2053]
Origin: ShellCheckBear, Section: bash
.
d56fc7f
to
d28fca8
Compare
- language: ruby | ||
rvm: 2.0 | ||
|
||
- language: haskell |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this job isnt working yet in the new PR #2910
the TRAVIS_GHC_ROOT=/opt/ghc
env setting below might be relevant.
|
||
config = configparser.ConfigParser() | ||
config.read('setup.cfg') | ||
if 'setup:custom' in config.sections(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a separate issue, and hasnt been fixed yet.
Closes #1773