-
Notifications
You must be signed in to change notification settings - Fork 15
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
feat: print workflow uri immediately even when using --wait flag #663
base: main
Are you sure you want to change the base?
Conversation
… using --wait flag
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.
Looks good 🙂 Just some minor requests.
uri, output := a.outputWithURI(cmdOutput) | ||
uri, out, scanErr := a.outputWithURI(stdoutPipe) | ||
if scanErr != nil { | ||
return uri, out, scanErr |
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.
Please garbage collect the cmd and the pipe to avoid zombie processes 🙂
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.
Thanks for pointing this out. I added a defer
function for cleanup. Also, please feel free to nitpick all my PRs since I am very new to Go.
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.
Will do :) Regarding the defer: This is now also called in the happy path. IMO it should be enough to just do
_ = stdoutPipe.Close()
_ = cmd.Wait()
in the scanErr case and that's 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.
Updated, thanks!
if len(matches) != 2 { | ||
a.logger.Warn("Couldn't find workflow name in output - can't construct URI for launched workflow") | ||
return "", output | ||
matches := nameRe.FindStringSubmatch(line) |
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.
Even the matching can be skipped if uri
is already set, right?
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.
Updated the flow to address this
No description provided.