-
Notifications
You must be signed in to change notification settings - Fork 582
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: Add stage to build logs #577
Conversation
615dfc2
to
4bb7597
Compare
Codecov Report
@@ Coverage Diff @@
## main #577 +/- ##
==========================================
- Coverage 63.48% 63.47% -0.01%
==========================================
Files 195 194 -1
Lines 11205 11311 +106
Branches 85 85
==========================================
+ Hits 7113 7180 +67
- Misses 3336 3369 +33
- Partials 756 762 +6
Continue to review full report at Codecov.
|
cc3e174
to
7ed283c
Compare
This adds a stage property to logs, and refactors the job logs cliui. It also adds tests to the cliui for build logs!
@kylecarbs can this be closed or does it still need to be done? |
Confused here too. This will be merged. |
@@ -109,7 +109,7 @@ func start() *cobra.Command { | |||
if err != nil { | |||
return xerrors.Errorf("create tunnel: %w", err) | |||
} | |||
_, _ = fmt.Fprintf(cmd.OutOrStdout(), cliui.Styles.Paragraph.Render(cliui.Styles.Wrap.Render(cliui.Styles.Prompt.String()+`Tunnel started. Your deployment is accessible at:`))+"\n "+cliui.Styles.Field.Render(accessURL)) | |||
_, _ = fmt.Fprintf(cmd.OutOrStdout(), cliui.Styles.Paragraph.Render(cliui.Styles.Wrap.Render(cliui.Styles.Prompt.String()+`Tunnel started. Your deployment is accessible at:`))+"\n "+cliui.Styles.Field.Render(accessURL)+"\n") |
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 thinking out loud, we do the fmt.Fprintf(cmd.OutOrStdout(), ...)
a lot. Might be nice to have a wrapper that accepts just cmd
and ensures a newline is appended.
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 was thinking that too. I'll make this change in another PR.
Source: proto.LogSource_PROVISIONER_DAEMON, | ||
Level: sdkproto.LogLevel_INFO, | ||
Stage: "Setting up", | ||
CreatedAt: time.Now().UTC().UnixMilli(), |
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.
The .UTC()
seems redundant because unix is already UTC.
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.
Also, is there a way we can enforce that unix milliseconds are only ever passed in here?
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.
Hmm. Maybe with a linter, but it certainly seems like a ripe place for an issue.
This adds a stage property to logs, and refactors the job logs cliui.
It also adds tests to the cliui for build logs!