Commit Graph

18 Commits

Author SHA1 Message Date
Hervé Beraud 7b649af0c1 Dropping lower constraints testing
We facing errors related to the new pip resolver, this
topic was discussed on the ML and QA team proposed to
to test lower-constraints [1].

I propose to drop this test because the complexity and recurring pain needed
to maintain that now exceeds the benefits provided by this mechanismes.

[1] http://lists.openstack.org/pipermail/openstack-discuss/2020-December/019390.html

Change-Id: Ifcaf6993517d02bf54cd144efd247832947a009f
2021-04-16 14:40:05 +01:00
Stephen Finucane e103baa002 pre-commit: Resolve dependency conflicts
hacking 3.1.0 depended on 'flake8<3.8.0,>=3.6.0', while we were
specifying flake 3.8.3. This resulted in an error when using the
dependency resolver introduced in pip 20.3. Resolve this by bumping to
hacking 3.2.0.

We also remove bandit and pre-commit from test-requirements, since these
are linters which are not managed by upper-constraints and are not
necessary to run tests. oslo.context is also specified in both
requirements.txt and test-requirements.txt, so we remove it from the
latter.

Change-Id: I829870c327b73b583877b9b969ee38f0bcaa1495
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2021-01-18 15:48:28 +00:00
Ghanshyam Mann 5180e9674f Add policy file selection logic when default changing to yaml
As part of community goal[1], each services are changing the default
value of 'CONF.oslo_policy.policy_file' config option from 'policy.json'
to 'policy.yaml'. oslo policy select the default value from
CONF.oslo_policy.policy_file which will be policy.yaml as service will
start changing the default. To avoid breaking the existing deployment which
are relying on old default (policy.json) file, a new fallback logic
is implemented. If new default file 'policy.yaml' does not exist but old
default 'policy.json' exist then fallback to use old default file.

Each services are going to add upgrade checks and warnings for using JSON
formatted policy file so in future we cna remove this fallback logic.

This logic was done in nova in Victoria cycle when nova changed the
default value - https://review.opendev.org/#/c/748059/ . Moving this
to oslo policy side will avoid the duplication on services side.

Also it provides a flag to disable this fallback.

[1] https://governance.openstack.org/tc/goals/selected/wallaby/migrate-policy-format-from-json-to-yaml.html

Change-Id: If72b2fcc3cfd8116b575ed7b9e3870df634fd9af
2020-11-19 11:30:23 -06:00
haixin 298c86f1e6 Remove all usage of six library
Replace six with Python 3 style code.

Change-Id: I3d0c35e237484409d8410601ec482fac0dacf30d
2020-10-06 15:56:50 +08:00
Ghanshyam Mann 9ae15390da [goal] Migrate testing to ubuntu focal
As per victoria cycle testing runtime and community goal[1]
we need to migrate upstream CI/CD to Ubuntu Focal(20.04).

Fixing:
- bug#1886298
Bump the lower constraints for required deps which added python3.8 support
in their later version.


Story: #2007865
Task: #40207

Closes-Bug: #1886298

[1] https://governance.openstack.org/tc/goals/selected/victoria/migrate-ci-cd-jobs-to-ubuntu-focal.h>

Change-Id: I97072055f880915cef6c5c2f0210730e7bbe5119
2020-09-11 00:18:17 +00:00
Zuul 3502f73be8 Merge "Remove the unused coding style modules" 2020-05-26 13:50:33 +00:00
Andreas Jaeger b3b1bd0d44 Switch to newer openstackdocstheme and reno versions
Switch to openstackdocstheme 2.2.0 and reno 3.1.0 versions. Using
these versions will allow especially:
* Linking from HTML to PDF document
* Allow parallel building of documents
* Fix some rendering

Update Sphinx version as well.

Remove docs requirements from lower-constraints, they are not needed
during install or test but only for docs building.

openstackdocstheme renames some variables, so follow the renames
before the next release removes them. A couple of variables are also
not needed anymore, remove them.

Depends-On: https://review.opendev.org/728938
Change-Id: I565a343d875cea144928da007a93f0b93a5d4274
2020-05-18 20:56:38 +02:00
jacky06 c535a7a841 Remove the unused coding style modules
Python modules related to coding style checks (listed in blacklist.txt in
openstack/requirements repo) are dropped from lower-constraints.txt
as they are not actually used in tests (other than pep8).

more info: https://github.com/openstack/requirements/blob/master/blacklist.txt

Change-Id: Ib503fa525533ac7e663dc5990520bf27743a7dce
2020-05-15 17:18:43 +00:00
Arthur Dayne 8ce161986a Bump oslo.utils to 3.40.0
Because the bug #1804528 has been fixed in oslo.utils,
we need to add an explicit dependency on oslo.utils to
support removing "the conversion to dict" code snippet in
oslo.policy.For more details please refer to
https://review.opendev.org/#/c/717191

Change-Id: I4eb614dcb194d4f2668ba2259e624f850e0f1dfd
2020-04-07 16:08:24 +08:00
Sean McGinnis ced4d8eae4
Use unittest.mock instead of third party mock
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.

Change-Id: Ib1f840f0cb778219f7640a2ca307847a090de6aa
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-03-31 14:38:48 -05:00
Hervé Beraud 5fb2045c7a [ussuri][goal] Drop python 2.7 support and testing
OpenStack is dropping the py2.7 support in Ussuri cycle.

Complete discussion & schedule can be found in
-
http://lists.openstack.org/pipermail/openstack-discuss/2019-October/010142.html
- https://etherpad.openstack.org/p/drop-python2-support

Ussuri Communtiy-wide goal:
https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html

Change-Id: If6a07eee86a2aaf65bdf9fbb338809ad47e02a46
2020-02-06 07:21:40 +00:00
pengyuesheng 8fc7612079 Bump the openstackdocstheme extension to 1.20
Some options are now automatically configured by the version 1.20:
- project
- html_last_updated_fmt
- latex_engine
- latex_elements
- version
- release.

Change-Id: I2c9f7b72a52edde7b18dc66bcc8c655630b3bbc2
2019-11-12 17:09:11 +08:00
caoyuan e6fe8b29ec tox: Keeping going with docs
Sphinx 1.8 introduced [1] the '--keep-going' argument which, as its name
suggests, keeps the build running when it encounters non-fatal errors.
This is exceptionally useful in avoiding a continuous edit-build loop
when undertaking large doc reworks where multiple errors may be
introduced.

[1] https://github.com/sphinx-doc/sphinx/commit/e3483e9b045

Change-Id: I9af0e8323b85d47983274b4d45b27f6c036ea5a8
2019-10-24 14:54:15 +08:00
OpenStack Proposal Bot 2fe652067b Updated from global requirements
Change-Id: Iafa01298a49342ce8b0a1405d2d8ea2b61b3e198
2019-07-03 12:34:24 -07:00
Lance Bragstad 7a2d79eafc Add domain scope support for scope types
This commit makes it easier for services to protect APIs meant for
domain-only operations. It does this by making "domain-scope" an
official scope type to check for during policy enforcement.

A good example of where this would be useful is protecting the user
API in keystone, since user's are technically owned by domains.

This commit bumps the version of oslo.context to 2.22.0, which also
has domain support.

Depends-On: https://review.openstack.org/#/c/613635/

Change-Id: Ifc83a5f261bc823060eca5c4d0a4bf07966794c4
2018-11-30 14:52:36 +00:00
Lance Bragstad 775641a5fc Teach Enforcer.enforce to deal with context objects
The ``creds`` dictionary passed into oslo.policy's enforce() method
assumes a lot of the same values already specified by oslo.context
RequestContext objects.

This commit teaches enforce() to handle being passed an instance of
a RequestContext object, and populate credential values accordingly.

Change-Id: Ia74bf6c40b1e05a1c958f4325e00f68be28d91b9
Closes-Bug: 1779172
2018-07-09 16:46:57 +00:00
Lance Bragstad 8f74e2ba28 Fix requirements and convert to stestr
This commit fixes two issues that are currently blocking the gate.

The first is that it bumps the Sphinx requirement to be within
acceptable constraints. The second is that it converts oslo.policy to
use stestr instead of testr. This is all being done in one patch
because proposing them individually causes deadlock (the patch to
bump the sphinx requirement fails because we're still using testr and
the patch to convert to stestr fails the requirements-check job).

The following explains the reasoning behind the stestr change.

With the upgrade to oslotest 3.6.0 [0], testr no longer works [1].
This is because oslotest no longer requires testr and we don't depend
on it directly in oslo.policy.

[0] d5a3c58f71
[1] 897823fbd6

Change-Id: I6dac4c8e7b39c9b80cc8f3728763e8d783c9e940
2018-07-02 17:30:07 +00:00
Doug Hellmann 509cf0839a add lower-constraints job
Create a tox environment for running the unit tests against the lower
bounds of the dependencies.

Create a lower-constraints.txt to be used to enforce the lower bounds
in those tests.

Add openstack-tox-lower-constraints job to the zuul configuration.

See http://lists.openstack.org/pipermail/openstack-dev/2018-March/128352.html
for more details.

Change-Id: Iea9bdd9bfe535b8a25dbef18dac52323df9af9ac
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-03-24 21:02:41 -04:00