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

Rework kernelci.cli with Click framework #2133

Merged
merged 4 commits into from
Oct 24, 2023

Conversation

gctucker
Copy link
Contributor

@gctucker gctucker commented Oct 17, 2023

Rework the kernelci.cli module and kci entry point using the Click framework.

Copy link
Member

@nuclearcat nuclearcat left a comment

Choose a reason for hiding this comment

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

LGTM, works on staging (legacy, api, pipeline), i assume new functionality was tested by author

@nuclearcat nuclearcat added this pull request to the merge queue Oct 24, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Oct 24, 2023
@nuclearcat nuclearcat added this pull request to the merge queue Oct 24, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Oct 24, 2023
@nuclearcat nuclearcat added this pull request to the merge queue Oct 24, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Oct 24, 2023
Copy link
Contributor Author

@gctucker gctucker left a comment

Choose a reason for hiding this comment

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

@nuclearcat It's rebased now so ready for review. You can test it manually with ./kci whoami. It also comes with unit tests but that's run automatically by GitHub already.

Add click to the list of requirements with version 8.1.3 which is the
same as in Debian stable (bookworm).  This is to be used as the new
framework for the kci command line tool.

Link: https://lore.kernel.org/all/9acfa649-4ae0-2e56-16b8-b7c24ab60a30@collabora.com/
Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com>
Rewrite the base kernelci.cli module using the Click framework rather
than argparse.  This provides a Kci base class for implementing
commands that can load default values from TOML settings, and KciS
with added secrets also loaded from TOML.

Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com>
Add a tests/test_cli.py module to cover the new kernelci.cli
implementation.

Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com>
Rework the kci entry point to use the new kernelci.cli module and
Click.  Only implement `kci whoami` for now which can be used to check
that TOML settings and secrets are loaded correctly.

Also drop "kci config validate" from the Makefile tests for now as
this needs to be reimplemented.

Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com>
@nuclearcat
Copy link
Member

Thanks, works for me

@nuclearcat nuclearcat added this pull request to the merge queue Oct 24, 2023
Merged via the queue into kernelci:main with commit 2e0ce38 Oct 24, 2023
4 checks passed
@gctucker gctucker deleted the kci-click-rework branch October 24, 2023 18:02
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.

2 participants