This version has been blacklisted in global-requirements. It's not
likely that it will get used since pip will try to grab the latest, but
let's be explicit and make sure it never is.
Change-Id: I644926e6300f646b9ddc9ac4bdf0253caef18177
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
When a volume record is soft-deleted in the database,
dependent records in other tables (for example,
Transfers, VolumeGlanceMetadata, etc.) must be soft
deleted as well. Otherwise, we will get FK dependency
errors when the database is purged.
This patch adds that support for VolumeAttachment table.
(other tables were already covered, just refactored)
Also adds tests.
Co-authored-by: Rajat Dhasmana <rajatdhasmana@gmail.com>
Co-authored-by: Brian Rosmaita <rosmaita.fossdev@gmail.com>
Change-Id: Ibfa6c4ba2f162681756ec3203991351345b65346
Related-Bug: #1542169
The flake8-logging-format extension includes several checks for things
we've had to try to catch in code reviews until now. This enables the
extension and fixes the few cases where things had slipped through code
review.
G200: Logging statements should not include the exception in logged string
is disabled since that triggers a lot more issues, some of which may be
acceptable. That can be left as a follow up exercise if we want to clean
those up and enable all checks.
Change-Id: I1dedc0b31f78f518c2ab5dee5ed7abda1c1d9296
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
testresources and testscenarios were added in ec40c3b6 to address an
issue with oslo.db not pulling in its own requirements.
tempest was used when we had the tempest plugin in the main cinder repo
and was not removed when the plugin switched to its own repo.
os-api-ref is used for building the API reference and was a leftover
from before doc/requirements.txt was added.
Change-Id: Ib4fc7cb6199c9581c19d34ea43a2d15ec9003f13
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
This adds usage of the flake8-import-order extension to our flake8
checks to enforce consistency on our import ordering to follow the
overall OpenStack code guidelines.
Since we have now dropped Python 2, this also cleans up a few cases for
things that were third party libs but became part of the standard
library such as mock, which is now a standard part of unittest.
Some questions, in order of importance:
Q: Are you insane?
A: Potentially.
Q: Why should we touch all of these files?
A: This adds consistency to our imports. The extension makes sure that
all imports follow our published guidelines of having imports ordered
by standard lib, third party, and local. This will be a one time
churn, then we can ensure consistency over time.
Q: Why bother. this doesn't really matter?
A: I agree - but...
We have the issue that we have less people actively involved and less
time to perform thorough code reviews. This will make it objective and
automated to catch these kinds of issues.
But part of this, even though it maybe seems a little annoying, is for
making it easier for contributors. Right now, we may or may not notice
if something is following the guidelines or not. And we may or may not
comment in a review to ask for a contributor to make adjustments to
follow the guidelines.
But then further along into the review process, someone decides to be
thorough, and after the contributor feels like they've had to deal with
other change requests and things are in really good shape, they get a -1
on something mostly meaningless as far as the functionality of their
code. It can be a frustrating and disheartening thing.
I believe this actually helps avoid that by making it an objective thing
that they find out right away up front - either the code is following
the guidelines and everything is happy, or it's not and running local
jobs or the pep8 CI job will let them know right away and they can fix
it. No guessing on whether or not someone is going to take a stand on
following the guidelines or not.
This will also make it easier on the code reviewers. The more we can
automate, the more time we can spend in code reviews making sure the
logic of the change is correct and less time looking at trivial coding
and style things.
Q: Should we use our hacking extensions for this?
A: Hacking has had to keep back linter requirements for a long time now.
Current versions of the linters actually don't work with the way
we've been hooking into them for our hacking checks. We will likely
need to do away with those at some point so we can move on to the
current linter releases. This will help ensure we have something in
place when that time comes to make sure some checks are automated.
Q: Didn't you spend more time on this than the benefit we'll get from
it?
A: Yeah, probably.
Change-Id: Ic13ba238a4a45c6219f4de131cfe0366219d722f
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
We've kept hacking capped for a long time now. This raises the hacking
package version to the latest release and fixes the issues that it
found.
Change-Id: I933d541d9198f9742c95494bae6030cb3e4f2499
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
If86dd619402495d9d4470b14cb270fcf53db6794 moved reno to the docs
requirements file, so it is now only installed into the docs virtual
environment. Our instructions for adding release notes state to use "tox
-e venv -- reno new [slug]" to generate the new release note. This now
fails due to reno not being present in the default virtual environment.
This add reno back to test-requirements to make sure it is present for
generating new release notes.
Change-Id: I394c1f802409137d95a82ed6d1a4b82cf755b9e7
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Cleanup doc/requirements to just use what is needed for doc building.
Move reno to doc/requirements, add doc8 to test-requirements.
update tox.ini:
* doc8 should be in pep8 as linter and not docs according to PTI [1]
* Only build main doc in docs environment, CI uses this and we waste
just time building api-ref as well, there's a separate environment for
this. This follows PTI [1]
* Do not include requirements file for docs building, it's not needed
with apidoc.
* Use common deps for all docs build environments.
Cleanup doc/source/conf.py, with the switch to api-doc a lot of settings
are not needed anymore, also the eventlet bug is fixed.
Update openstackdocstheme to 1.20.0 and which allows to remove obsolete
setting of html_last_updated_fmt, project, latex_elements from conf.py.
Add doc8 to lower-constraints to make requirments-check happy.
[1] https://governance.openstack.org/tc/reference/project-testing-interface.html#documentation
Change-Id: If86dd619402495d9d4470b14cb270fcf53db6794
E731s are be fixed, since use of lambdas makes code
harder to debug.
Ignore E402 and W503/W504 since these don't make a
sensible case for us to change code.
This also requires fixing some E501 errors that should
have already been detected, but weren't.
E117 and E305 errors are disabled for the moment,
and are fixed in a subsequent patch.
Pin pycodestyle to 2.5.0.
Change-Id: Ia06940cff7c3b71938eddb271d2cb8170e02e954
Bandit 1.6.0 changes the behavior of the '-x' option so that it now
supports glob patterns. Update our tox file to use to correctly exclude
test code from bandit scans. This requires bumping our minimum bandit
version.
For additional details, refer to ML Thread[1]
[1] http://lists.openstack.org/pipermail/openstack-discuss/2019-May/006116.html
Change-Id: I0b61934067bfb69ed3375f14bb1e05c9eeb694ad
Removes a non-exception from the map and adds tests to check the
consistency of message_field.Action and .Detail fields.
Updates test-requirements and lower-constraints to use the most
recent version of ddt allowed by current upper-constraints. (An
included test uses the idata decorator, which allows passing an
iterator to the test data.)
Closes-bug: #1822025
Change-Id: I0cad6589b145fac430942ccbb27279db7b3b152f
Due to migration of gate jobs to bionic, several packages were
incompatible with the distro.
This patch bumps the version of incompatible packages to the
lowest compatible version.
Change-Id: I9f0fec25444ed865d56d0d250fb6d840ab5b4095
Reno was moved over to doc/requirements.txt when that was created
because it is needed for releasenotes builds. But with its removal
from the other requirements files, doing something like the
recommended "tox -e venv -- reno new xxx" to create a new release
note fails with reno missing from any venv's created since it was
removed.
This adds reno back in to test-requirements.txt so it is installed
when creating the venv, ummm... venv.
Change-Id: Id2e0325b0ce8e18bb9a65318fb3fc52777753536
testr is part of testrepository, we invoke testr through os-testr
in Cinder and testrepository is dpendency of os-testr, we don't
invoke testr directly, so don't need dependency testrepository.
Change-Id: Ieb0662b1ea35e12387dc12c2b2eec7c3880d9c3b
Make use of doc8 to verify all rst files which are not
autogenerated for errors and fail if there are any issues
found. The doc8 checks are now part of the tox 'docs'
environment and ran automatically. Checks can also be called
direcly via 'tox -e docs'.
Fix all issues found by doc8.
Closes-Bug: #1566765
Change-Id: I2b25247030a1aadcfe029c9e071ef17f2f72046b
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
This is unneeded, we can just use json here and
not need an additional dep, since we use the json
module in many places in Cinder.
Change-Id: I5988c190659d349ad16debb4cd6e435e325975fe
mox3 was used for unit tests. But now we replace it with mock.
So I think there no need to keep it in test-requirement.txt.
Change-Id: Id2179d6611d95939b359d62942e4b4e3f64e1715
Since tempest-lib codebase is moved to tempest.lib from tempest-10.0.0
So we need to switch to tempest.
Change-Id: I3f762133781e26b079ab61f8ddd3ba1e0552c1c1
Looks like we should now be able to add oslo.versionedobjects[fixtures]
to test-requirements.txt and remove it from tox.ini, so this commit does
that.
Change-Id: I420ea16d8ad6d883e7c2c8de80f912ea35500367