-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[supervisor] Better reflect incremental prebuilds in prebuild logs #4293
Conversation
959ffc1
to
7d82037
Compare
4e6a4dd
to
d35e81e
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.
Transcribed feedback from 1:1 call.
d35e81e
to
36aa666
Compare
36aa666
to
5fb06bb
Compare
🎰 /werft run 👍 started the job as gitpod-build-jx-incremental-prebuild-logs.8 |
Can't be tested ( |
🎰 /werft run 👍 started the job as gitpod-build-jx-incremental-prebuild-logs.9 |
🎰 /werft run 👍 started the job as gitpod-build-jx-incremental-prebuild-logs.10 |
Works as expected! 🎉 @csweichel please take another look 👀 |
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 know this feels a bit like coming out of the blue, but a unit test for importParentLogAndGetDuration
would be nice. If you moved the defer os.Remove()
out of importParentLogAndGetDuration
you could re-write that function to use the new io/fs
package (testing/fstest
in the test correspondingly).
Considering the increased emphasis on testing is a recent development, I'd be ok to approve this PR as is - but tests sure would be nice :)
) | ||
if _, err := os.Stat(fileName); err == nil { | ||
// If the file already exists (from a parent prebuild), temporarily move it so that it doesn't get truncated. | ||
_ = os.Rename(fileName, oldFileName) |
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.
What happens if the rename fails? Considering the error is ignored here, a comment as to why ignoring it is fine would be handy
a085c69
to
e6354de
Compare
e6354de
to
c0964d7
Compare
If a prebuild is based on another prebuild, we currently truncate & overwrite the prebuild logs, and "forget" about how long the parent prebuild took.
Instead, we should:
That's what this PR does.
How to test