Skip to content
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

Remove orquesta #241

Merged
merged 47 commits into from
Sep 24, 2024
Merged

Remove orquesta #241

merged 47 commits into from
Sep 24, 2024

Conversation

anish-mudaraddi
Copy link
Collaborator

Description:

This feature branch removes orquesta workflows entirely

Special Notes:


Submitter:

Have you (where applicable):

  • Added unit tests?
  • Checked the latest commit runs on Dev?
  • Updated the example config file(s) and README?

Reviewer

Does this PR:

  • Place non-StackStorm code into the lib directory?
  • Have unit tests for the action/sensor and lib layers?
  • Have clear and obvious action parameter names and descriptions?

anish-mudaraddi and others added 3 commits August 2, 2024 15:05
Remove class - use functions instead. Now openstack_project

we now take `conn` - openstack connection object for each function

remove unnecessary functions
refactor tests for openstack_identity
MAINT: refactor Openstack API openstack_identity
@anish-mudaraddi anish-mudaraddi marked this pull request as draft August 2, 2024 15:04
anish-mudaraddi and others added 26 commits August 2, 2024 19:02
we re-implement this class as standalone functions

Split this into network, router and subnet modules

We've removed unnecessary methods
update tests for new functions
now its just standalone functions - much easier to read and understand
update tests for new function
convert to simpler function
not needed at the moment since find_user is only used in one place
re-work openstack api security group tests to work with new functions
disable too-many-arguments for test
MAINT:  Refactor Openstack API - openstack_roles
MAINT: Openstack API Refactor - security groups
MAINT: Openstack API refactor - quota
added docstring for fixture
MAINT: refactor Openstack API - network
this will delete dead code no longer needed
rewrite project creation without orquesta

TODO: rewrite actions and tests
no need to set descriptions so remove them, I will remove the need to provide a description in the api functions in a follow up PR
PROTO: project creation scripts without orquesta
This is so we can remove all the unnecessary code under actions.src.*. We're only keeping useful actions here - other ones can be easily done using openstack cli so we shouldn't re-invent the wheel here
PROTO: moving useful actions into workflow folder
These actions were used by orquesta workflow but now that we've got python functions for creating internal and external projects, we don't need to maintain these actions - so we'll remove them. Some of these make no sense to maintain as standalone actions
These were entrypoints for now deleted actions and so no longer needed
Actions that require access to openstack now all go through openstack_actions.py
We define an lib_entry_point for each action which tells us how to forward on requests to functions that will handle the request in the lib layer.
Copy link

codecov bot commented Sep 6, 2024

Codecov Report

Attention: Patch coverage is 98.49699% with 15 lines in your changes missing coverage. Please review.

Project coverage is 98.20%. Comparing base (cefe13c) to head (2468e98).
Report is 165 commits behind head on main.

Files with missing lines Patch % Lines
lib/openstack_api/openstack_security_groups.py 89.65% 3 Missing and 3 partials ⚠️
lib/workflows/create_external_project.py 89.74% 2 Missing and 2 partials ⚠️
lib/workflows/create_internal_project.py 84.61% 2 Missing and 2 partials ⚠️
lib/openstack_api/openstack_network.py 97.77% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #241      +/-   ##
==========================================
+ Coverage   98.05%   98.20%   +0.14%     
==========================================
  Files         187      195       +8     
  Lines        8298     7636     -662     
  Branches      521      460      -61     
==========================================
- Hits         8137     7499     -638     
+ Misses        135      110      -25     
- Partials       26       27       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

anish-mudaraddi and others added 12 commits September 10, 2024 11:35
Refactor entrypoints for openstack actions
was previously string which caused issues
limit find_security_group to project we're creating before creating rules
was setting default to to_str instead of to_string breaking the enum choice
these aren't needed and we don't use them when creating the project anymore
external project workflow params need to match action
we can't call the api directly we need to use workflows as the middle-layer to handle any anciliary parts like logging
setting default quota and adding field for security group rules quota in external project create action
This now matches old orquesta workflow
actions/server.search.by.datetime.yaml Outdated Show resolved Hide resolved
actions/server.search.by.property.yaml Outdated Show resolved Hide resolved
actions/server.search.by.regex.yaml Outdated Show resolved Hide resolved
actions/user.search.by.property.yaml Outdated Show resolved Hide resolved
actions/user.search.by.regex.yaml Outdated Show resolved Hide resolved
tests/lib/openstack_api/test_openstack_network.py Outdated Show resolved Hide resolved
tests/lib/openstack_api/test_openstack_project.py Outdated Show resolved Hide resolved
tests/lib/openstack_api/test_openstack_roles.py Outdated Show resolved Hide resolved
tests/lib/openstack_api/test_openstack_roles.py Outdated Show resolved Hide resolved
tests/lib/workflows/test_project_actions.py Outdated Show resolved Hide resolved
changes to docstrings and comments mainly
@anish-mudaraddi anish-mudaraddi marked this pull request as ready for review September 24, 2024 10:00
The way stackstorm is designed means this is always going to be an issue
gmatthews20
gmatthews20 previously approved these changes Sep 24, 2024
@anish-mudaraddi
Copy link
Collaborator Author

This has been tested and has been confirmed to work on dev

.pylintrc Show resolved Hide resolved
DavidFair
DavidFair previously approved these changes Sep 24, 2024
@anish-mudaraddi anish-mudaraddi merged commit 6b90292 into main Sep 24, 2024
14 checks passed
@anish-mudaraddi anish-mudaraddi deleted the remove-orquesta branch September 24, 2024 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants