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

Improve CLI functionality and CLI tests #30

Merged
merged 6 commits into from
Mar 13, 2024

Conversation

synkd
Copy link
Collaborator

@synkd synkd commented Feb 13, 2024

This PR is another step in the manifester inventory/CLI improvement effort. It adds functionality to and testing for the CLI with the goal of making Manifester useful for interactive users in addition to its current primary usecase in automated workflows.

@synkd synkd added the DRAFT Work in progress label Feb 13, 2024
@synkd synkd force-pushed the improve_cli_functionality_and_tests branch 3 times, most recently from c97cc7b to 3aa142f Compare February 14, 2024 19:36
@synkd
Copy link
Collaborator Author

synkd commented Feb 14, 2024

Sample output of simple and detailed inventory display (using mocked data):

$ manifester inventory
[I 240214 14:34:24 commands:43] Displaying local inventory data
--------------------------------------
| Index | Allocation Name            |
--------------------------------------
| 0     | test_user-ilOfTAtg         |
--------------------------------------
$ manifester inventory --details
[I 240214 14:34:28 commands:51] Displaying detailed local inventory data
0:
    entitlementQuantity: 4
    name: test_user-ilOfTAtg
    simpleContentAccess: enabled
    type: Satellite
    url: https://api.access.redhat.com/management/v1/allocations/774307a608004e6ca8f7411ccef75ef4
    uuid: 774307a608004e6ca8f7411ccef75ef4
    version: sat-6.14

Copy link
Member

@JacobCallahan JacobCallahan left a comment

Choose a reason for hiding this comment

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

Great progress! Some minor suggestions

tests/test_manifester.py Outdated Show resolved Hide resolved
tests/test_manifester.py Outdated Show resolved Hide resolved
@@ -97,7 +111,7 @@ def post(self, *args, **kwargs):
self.access_token = "this is a simulated access token"
return self
if args[0].endswith("allocations"):
self.uuid = "1234567890"
self.uuid = f"{SUB_ALLOCATION_UUID}"
Copy link
Member

Choose a reason for hiding this comment

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

same string conversion comment

tests/test_manifester.py Outdated Show resolved Hide resolved
@synkd synkd force-pushed the improve_cli_functionality_and_tests branch from 3aa142f to 668d3b8 Compare February 28, 2024 17:16
Copy link
Member

@JacobCallahan JacobCallahan left a comment

Choose a reason for hiding this comment

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

No obvious issues seen, nice job!

synkd added 6 commits March 11, 2024 16:22
This PR is another step in the manifester inventory/CLI improvement
effort. It adds functionality to and testing for the CLI with the goal
of making Manifester useful for interactive users in addition to its
current primary usecase in automated workflows.

Requires SatelliteQE#29, so starting
this in draft status.
This commit adds a 'manifester delete' command and makes various changes
to support its implementation. Notably, it adds a `minimal_init` option
to Manifester's `__init__` method to allow instantiating Manifester
objects with a subset of the attributes required for a full Manifester
run. This change does require some modifications to the structure of the
settings file, which I will push in a subsequent commit.

This commit also uses the `minimal_init` option to add a CLI option to
sync the inventory from RHSM, implements some changes suggested in
review, and makes several other small tweaks.
@synkd synkd force-pushed the improve_cli_functionality_and_tests branch from d095df5 to d6e6423 Compare March 11, 2024 20:23
@synkd synkd merged commit 8ff1e29 into SatelliteQE:master Mar 13, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DRAFT Work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants