engine: record and display Tiltfile logs separately#1050
Conversation
|
This is just a first pass. There's still some rough edges in the UI: build history, and the color of the dot being the ones that are foremost in my mind right now. |
| } | ||
|
|
||
| manifests, globalYAML, configFiles, err := tiltfile.Load(ctx, fileName, matching) | ||
| // TODO(dmiller) hmm, can I do this? |
There was a problem hiding this comment.
Like can I just pass u.store in to this, or will that cause problems?
| } | ||
|
|
||
| manifests, globalYAML, configFiles, err := tiltfile.Load(ctx, tiltfilePath, matching) | ||
| tlw := NewTiltfileLogWriter(st) |
There was a problem hiding this comment.
I think we also want to fork the logger in ctx so that anything that writes to the logger makes it into the tiltfile log.
There was a problem hiding this comment.
I don't think that's true, we want them to be two separate streams.
|
|
||
| IsProfiling bool | ||
|
|
||
| TiltfileLog []byte `testdiff:"ignore"` |
There was a problem hiding this comment.
this should probably be CurrentTiltfileBuild model.BuildRecord (which then also takes care of your "we might not want to grab this build" TODO)
| } | ||
|
|
||
| func bestLogs(res view.Resource) string { | ||
| if res.IsTiltfile && res.CrashLog != "" { |
There was a problem hiding this comment.
Hmm, I'd be surprised if it makes sense to have the crash log preempt the build log for tiltfiles.
I'd think we'd always want to show all the tiltfile output and any error that occurred, rather than only showing the error when there's an error, and then just not bother touching the CrashLog field.
The segregation between build and crash logs for k8s services is due to wanting to smooth things out across pod restarts, which isn't really relevant to tiltfile execution.
Or maybe I've misunderstood this behavior?
There was a problem hiding this comment.
Yeah this is a good point, let me experiment with this some more.
03fe4dc to
f8c8ad4
Compare
hyu
left a comment
There was a problem hiding this comment.
LGTM in terms of the design of the feature!
Regular (good) view:
There's a Tiltfile and an error:
There's no Tiltfile: