subscription-manager icon indicating copy to clipboard operation
subscription-manager copied to clipboard

wip: Remove deprecated commands

Open Glutexo opened this issue 1 year ago • 6 comments

Only keep it as systempurpose subcommand.

CCT-402

Glutexo avatar Jun 17 '24 14:06 Glutexo

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

Glutexo avatar Jun 26 '24 10:06 Glutexo

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 avatar Jun 26 '24 14:06 Glutexo

Or maybe not. 🤔 This line looks suspicious:

https://github.com/candlepin/subscription-manager/blob/dd68e24b5e28bc6469aea87e101422a55edbfb5f/test/cli_command/test_addons.py#L32

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

Glutexo avatar Jun 26 '24 14:06 Glutexo

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

Glutexo avatar Jun 26 '24 14:06 Glutexo

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 avatar Jun 26 '24 14:06 Glutexo

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 avatar Jul 01 '24 13:07 Glutexo

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

This PR will need to wait until that is merged.

(also, is it still "wip"?)

ptoscano avatar Jul 15 '24 13:07 ptoscano

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

Glutexo avatar Jul 15 '24 13:07 Glutexo