Feb 13 released a new version of bugbear that raises new
error codes. We are setting an upper limit for bugbear
to be from before that version was released.
bandit is also reporting a hashlib error. The bandit
job is non-voting, but the error is now being suppressed.
Story: 2010531
Task: 47313
Signed-off-by: Al Bailey <al.bailey@windriver.com>
Change-Id: Iffb790c67e658c7a40c697e364cb34f4c4f9ec6c
- removed the old and unused devstack job.
- needed to update pylint to python3
- needed to enable bindep to install the packages
required for installing mysqlclient
No test plan is provided, because the purpose of this
change is to determine if zuul is broken for this repo,
and then fix it.
Story: 2010531
Task: 47313
Signed-off-by: Al Bailey <al.bailey@windriver.com>
Change-Id: I6655792d692644f2c6320b0ef1d66283e17d7bb3
This change will allow this repo to pass zuul now
that this has merged:
https://review.opendev.org/c/zuul/zuul-jobs/+/866943
Tox 4 deprecated whitelist_externals.
Replace whitelist_externals with allowlist_externals
Partial-Bug: #2000399
Signed-off-by: Al Bailey <al.bailey@windriver.com>
Change-Id: I04352e372c8ea2008f7ab0e7cdfa1d8b975e4251
The Zuul upper-constraints env variable declaration needed
to be added to tox.ini otherwise an older constraints
was being used which does not work with newer
versions of python.
Needed to suppress bugbear error B009 also, due to newer
version of flake8-bugbear.
Partial-Bug: #1997255
Signed-off-by: Al Bailey <al.bailey@windriver.com>
Change-Id: I73f4fbbf51a09f1e4c1a633a7a8b62cf969ff33a
A lot of work has gone into making sure that StarlingX is python3
compatible. To ensure future compatibility, enable the python3
portability checks. Disable the checks that are raising errors.
Another set of commits will address the offending code.
Story: 2006796
Task: 43269
Signed-off-by: Bernardo Decco <bernardo.deccodesiqueira@windriver.com>
Change-Id: I48d05d5bd8a4820fb02a47023af06411b62fa0a8
The install_command for docs, newnote and api-ref
needed to be overridden to not use upper constraints.
The bandit requirement needed to be made python3 only.
The bandit scan was failing, so it is now updated to
allow individual bandit failures to be suppressed in tox.ini
Need to include a py file change in order for bandit to be
triggered by zuul.
Partial-Bug: #1907678
Signed-off-by: albailey <Al.Bailey@windriver.com>
Change-Id: Ic73d0ea590ab1b7857f7275fa9c71828b0d343ee
flake8 2.5.5 fails on ubuntu-focal zuul machines running python3.8
with the following error:
AttributeError: 'FlakesChecker' object has no attribute 'CONSTANT'
The update removes the version constraint to use newer flake8.
The linters can be run in python3.
Pylint cannot be run in python3 because mysql-python is not
compatable, so a new zuul job for pylint is now added.
The flake8 errors that the newer version raises are all suppressed,
and some of them should be addressed by someone with familiarity in
this repo.
Change-Id: Ida6447728d4175173c02130cb04a6013e4f966f9
Partial-Bug: 1895054
Signed-off-by: albailey <Al.Bailey@windriver.com>
Setting up the bandit tool for the scanning of HIGH severity issues
in the python codes under Starlingx/ha folder.
Expecting this merge will enable zuul job for CI/CD of bandit scan.
Configuration files:
1. tox.ini for adding bandit environment and command.
2. test-requirements.txt for adding bandit version.
3. .zuul.yaml file for adding bandit job and configuring under
check job to run code scan every time before code commit.
Test:
Run tox -e bandit command inside the fault folder to validate the
bandit scan and result.
Please note:
Changes will be implemented in batches and this is Batch3 change.
Story: 2007541
Task: 39621
Depends-On: https://review.opendev.org/#/c/721294/
Change-Id: I01f81d7c52c12432965106f9603e4db600381971
Signed-off-by: Sharath Kumar K <sharath.kumar@intel.com>
"env:UPPER_CONSTRAINTS_FILE" doesn't work with latest Zuul.
Remove it to make sure upper-constraints working.
Closes-Bug: 1880097
Change-Id: Ibc6ab625eda1b5695798d044ef367f375086c87c
Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com>
This updates the upper-constraints.txt used by tox for
installing python modules to reference the stable/stein
constraints.
Change-Id: Ia875f05d807bd7404ae8ad12f852bce092202ee8
Partial-Bug: 1834216
Signed-off-by: Don Penney <don.penney@windriver.com>
Flake8 is failing due to bugbear updating with new error codes:
B009: Do not call getattr with a constant attribute value
B010: Do not call setattr with a constant attribute value
Fix these errors by using normal property access instead
Change-Id: Ib857d229ae86e88cb5dbf69e826b25d6018c8547
Signed-off-by: Eric Barrett <eric.barrett@windriver.com>
Flake8 currently ignores do not use mutable default arguments error
Enable B006 for more thorough testing of code
Change-Id: I5b08a56f945158c3b3c23574c048363e59da6001
Story: 2004515
Task: 30172
Signed-off-by: Eric Barrett <eric.barrett@windriver.com>
This builds, installs and cleans some of the SM components, plus adds
a DevStack job and a build.sh script to build components outside DevStack.
It uses the 'new' DevStack base job flock-devstack-base directly.
Also some interesting work-arounds were required to build sm-common and sm-db,
need to sort out the differences between CentOS 7.5 and Ubuntu Xenial.
Fixed a couple of occurrances of this error:
sm_db_service_domain_neighbors.c:311:25: error: ISO C++ forbids
comparison between pointer and integer [-Werror=permissive]
if( '\0' != record->orchestration )
^~~~~~~~~~~~~
02Apr2019 - Add new skips for flake8 after upstream release
03Apr2019 - Merge with https://review.openstack.org/#/c/647490/2, at this point
there is not much reason to do this in two steps.
Change-Id: I33c44a764295e8e0a7ae4771ea02e950f06bf2a2
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
Flake8 is failing due to bugbear updating with new error codes:
B009: Do not call getattr with a constant attribute value
B010: Do not call setattr with a constant attribute value
Ignore them for now
Lock down bugbear version to prevent further Zuul issues
Change-Id: Idf4f60b51a3362608917dfaf443b0444e6aa685c
Signed-off-by: Eric Barrett <eric.barrett@windriver.com>
below issures are removed from ignore cases:
E114 indentation is not a multiple of four (comment)
E116 unexpected indentation (comment)
E121 continuation line under-indented for hanging indent
E122 continuation line missing indentation or outdented
E123 closing bracket does not match indentation of opening bracket's line
E124 closing bracket does not match visual indentation
E125 continuation line with same indent as next logical line
E126 continuation line over-indented for hanging indent
E127 continuation line over-indented for visual indent
E128 continuation line under-indented for visual indent
E129 visually indented line with same indent as next logical line
E131 continuation line unaligned for hanging indent
E201 whitespace after '('
E228 missing whitespace around modulo operator
E231 missing whitespace after ','
E241 multiple spaces after ':'
E251 unexpected spaces around keyword / parameter equals
E265 block comment should start with '#'
E271 multiple spaces after keyword
E302 expected 2 blank lines, found 1
E303 too many blank lines
E305 expected 2 blank lines after class or function definition, found 1
E704 multiple statements on one line (def)
E713 test for membership should be 'not in'
E714 test for object identity should be 'is not'
E722 do not use bare except'
E731 do not assign a lambda expression, use a def
E999 SyntaxError: invalid syntax (this is likely python3)
F401 <foo> imported but unused
F841 local variable 'foo' is assigned to but never used
H201: no 'except:'
H233: Python 3.x incompatible use of print operator
B001 Do not use bare `except:`
B004 Using `hasattr(x, '__call__')` to test
if `x` is callable is unreliable.
B305 `.next()` is not a thing on Python 3. Use the `next()` builtin.
B306 `BaseException.message` has been deprecated as of Python 2.6
and is removed in Python 3.
B007 Loop control variable 'key' not used within the loop body.
remain below issues in ignores:
E402 module level import not at top of file
./service-mgmt-api/sm-api/sm_api/cmd/__init__.py:25
Hxxx since which are related with document format
F811 redefinition of unused '<foo>' from line <x>
./service-mgmt-tools/sm-tools/sm_tools/sm_configure.py:18
F821 undefined name 'e'
./service-mgmt-api/sm-api/sm_api/common/utils.py:448
B006 Do not use mutable data structures for argument defaults.
./service-mgmt-api/sm-api/sm_api/common/service.py:59
B008 Do not perform calls in argument defaults.
./service-mgmt-api/sm-api/sm_api/openstack/common/timeutils.py:117
Test have been done:Build,Deploy,some smc command,such as smc service-list,
smc service-show, sm-dump, etc
Story: 2003430
Task: 26524
Change-Id: I3e2a4a31f87e3ff66cfce86f54285e830ee1c3dc
Signed-off-by: Sun Austin <austin.sun@intel.com>
remove "__metaclass__ = abc.ABCMeta"
and adding decorator "@six.add_metaclass(abc.ABCMeta)" on class
and removing pep8 ignore case
Story: 2003430
Task: 27476
Change-Id: If60b8d5662d9a87b217a9b1d48a2c3e9b037884b
Signed-off-by: Sun Austin <austin.sun@intel.com>
the version flake8 3.6.0 will cause below error
W504 line break after binary operator
W605 invalid escape sequence '\w'
F901 'raise NotImplemented' should be 'raise NotImplementedError'
Change-Id: If9a8c678aa1b573ec7b4e5ad324ba86c5d90b959
Signed-off-by: Sun Austin <austin.sun@intel.com>
Partial-Bug: 1799721
change "except ValueError, e:"
to "except ValueError as e:"
and remove tox H231 from ignore for pep8 check
Story:2003430
Task: 26522
Change-Id: I06c7646c375ada7f8f06f870a7bdb0d7fc282e5a
Signed-off-by: Sun Austin <austin.sun@intel.com>
We want to default to running all tox environments under python 3, so
set the basepython value in each environment.
We do not want to specify a minor version number, because we do not
want to have to update the file every time we upgrade python.
We do not want to set the override once in testenv, because that
breaks the more specific versions used in default environments like
py35 and py36.
Change-Id: I98a58d37d067569ad73429ece9f49780bfe73e97
The W291,W292,W391,W503,W601 warnings were fixed and
tox.ini updated accordingly.
Story: 2002803
Task: 26911
Change-Id: I1e5f0b1f72b06ad8b5cac07921e9d14171623ba0
Signed-off-by: Erich Cordoba <erich.cordoba.malibran@intel.com>
The voting linters job will now run pylint on the python code.
All failing pylint codes are currently suppressed.
Further tasks will be created to cleanup those failing tests.
The only code changes were comments which perform inline suppression
of pylint warnings. Those lines are not meant to be fixed since those
imports cannot succeed in a tox env.
Story: 2002803
Task: 26883
Change-Id: I4a25599fb60f58b168dbec001d3f2d24e0e2c235
Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
The purpose of this commit is to:
- make this pep8 zuul job voting
- convert from pep8 to flake8
- add the bugbear plugin
- suppress any tests that are currently failing
- prevent fixed errors from being re-introduced
Further tasks will be required to un-suppress the
failing tests and make them pass
Story: 2002803
Task: 26833
Change-Id: I0421ebb3ce486c066f968052c38b733b3a145114
Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
Baseline changes to comply with Release Notes Management
based in Reno [0] a release notes manager.
[0] https://docs.openstack.org/reno/latest/
Story: 2003101
Task: 25748
Change-Id: I7d7fdfe38d6a22c0bb8195e9bc82c2df759d06c7
Signed-off-by: Abraham Arce <abraham.arce.moreno@intel.com>