-
Notifications
You must be signed in to change notification settings - Fork 24
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
The CLI Client #198
The CLI Client #198
Conversation
* add workflow dispatch client * add build metadata inferer
* Moved main logic to cli_main * Polling happens in cli_main. client.wf_poller just leave the API to query workflow run status * TODO optimize out redundent passing `accessToken`s as func args
* add spiners to indicate waiting for workflow run to show up
3db7a78
to
c8e3028
Compare
Signed-off-by: Zhijie Yang <zhijie.yang@canonical.com>
c8e3028
to
edf6f07
Compare
1717a25
to
b12ffe5
Compare
cfe0015
to
0aae871
Compare
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.
ty for the changes. just a bunch of nits, and over @rebornplusplus approves it we should be good to merge it
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.
First pass. An overall go-specific review. Please check if the functionality works or not.
Error handling needs to be a bit better in my opinion. In lots of places, we are trying to handle the errors from within the function by printing or panicking, which although would most likely work, is not a nice way to do it and on the rarest of occasions, might just break. Let's change those up to return said errors from the function.
func foo(args Type) (RetType, error) {
...
// return errors whenever something does not work
...
}
...
val, err := foo(bar)
if err != nil {
// Handle the error here.
logger.Panicf("foo does not work: %v", err)
}
If, indeed, error-handling within the function is a must, we can do something like this too:
func foo(args Type) (ret RetType, err error) {
defer func() {
if err != nil {
// Handle the error here. Example:
logger.Panicf(err)
}
}()
...
}
1edd792
to
7a6e701
Compare
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.
Just checked the go stuffs -- looks OK to me for a first start. Nice work!
PS. please check whether it works properly or not :) I don't have much context about oci-factory.
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.
can u pls ensure all comments are resolved?
All resolved. |
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.
Great! Thanks
Ping the @canonical/rocks team.
Description
This pull request implements a cli client for OCI Factory, such that it is no longer required to create pull requests to trigger image builds and releases for the images.
For details see specification RK040.