-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
refactor ShouldDisplaySurveyPrompt from config package to survey #6187
refactor ShouldDisplaySurveyPrompt from config package to survey #6187
Conversation
ac887dd
to
125f305
Compare
Codecov Report
@@ Coverage Diff @@
## master #6187 +/- ##
==========================================
- Coverage 71.09% 71.08% -0.01%
==========================================
Files 484 485 +1
Lines 21602 21603 +1
==========================================
- Hits 15357 15356 -1
- Misses 5263 5264 +1
- Partials 982 983 +1
Continue to review full report at Codecov.
|
125f305
to
406cea6
Compare
ef9f309
to
1b1471f
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.
Is it worth moving recentlyPromptedOrTaken()
and isSurveyPromptDisabled()
(and tests) into the survey package too?
pkg/skaffold/config/util.go
Outdated
} | ||
|
||
func isSurveyPromptDisabled(configfile string) (*ContextConfig, bool) { | ||
func IsSurveyPromptDisabled(configfile string) (*ContextConfig, bool) { | ||
cfg, err := GetConfigForCurrentKubectx(configfile) |
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.
Can we get rid of this for-current-kubectx? Especially since we may now deploy to multiple kubecontexts?
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.
That needs a separate PR i feel. everywhere global config is resolved based on current context.
Created an issue here #6189
3f23d60
to
fd92f9a
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.
I thought the magic reprompting date was 2 weeks, so the 10 days threw me for a loop.
I found it out too when test failed. |
…eate a new timeutil package
e8e4a7d
to
0e7646f
Compare
0e7646f
to
2b6541b
Compare
relates to #6166
Should merge after #6185
Refactor config.ShouldDisplaySurveyPrompt to survey.ShouldDisplaySurveyPrompt and align with method
survey.DisplaySurveyPrompt
Motivation:
With changes proposed in #6185, we will need the survey package to handle parsing of skaffold.yaml to check if any relevant active surveys need to be shown to users.
In this Pr
ShouldDisplaySurveyPrompt
,isSurveyPromptDisabled
andrecentlyPromptedOrTaken
to survey packageTestShouldDisplaySurveyPrompt
,TestRecentlyPromptedOrTaken
andTestIsSurveyPromptDisabled
to survey packagecurrent
variable used for testing in survey package as mentioned by @briandealwis in Add survey config and framework to show feature surveys to skaffold users. #6185 (comment)Note: unfortunately we cant get rid of
current
in https://github.com/GoogleContainerTools/skaffold/blob/master/pkg/skaffold/config/util.go#L56 yet as the WriteConfig tests override it.timeutil
package which has utility method to parse date string and compare time.