-
Notifications
You must be signed in to change notification settings - Fork 9
General improvements to maestro commands #84
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
b3f2461 to
fab5ef9
Compare
|
cc @nuclearcat @aliceinwire |
chantra
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.
I did not go through the whole file, but my meta comment is that whatever is currently printed by click should go to stderr, this is essentially a "logging" backend.
Logging should go to stderr in order to keep stdout pristine with content that is parseable, be it printing json content, or any potential format.
This will enable kci-dev as a pipeable command which can do the heavy lifting of pulling stuff from the API, and empowering people to extract content return by that api without having to create their own tool.
| "Cloning repository (this might take significant time!)", fg="green" | ||
| ) | ||
| repo = Repo.clone_from(giturl, workdir) | ||
| repo.git.checkout(branch) | ||
| else: | ||
| click.secho("Pulling repository", fg="green") |
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.
same here, this would go to stdout potentially messing with parseable content from stdout.
Yeah, that makes sense. Let me update it to reflect this. |
30d6cbb to
b8c4a7d
Compare
| @@ -0,0 +1,19 @@ | |||
| #!/usr/bin/env python3 | |||
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.
This file is not called from any other file
4ce99f6 to
910aa89
Compare
|
@padovan please update the branch and rebase over main |
Add colon punctuation to separate items better. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com>
The checkout command in printing the same information multiple times before the nodes change again. Let's print it once. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com>
The bisect command doesn't call into the Maestro API, so we don't need to manipulate such code here. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com>
We are already duplicating a lot of code, even in such an earlier phase of the project. Let's change this trend and start consolidating our code base. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com>
Consolidate our API error message func. This will facilitate future usage. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com>
By returning a json, we can immediatelly parse it in the cmdline with 'jq'. That will help our scripting. Ideally we would have a --json for this, but we can change this later as kci-dev didn't reach 1.0 yet. Suggested-by:Manu Bretelle <chantra@meta.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com>
910aa89 to
9c13ea6
Compare
| if data: | ||
| kci_log(json.dumps(data, indent=4)) |
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.
So it looks like this is going to go to stderr, and not stdout because kci_log logs to stderr. But the log above is going to stdout.
We have proved that these cmds are useful. Now we need to do a serious cleanup as we move to increase our user base and expand what the kci-dev tooling can do.