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

feat: Remove deprecated syspurpose top-level commands #3417

Merged
merged 1 commit into from
Jul 15, 2024

Conversation

Glutexo
Copy link
Contributor

@Glutexo Glutexo commented Jun 17, 2024

Removes addons, role, service-level, and usage commands. These are deprecated as top-level commands as they’ve been moved to the syspurpose command as sub-commands.

CCT-402

Copy link
Contributor

@jirihnidek jirihnidek left a comment

Choose a reason for hiding this comment

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

You have to at least remove addons.py and test_addons.py.

@Glutexo
Copy link
Contributor Author

Glutexo commented Jun 26, 2024

@jirihnidek The AddonsCommand class in addons.py is imported as a subcommand in syspurpose.py.

@Glutexo
Copy link
Contributor Author

Glutexo commented Jun 26, 2024

test_addons.py needs to be kept too. The command is still there, just not as a first-class command, but rather as a syspurpose command’s subcommand. The test doesn’t verify the actual CLI syntax, but rather the already invoked command.

@Glutexo
Copy link
Contributor Author

Glutexo commented Jun 26, 2024

Or maybe not. 🤔 This line looks suspicious:

argv_patcher = patch.object(sys, "argv", ["subscription-manager", "addons"])

But the tests pass even though I removed the command from managercli.

@Glutexo
Copy link
Contributor Author

Glutexo commented Jun 26, 2024

It works regardless of the argv value… 🤷🏻‍♂️

@Glutexo
Copy link
Contributor Author

Glutexo commented Jun 26, 2024

I think I found all the places where the addons command needs to be removed. I‘ll do the same for the other commands moved under the syspurpose subcommand.

@jirihnidek Do you think it’s ok this way? Didn’t I forget anything?

@Glutexo
Copy link
Contributor Author

Glutexo commented Jul 1, 2024

Interesting. In test_role.py, the setUp method doesn’t contain the argv patch present in test_addons.py. test_addons.py however works without the path just fine…

@Glutexo Glutexo force-pushed the remove-addons branch 2 times, most recently from de33e4a to d61978d Compare July 1, 2024 14:10
Copy link
Contributor

@ptoscano ptoscano left a comment

Choose a reason for hiding this comment

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

This seems generally good; please rebase it to fix the conflicts.

Also, if this is ready to be reviewed and merged, please un-draft/un-wip it, thanks.

src/subscription_manager/cli_command/syspurpose.py Outdated Show resolved Hide resolved
@Glutexo Glutexo marked this pull request as ready for review July 10, 2024 11:55
The deprecated addons, role, service-level and usage commands are no longer recognized. They are now available solely as subcommands of the syspurpose command.
@ptoscano
Copy link
Contributor

This will break the cockpit tests, which currently still use the old commands.
I just created a PR to change those: candlepin/subscription-manager-cockpit#69

This PR will need to wait until that is merged.

(also, is it still "wip"?)

@Glutexo Glutexo requested a review from ptoscano July 15, 2024 13:54
@Glutexo Glutexo changed the title wip: Remove deprecated commands Remove deprecated commands Jul 15, 2024
@Glutexo Glutexo changed the title Remove deprecated commands feat: Remove deprecated commands Jul 15, 2024
@Glutexo
Copy link
Contributor Author

Glutexo commented Jul 15, 2024

Fine-tuned the pull request, so it can be reviewed and merged:

@ptoscano ptoscano changed the title feat: Remove deprecated commands feat: Remove deprecated syspurpose top-level commands Jul 15, 2024
Copy link
Contributor

@ptoscano ptoscano left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@ptoscano ptoscano merged commit 6c57e52 into candlepin:main Jul 15, 2024
16 checks passed
@Glutexo Glutexo deleted the remove-addons branch July 16, 2024 07:21
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