-
Notifications
You must be signed in to change notification settings - Fork 79
cli: Automatic command discovery for leapp CLI #700
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
Conversation
Thank you for contributing to the Leapp project!Please note that every PR needs to comply with the If you want to re-run tests or request review, you can use following commands as a comment:
Note: In case there are problems with tests not being triggered automatically on new PR/commit or pending for a long time, please consider rerunning the CI by commenting leapp-ci build (might require several comments). If the problem persists, contact leapp-infra. |
e4c94d7 to
ed83e09
Compare
ed83e09 to
3613028
Compare
|
@vinzenz btw do not forget to raise the |
|
(review in progress, I will finish it the next morning) |
05cc61d to
b18cce5
Compare
Done |
b18cce5 to
cd17fb2
Compare
This patch introduces a new approach in detecting the leapp cli commands. The main function will now look into the directory of leapp.cli.commands and list all directories within that directory and attempts to import a `register` function from them. If that succeeds it will call this function passing the toplevel command object to it allowing the function to register the commands and if necessary sub commands to it. This patch will also drop leapp/cli/upgrade and reintroduce it to leapp-repository in a different PR. Framework version will now be 2.0 Signed-off-by: Vinzenz Feenstra <[email protected]>
cd17fb2 to
73f298d
Compare
pirat89
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm. going to run the regression tests
* This patch introduces the `leapp` top-level commands moved over from the leapp framework git repository. The upgrade package has been split in order to facilitate the new approach of having one command per package. * The provided cli commands are now installed via rpm into the expected directory - scanned by the leapp tool for cli commands. E.g.: /usr/lib/python2.7/site-packages/leapp/cli/commands So the commands can be used by the leapp utility. Bump the required leapp-framework capability to 2.0+ (&& < 3) v1: Rebased by @pstodulk: includes the packaging changes now Co-authored-by: Petr Stodulka <[email protected]> Depends-On: oamg/leapp#700
|
See the comments in oamg/leapp-repository#662 PR. Basically tests / environemnt preparation... are broken. It's not possible to run e2e tests correctly for this PR and integration tests are broken. Merging. |
* This patch introduces the `leapp` top-level commands moved over from the leapp framework git repository. The upgrade package has been split in order to facilitate the new approach of having one command per package. * The provided cli commands are now installed via rpm into the expected directory - scanned by the leapp tool for cli commands. E.g.: /usr/lib/python2.7/site-packages/leapp/cli/commands So the commands can be used by the leapp utility. Bump the required leapp-framework capability to 2.0+ (&& < 3) v1: Rebased by @pstodulk: includes the packaging changes now Co-authored-by: Petr Stodulka <[email protected]> Depends-On: oamg/leapp#700
## Packaging - Drop the dependency on leapp-repository for Fedora and RHEL 8+ (oamg#717) - Provide builds for RHEL 7+ and Fedora (oamg#717) - Drop automatically generated Python dependences on RHEL 8+ and Fedora systems (oamg#717, oamg#716) - Bump the provided leapp-framework capability to 2.0 (oamg#700) ## Framework ### Fixes - models: Do not make references to private symbols (oamg#718) ### Enhancements - Introduce the LEAPP_DEVEL_DATABASE_SYNC_OFF envar to enable speed up writes into the leapp database by disabling synchronisation - only for development / testing purposes (oamg#732) ## Leapp ### Fixes - Fix print of the leapp help msg for Python 3.6+ (oamg#731) ### Enhancements - The leapp commands are now defined/provided by leapp-repositories; leapp discovers the specified commands automatically (oamg#700) - Add CLI support for `choices` and `default` for options of leapp commands (oamg#734) ## Modifications - Makefile: Added the `fast_lint` target to apply linters just on files different from master (oamg#733)
## Packaging - Drop the dependency on leapp-repository for Fedora and RHEL 8+ (oamg#717) - Provide builds for RHEL 7+ and Fedora (oamg#717) - Drop automatically generated Python dependences on RHEL 8+ and Fedora systems (oamg#717, oamg#716) - Bump the provided leapp-framework capability to 2.0 (oamg#700) ## Framework ### Fixes - models: Do not make references to private symbols (oamg#718) ### Enhancements - Introduce the LEAPP_DEVEL_DATABASE_SYNC_OFF envar to enable speed up writes into the leapp database by disabling synchronisation - only for development / testing purposes (oamg#732) ## Leapp ### Fixes - Fix print of the leapp help msg for Python 3.6+ (oamg#731) ### Enhancements - The leapp commands are now defined/provided by leapp-repositories; leapp discovers the specified commands automatically (oamg#700) - Add CLI support for `choices` and `default` for options of leapp commands (oamg#734) ## Modifications - Makefile: Added the `fast_lint` target to apply linters just on files different from master (oamg#733)
## Packaging - Drop the dependency on leapp-repository for Fedora and RHEL 8+ (#717) - Provide builds for RHEL 7+ and Fedora (#717) - Drop automatically generated Python dependences on RHEL 8+ and Fedora systems (#717, #716) - Bump the provided leapp-framework capability to 2.0 (#700) ## Framework ### Fixes - models: Do not make references to private symbols (#718) ### Enhancements - Introduce the LEAPP_DEVEL_DATABASE_SYNC_OFF envar to enable speed up writes into the leapp database by disabling synchronisation - only for development / testing purposes (#732) ## Leapp ### Fixes - Fix print of the leapp help msg for Python 3.6+ (#731) ### Enhancements - The leapp commands are now defined/provided by leapp-repositories; leapp discovers the specified commands automatically (#700) - Add CLI support for `choices` and `default` for options of leapp commands (#734) ## Modifications - Makefile: Added the `fast_lint` target to apply linters just on files different from master (#733)
This patch introduces a new approach in detecting the leapp cli commands.
The main function will now look into the directory of leapp.cli.commands
and list all directories within that directory and attempts to import a
registerfunction from them. If that succeeds it will call this functionpassing the toplevel command object to it allowing the function to register
the commands and if necessary sub commands to it.
This patch will also drop leapp/cli/upgrade and reintroduce it to
leapp-repository in a different PR.
Framework version will now be 2.0