Commit Graph

29 Commits

Author SHA1 Message Date
Dale Smith 6b1856b4eb Support tox4, update style to match Black 23.1a1
This aligns code with https://github.com/psf/black/pull/3302

Depends-On: https://review.opendev.org/866943
Change-Id: Icfbca2fab8adeb677b980d01f797f194f580838e
2023-01-04 17:06:31 +13:00
Dale Smith 8ae383f9fe Fix gates for Antelope and update Django
* Zuul deprecated (and now removed) declaring shared queues at a pipeline
  level [1]. This patch fixes the syntax to make the gate work for
  adjutant.
* Updates Django version to allow upper-constraints version
* Fix Django 3.2 warnings
* Fix flake8 errors
* Remove support for Python 3.6, Python 3.7

[1] https://lists.openstack.org/pipermail/openstack-discuss/2022-May/028603.html

Change-Id: Ic369b59bb062df867d78b006f06e48cf9c98a3ee
2022-12-07 19:52:27 +13:00
Adrian Turjak 92793e349f Add pyc cleanup and black check to tox
Change-Id: Ie9343ea5993f9075fdae7f8d6e965095b59d4fb2
2020-05-06 11:34:51 +12:00
Andreas Jaeger de799a89ca Update for Python 3
This repo is now Python 3 only, make a few updates:
* Move basepython to testenv
* Require newer tox version and ignore base conflicts
* update openstackdocstheme and sphinx versions
* Use newer TOX_x for constraints

Change-Id: I1407b408bee9e848243a60d40fd7df90bf1705d1
2020-04-29 09:03:11 +02:00
Sean McGinnis 67b87e9ece
Use constraints for installing doc requirements
The docs and related tox targets were installing requirements
unconstrained. This adds enforcement of upper constraints.

Change-Id: Ia5bd8369d0b3facf51783236b5d1d3e9c7599c53
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-04-08 07:40:32 -05:00
Adrian Turjak 46045d407c Add tests for Black, and ignore reformat blame
Change-Id: Ie6c6933a46c4aedf559713d37900ecd617e93885
2020-02-21 14:52:39 +13:00
Adrian Turjak 2c62daf542 Reformat code using the Black style linter
Change-Id: I55cf016fe073e92fe4466f38b95ebdcd9ec58e84
2020-02-21 14:43:31 +13:00
Adrian Turjak ad81fdf706 Update to Django 2.2, drop py2 support
OpenStack is dropping the py2.7 support in Ussuri cycle.

Adjutant is also upgrading to Django 2.2 at the same time
which is the new Django LTS, and only supports python 3.

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

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

Change-Id: I2a429ebd6bc20385e814da03b222a1f61214a683
2020-02-14 10:42:27 +13:00
Adrian Turjak c750fd6d6c Rework Adjutant's config system to use CONFspirator
CONFspirator was written to just specifically for Adjutant
and it allows us to do oslo.config style config management
and definition with nested groups and for yaml.

This is a major change that touches vast amounts of the
code simply because of how much the config touches.

Actions, Tasks, DelegateAPIs, and Notification Handlers
now can define config in their own class and this will
be added to the config.

All the other config is located in `adjutant.config`,
with everything now registed nicely on the config tree,
and grouped in much saner ways.

CONFspirator will also now allow Adjutant to be entirely
configured via environment variables.

We have removed `modify_dict_settings` because that is
now entirely handled by CONFspirator's test utils.

`NotificationEngine`s are now `NotificationHandler`s.

`test_settings.py` is gone! And we now have better ways
to define test settings and defaults.

Project line length bumped to 88, and bugbear added to enforce
that instead.

Story: 2004488

Change-Id: I1d97d72d06b3a3a5df90355d3a4b4fe414381424
2020-02-05 19:07:04 +13:00
Adrian Turjak c9038dfe69 Major refactor of the Adjutant task layer
This patch splits out the Task layer and the API
layer. This will better allow us to build more logic
into the task layer, and better allow the APIs to be
more flexible.

This sets the foundations for future additions to task
definitions, async task processing, and an overhaul of
the config system for the service.

- Task model and logic moved to 'tasks' app
- TaskViews are now DelegateAPIs
- stage email templates have been moved to the tasks app
- better define Task model indexes
- rename task/action stage pre_approve to prepare
- rename task/action stage post_approve to approve
- Added new TaskManager class for handling tasks
- Removed redundant ip_address value on Task model
- Remove redundant UserSetPassword view
- Added custom exception handling for the API
- Add new exception types
- Simplified error responses by raising exceptions
- standardized task API response codes on 202 unless
  task is completed
- Use 503 Service Unavailable for service issues
- Various task_types changed:
    - create_project to create_project_and_user
    - invite_user to invite_user_to_project
    - reset_password to reset_user_password
    - edit_user to edit_user_roles
    - update_email to update_user_email
- reissuing task token now deletes old task tokens

Story: 2004489

Change-Id: I33381c1c65b28b69f6ffeb3d73b50be95ee30ba7
2019-12-04 14:24:57 +13:00
Andreas Jaeger f81cf9a905 Update docs building
Follow PTI [1] for doc building:
* Create doc/requirements.txt file with all docs requirements.
* Switch to openstackdocstheme and update conf.py for this.
* Move doc8 to pep8 section since it's a linter.

Additionally:
* Fix all build errors with doc building.
* Update requirements list with license info.
* Use hacking instead of flake directly.
* Remove unused _static files, those are not needed.
* Update git URLs, fix contributor guide URL
* Move README.md to RST, everything else in this repo is RST
* Publish documents to docs.o.o - note that
  https://adjutant.readthedocs.io/en/latest/ was last updated  in March
  2018

This adds jobs for building of release notes - only building since
there's no content yet - and publishing of documentation.

Publishing of api-ref can be done via:
 https://review.opendev.org/675766

[1] https://governance.openstack.org/tc/reference/project-testing-interface.html#documentation

Change-Id: I82f56ef5ea800899b2a8db795b6cf2b21d03ac7a
2019-08-11 12:06:13 +02:00
Adrian Turjak 470f253003 Added support for reno release notes
Change-Id: Icf04f5d8dcb4a04f567e6a3bc10760831e6b43cc
2019-07-02 15:04:04 +12:00
Ghanshyam Mann 286c530451 Dropping the py35 testing
All the integration testing has been moved to
Bionic now[1] and py3.5 is not tested runtime for
Train or stable/stein[2].

As per below ML thread, we are good to drop the py35
testing now:
http://lists.openstack.org/pipermail/openstack-discuss/2019-April/005097.html

[1] http://lists.openstack.org/pipermail/openstack-discuss/2019-April/004647.html
[2]
https://governance.openstack.org/tc/reference/runtimes/stein.html
https://governance.openstack.org/tc/reference/runtimes/train.html

Change-Id: Ifcaeb42f78e37af1bdb046eb92985212c0574d0c
2019-05-17 13:14:40 +12:00
Adrian Turjak afcf377ccb Update requirements files
Sync up requirement files with global-requirements,
and set tox default envs to be 'py3' over 'py35'

Change-Id: Ic78246a4a75b88027b4896664874d1efc587582c
2019-05-17 10:48:32 +12:00
Adrian Turjak 06cb36e46e Fix conflicts with tox
basepython when set on the testenv breaks py27 testing

Change-Id: I9907f5077cd00f6ea596e90e428aece68ac0a99e
2019-01-16 16:36:58 +13:00
Adrian Turjak d4ab292a6a Switch to ignoring pep W503
Change-Id: I3fe7b6f33fa327a9584bbad3c695032bc0a3e54a
2018-12-02 01:01:51 +13:00
huang.zhiping 99e52b0598 fix tox python3 overrides
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: I6e873ea38b4483ea477afcb8925fb8e60d65b60f
2018-08-18 01:53:08 +00:00
Adrian Turjak 553c7f4ad8 fix cover report tox job
Change-Id: I28dfc5fbe33e6a40507c30303e040b122989adff
2017-12-05 22:33:43 +13:00
Amelia Cordwell 6cbf3fa7f7 Documentation and Api Reference
* API Reference and documentation as two seperate sphinx
  document sets
* Information from the Devstack guide and README moved over
  to the new documentation
* Configuration examples
* Examples of building plugins
* Both use the new sphinx-rtd-theme

Change-Id: If347905aa14b77b5943f1a9de97f6e287b98ce95
2017-11-04 18:00:28 +13:00
Adrian Turjak e957f1ee38 fix zuul cover issues
Change-Id: Ibd7c07397c14dc23452d65fea048a7416288d3f2
2017-10-30 14:13:05 +13:00
adrian-turjak c17320c069 Update test files for openstack-infra
* also update the gitreview file
* add base doc folder for future use (and to make
  CI happy)

Change-Id: Ifd854682c8121720e940c0a7d8ac3656cbf97af0
2017-06-21 16:18:37 +12:00
Amelia Cordwell f7c62e5a87 Python3 Compatibility
Slight changes to ensure python3 compatibility, and tox running
with python3.

Change-Id: Ibe017a0f68e3779f199a56165d401cda876f710a
2017-06-15 16:23:01 +12:00
Amelia Cordwell f6ee662631 Added basepython to coverage tests
Different versions of tox default to different base versions of
python for coverage tests.

This ensures it uses python2.7.

Change-Id: I6137c43b6383909498efae45a197ef05fc00a026
2017-05-31 14:58:33 +12:00
adrian-turjak 3da809bfaa Adding support for code coverage reposting in tests.
Change-Id: I6e379747d347fc6b3d2fef00a711ae13bb62dfc5
2017-05-29 15:57:30 +12:00
adrian-turjak af986c28fc Renaming StackTask to Adjutant
* This patch is just a search and replace with minor tweaks.
* No functional changes, just renaming.

Change-Id: I103790be7c0cd9234545e25e21ab1768cb5eb131
2017-05-17 12:25:45 +12:00
adrian-turjak 1961ca91c3 Adding pep8 tests
* also fixing test posargs to allow single test running
* fixing up random pep8 failures
* removing empty or unused test modules

Change-Id: I59bb2fedeeac2b8eeb45740d16768fec59fb3e4b
2016-12-06 18:09:36 +13:00
Dale Smith 9d8adc726a Refactor action validation functions
* Removes duplication of code in validate
* Breaks large validation functions into atomic, reusable pieces in
  super classes.
* Started applying the rule where validation does not leave any side
  effects on class members other than the valid boolean.
* Validate functions are not called after the first fail, this
  gives less feedback to user, but is probably reasonable general
  assumption as some validation relies on others passing.
* Adding some tests for NewUser validation.
* Refactored how the FakeManager handled resource objects or
  ids being passed to it.
* Fixed some issues with logs being spat out during tests.

Change-Id: Iea0afce06e92d8f1a1bda0cc03a32c00909828d1
2016-11-07 14:22:22 +13:00
adriant ff89e2e960 rename stacktask cmd to stacktask-api
* Done so that the client tool and the server
  can both be installed to the same environment.

Change-Id: Ic188c87600730b51b3dbf97b244b979d205e7eb9
2016-03-09 15:04:10 +13:00
adriant 572b22a1a8 adding tox file and some changes to test setup
Change-Id: Icd1f3965e4c2617c16c3440e79df17aa4ca0ab0a
2015-07-31 16:44:03 +12:00