-
Notifications
You must be signed in to change notification settings - Fork 244
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
Adds disclaimer that experimental mode is enabled #2786
Adds disclaimer that experimental mode is enabled #2786
Conversation
1a3e2eb
to
06c9d99
Compare
Codecov Report
@@ Coverage Diff @@
## master #2786 +/- ##
==========================================
+ Coverage 43.60% 43.64% +0.04%
==========================================
Files 94 94
Lines 8726 8743 +17
==========================================
+ Hits 3805 3816 +11
- Misses 4557 4563 +6
Partials 364 364
Continue to review full report at Codecov.
|
/retest |
Platform issue |
experimentalOutputMsg := "Experimental mode is enabled, use at your own risk" | ||
Expect(helper.CmdShouldPass("odo", "create", "nodejs")).To(ContainSubstring(experimentalOutputMsg)) | ||
Expect(helper.CmdShouldPass("odo", "push")).To(ContainSubstring(experimentalOutputMsg)) | ||
|
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.
also a check that when experimental is turned off, this string is gone
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.
Ah yes, I'll add that.
@@ -197,6 +197,14 @@ func Swarningf(format string, a ...interface{}) string { | |||
return fmt.Sprintf(" %s%s%s", yellow(getWarningString()), suffixSpacing, fmt.Sprintf(format, a...)) | |||
} | |||
|
|||
// Warning will output in an appropriate "progress" manner | |||
func Experimental(a ...interface{}) { |
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't we just use some of the other functions for this? like the warning function below
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.
Ah no, because that'll add the whole warning symbol:
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.
TBH I think the warning symbol would look appropriate
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 reason I made this function separate is so we do not have the indenting and the warning symbol, for example:
Experimental mode is enabled, use at your own risk
Validation
✓ Checking Devfile compatibility [43501ns]
✓ Validating Devfile [38035ns]
vs
⚠️ Experimental mode is enabled, use at your own risk
Validation
✓ Checking Devfile compatibility [43501ns]
✓ Validating Devfile [38035ns]
IMO the bottom one looks kind of odd without the newline. So I went with the first one (separate function).
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.
Yeah the newline makes more sense, but can we still keep the warning symbol. Looks cool and approriate TBH.
@cdrage rebase please and please address mrinal's comments. Otherwise looks good to me |
pkg/log/status.go
Outdated
@@ -197,6 +197,14 @@ func Swarningf(format string, a ...interface{}) string { | |||
return fmt.Sprintf(" %s%s%s", yellow(getWarningString()), suffixSpacing, fmt.Sprintf(format, a...)) | |||
} | |||
|
|||
// Warning will output in an appropriate "progress" manner |
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.
warning->Experimental
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.
Woops. Thanks!
06c9d99
to
f71ec12
Compare
@mik-dass your comments have been addressed 👍 |
you forgot https://github.com/openshift/odo/pull/2786/files#r401546048 :D |
f71ec12
to
f78a7e4
Compare
/retest |
helper.CopyExample(filepath.Join("source", "nodejs"), context) | ||
|
||
// Check that it will contain the experimental mode output | ||
experimentalOutputMsg := "Experimental mode is enabled, use at your own risk" |
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.
It seems like we are exposing experimental feature putting original feature at risk. AFAIK experimental feature is some functionality/feature added to the original product to get more feedback from the user side and ofcoures there is a trade-off if it breaks but it should never have bad impact on the original product functionality/feature.
The message Experimental mode is enabled, use at your own risk
exactly opposite what i mentioned above. Please counter my arguments
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.
@amitkrout This message just informs the user that experimental mode is enabled and somethings may work differently. So if a user activates this mode accidentally, he gets a warning and thus can choose to stop the process.
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.
Cool!!!
@mik-dass Actually recently i came across a issue #2813, so thought the message is for original feature too. You can find certain scenario where your justification contradicts. For example
$ ODO_EXPERIMENTAL=true odo create nodejs --project test321 --context ../tests/examples/source/nodejs/
I am creating a regular nodejs component with experimental enabled.
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.
You can find certain scenario where your justification contradicts.
Within the code itself, something might work differently for experimental mode. We are just informing the user that something might go wrong if the mode is activated, not that it will. It might pass without failure too.
For example odo push
might push using the devfile if enabled or will push a normal nodejs component if disabled.
The warning will inform him straight away that push might work differently since he is in experimental mode and certain features might be missing.
f78a7e4
to
04f5637
Compare
04f5637
to
4775465
Compare
if experimental.IsExperimentalModeEnabled() { | ||
|
||
// Add a disclaimer that we are in *experimental mode* | ||
log.Experimental("Experimental mode is enabled, use at your own risk") |
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 agree with the general idea, but I'm not sure if I'd want to show the message for every odo create
and odo push
with experimental mode enabled.
I'm not sure how feasible this would be (you tell me 😉 ), but what about only showing it for the first (or first n
) odo
commands used by the user once it's enabled? Or maybe only showing it when odo preference set experimental true
is called?
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.
Ah, I don't think that'd be feasible for the first n
commands.
But in terms of the output, I think it's viable since honestly, with me switching from set experimental true
from false to true all the time testing PR's, I sometimes end up pushing a devfile instead of what I think is a regular component, since there was no output from odo create
.
Perhaps we can output it only for odo create
and that's it? What do you think?
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.
Yeah, having it display during odo create
seems reasonable to me 👍
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.
AWesome! Updated.
**What type of PR is this?** /kind documentation **What does does this PR do / why we need it**: Adds a disclaimer that experimental mode is enabled when using `odo create` or `odo push`. See asciinema: [![asciicast](https://asciinema.org/a/A6ITI1wNQL9hahhLsCz4DT6wQ.svg)](https://asciinema.org/a/A6ITI1wNQL9hahhLsCz4DT6wQ) **Which issue(s) this PR fixes**: N/A **How to test changes / Special notes to the reviewer**: ```sh odo preference set experimental true git clone https://github.com/openshift/nodejs-ex odo create nodejs odo push ``` Signed-off-by: Charlie Drage <charlie@charliedrage.com>
4775465
to
b5e4cb0
Compare
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: girishramnani The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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.
Changes look good and work as expected for me. Having the message display during just odo create
works nicely 👍
/lgtm
What type of PR is this?
/kind documentation
What does does this PR do / why we need it:
Adds a disclaimer that experimental mode is enabled when using
odo create
orodo push
.See asciinema:
Which issue(s) this PR fixes:
N/A
How to test changes / Special notes to the reviewer:
Signed-off-by: Charlie Drage charlie@charliedrage.com