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

ENH: Move to query package #290

Merged
merged 10 commits into from
Dec 16, 2024
Merged

ENH: Move to query package #290

merged 10 commits into from
Dec 16, 2024

Conversation

gmatthews20
Copy link
Collaborator

@gmatthews20 gmatthews20 commented Dec 12, 2024

Description:

Query Library has been moved to its own dedicated repository: https://github.com/stfc/openstack-query-library

This PR removes the query library directories and changes the stackstorm workflows to use the new package from the query library repository

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?

Replace openstack query to use new package
Remove openstack_query files from lib and respective unit tests, these are now in a dedicated repository, stfc/openstack-query-library
@gmatthews20 gmatthews20 force-pushed the move-to-query-package branch from 2f983a0 to 1062dc8 Compare December 12, 2024 11:37
Fix broken import in test
Change naming to be consistant
Update links in docs
@gmatthews20 gmatthews20 force-pushed the move-to-query-package branch from 1062dc8 to aeebed9 Compare December 12, 2024 11:38
Copy link

codecov bot commented Dec 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.68%. Comparing base (efd769a) to head (e513a8e).
Report is 27 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #290      +/-   ##
==========================================
- Coverage   98.24%   97.68%   -0.57%     
==========================================
  Files         239      135     -104     
  Lines        9028     4875    -4153     
  Branches      529      266     -263     
==========================================
- Hits         8870     4762    -4108     
+ Misses        137      102      -35     
+ Partials       21       11      -10     

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

Bump query library version to v0.1.3
Bump query library version to v0.1.4
@gmatthews20 gmatthews20 force-pushed the move-to-query-package branch from e4a734d to 798a31a Compare December 13, 2024 10:42
Update HypervisorSate enum so it's easier to understand and use
Refactor check valid sate into separate function
Return HypervisorState instead of string from get_hypervisor_state
Update tests
Update to work with new version of query library
@gmatthews20 gmatthews20 force-pushed the move-to-query-package branch from 798a31a to 5363a77 Compare December 13, 2024 10:44
Add new server query to find number of servers on a hypervisor
@gmatthews20 gmatthews20 force-pushed the move-to-query-package branch 5 times, most recently from 81397f6 to 8a78c64 Compare December 16, 2024 09:52
Change current state to use the name of hypervisorstate enum as expected
@gmatthews20 gmatthews20 force-pushed the move-to-query-package branch from 8a78c64 to d964134 Compare December 16, 2024 09:54
@gmatthews20 gmatthews20 marked this pull request as ready for review December 16, 2024 09:57
lib/workflows/send_errored_vm_email.py Outdated Show resolved Hide resolved


def test_get_state_unkown_status():
"""
Test hypervisor state is unknown when missing status
"""
hypervisor = {
"hypervisor_uptime": "13:37:30 up 100 days, 4:29, 19 users, load average: 0.04, 0.04, 0.0",
"hypervisor_uptime_days": 100,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an upper and/or lower limit to this or can it be any amount of days?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the value return by the hypervisor for time since its last update so has no upper limit, I guess the lower limit is 0

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool cool, was just wondering if there was a test case for 0 or an upper limit if it existed.

Fix typo in sennd errored vm email workflow
Remove line about query library development
@anish-mudaraddi anish-mudaraddi merged commit d93b5bd into main Dec 16, 2024
13 of 14 checks passed
@anish-mudaraddi anish-mudaraddi deleted the move-to-query-package branch December 16, 2024 16:28
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.

3 participants