Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@vinzenz
Copy link
Member

@vinzenz vinzenz commented Apr 20, 2021

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

@vinzenz vinzenz changed the title cli: Repo commands initial POC WIP: cli: Repo commands initial POC Apr 20, 2021
@leapp-bot
Copy link
Collaborator

Thank you for contributing to the Leapp project!

Please note that every PR needs to comply with the
Leapp Guidelines and must pass all tests in order to be mergable.

If you want to re-run tests or request review, you can use following commands as a comment:

  • leapp-ci build to run unit tests, copr build and e2e tests in OAMG CI
  • review please to notify leapp developers of review request

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.

@vinzenz vinzenz force-pushed the leapp-cli-in-repo branch 2 times, most recently from e4c94d7 to ed83e09 Compare May 5, 2021 10:19
@vinzenz vinzenz force-pushed the leapp-cli-in-repo branch from ed83e09 to 3613028 Compare May 10, 2021 09:26
@pirat89
Copy link
Member

pirat89 commented May 17, 2021

@vinzenz btw do not forget to raise the framework-version capability. From this point, it seems to me we will need to raise it to 2.0 as this is not a change compatible with previous versions of leapp. (and update of spec is expected on the leapp-repository side as well)

@pirat89
Copy link
Member

pirat89 commented May 17, 2021

(review in progress, I will finish it the next morning)

@vinzenz vinzenz force-pushed the leapp-cli-in-repo branch 3 times, most recently from 05cc61d to b18cce5 Compare May 26, 2021 17:25
@vinzenz
Copy link
Member Author

vinzenz commented May 26, 2021

@vinzenz btw do not forget to raise the framework-version capability. From this point, it seems to me we will need to raise it to 2.0 as this is not a change compatible with previous versions of leapp. (and update of spec is expected on the leapp-repository side as well)

Done

@vinzenz vinzenz force-pushed the leapp-cli-in-repo branch from b18cce5 to cd17fb2 Compare May 26, 2021 17:38
@vinzenz vinzenz changed the title WIP: cli: Repo commands initial POC cli: Automatic command discovery for leapp CLI May 27, 2021
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]>
@vinzenz vinzenz force-pushed the leapp-cli-in-repo branch from cd17fb2 to 73f298d Compare May 27, 2021 11:51
Copy link
Member

@pirat89 pirat89 left a 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

pirat89 added a commit to pirat89/leapp-repository that referenced this pull request May 31, 2021
* 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
@pirat89
Copy link
Member

pirat89 commented May 31, 2021

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.

@pirat89 pirat89 merged commit e12a38e into oamg:master May 31, 2021
pirat89 added a commit to oamg/leapp-repository that referenced this pull request May 31, 2021
* 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
pirat89 added a commit to pirat89/leapp that referenced this pull request Oct 19, 2021
## 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)
@pirat89 pirat89 mentioned this pull request Oct 19, 2021
pirat89 added a commit to pirat89/leapp that referenced this pull request Oct 19, 2021
## 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)
pirat89 added a commit that referenced this pull request Oct 19, 2021
## 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)
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