Skip to content
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

Fix Bug that prevents showing survey prompt #5027

Merged
merged 2 commits into from
Nov 13, 2020

Conversation

IsaacPD
Copy link
Contributor

@IsaacPD IsaacPD commented Nov 13, 2020

Fix bug I introduced where the survey prompt will only show if os.Stdout does not support colors i.e. when color.SetupColors(out, forceColors) does not wrap out.

Description

Fixed by actually checking if the passed io.Writer is a wrapped colorableWriter. Added a test case to ensure that color.IsStdout(color.NewWriter(os.Stdout)) returns true

Before (master):
With an empty global config and running skaffold build in examples/getting-started, the survey prompt does not show up. This is because survey.isStdout(out) returns false when out = colorableWriter{os.Stdout}.

After:
Survey prompt shows up given the same conditions above.

@IsaacPD IsaacPD requested a review from a team as a code owner November 13, 2020 20:52
@IsaacPD IsaacPD requested a review from tstromberg November 13, 2020 20:52
@google-cla google-cla bot added the cla: yes label Nov 13, 2020
@IsaacPD IsaacPD changed the title Show survey prompt with colors Fix Bug that prevents showing survey prompt Nov 13, 2020
@codecov
Copy link

codecov bot commented Nov 13, 2020

Codecov Report

Merging #5027 (f13b0fb) into master (e685dd2) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5027      +/-   ##
==========================================
- Coverage   72.19%   72.18%   -0.02%     
==========================================
  Files         365      365              
  Lines       12840    12859      +19     
==========================================
+ Hits         9270     9282      +12     
- Misses       2880     2886       +6     
- Partials      690      691       +1     
Impacted Files Coverage Δ
pkg/skaffold/survey/survey.go 41.66% <ø> (-4.49%) ⬇️
pkg/skaffold/color/formatter.go 100.00% <100.00%> (ø)
pkg/skaffold/runner/load_images.go 94.73% <0.00%> (-5.27%) ⬇️
pkg/skaffold/build/cache/hash.go 71.28% <0.00%> (-2.12%) ⬇️
pkg/skaffold/docker/dependencies.go 73.33% <0.00%> (-1.67%) ⬇️
pkg/skaffold/deploy/helm/helm.go 73.73% <0.00%> (-0.07%) ⬇️
pkg/skaffold/util/store.go 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e685dd2...f13b0fb. Read the comment docs.

Copy link
Contributor

@MarlonGamez MarlonGamez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. Nice catch on that bug 👍🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants