-
Notifications
You must be signed in to change notification settings - Fork 177
Create a context for the progress printer #764
Conversation
We call cancel on the context once we finished so that it will stop printing stuff. This *could* fix APP-349 and could fix the errors with status code 141 that we see on our CI. Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
Codecov Report
@@ Coverage Diff @@
## master #764 +/- ##
==========================================
- Coverage 71.27% 69.52% -1.76%
==========================================
Files 67 64 -3
Lines 3837 3521 -316
==========================================
- Hits 2735 2448 -287
+ Misses 768 753 -15
+ Partials 334 320 -14
Continue to review full report at Codecov.
|
@@ -169,7 +169,9 @@ func buildImageUsingBuildx(app *types.App, contextPath string, opt buildOptions, | |||
out = os.NewFile(dockerCli.Out().FD(), "/dev/stdout") | |||
} | |||
|
|||
pw := progress.NewPrinter(ctx, out, opt.progress) | |||
ctx2, cancel := context.WithCancel(context.TODO()) |
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 think a regression test could be tricky to add here, but maybe a one line comment explaining why we have another context?
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.
maybe we can find a better name, like printerContext
?
ctx2, cancel := context.WithCancel(context.TODO()) | |
printerContext, cancel := context.WithCancel(context.TODO()) |
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.
LGTM with comment added
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 commit message is relying on APP-349
that is an internal tracking number. Maybe we can replace it by an issue here or just a few lines to describe the issue?
@@ -169,7 +169,9 @@ func buildImageUsingBuildx(app *types.App, contextPath string, opt buildOptions, | |||
out = os.NewFile(dockerCli.Out().FD(), "/dev/stdout") | |||
} | |||
|
|||
pw := progress.NewPrinter(ctx, out, opt.progress) | |||
ctx2, cancel := context.WithCancel(context.TODO()) |
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.
maybe we can find a better name, like printerContext
?
ctx2, cancel := context.WithCancel(context.TODO()) | |
printerContext, cancel := context.WithCancel(context.TODO()) |
We call cancel on the context once we finished so that it will stop
printing stuff. This could fix APP-349 and could fix the errors with
status code 141 that we see on our CI.