-
Notifications
You must be signed in to change notification settings - Fork 243
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
Allow a project to be specified in --downloadSource #3044
Allow a project to be specified in --downloadSource #3044
Conversation
Hi @Kamran64. Thanks for your PR. I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/ok-to-test |
/retest |
1 similar comment
/retest |
I don't think that this is a good experience. From the begging of odo we have a philosophy that if you want to run interactive mode you do it from start, that means that you just do When we start invoking interactive mode partially (just for some parameters and only if some conditions are met) it becomes really hard to create scripts that use odo. I would prefer odo to show an error when you do |
hmm :-( is making it inconsistent with other flags :-( |
@kadel - I agree with the first point, will push a commit that downloads the first project if there are multiple whilst warning the user of this. On your second point: I'm not too sure of any feasible solutions to get around this until its fixed in the package.. We could:
|
I was thinking about it, It would solve the problem, but I'm afraid |
Is the project mentioned here different from |
These are starter projects (specified in the Devfile). Typically there will be one, but there could be multiple projects.
Would love to get some feedback/suggestions on how to achieve this with best UX |
+1 @Kamran64 I really think that odo should not jump into an interactive mode like this.
|
@neeraj-laad @kadel - I agree this flow makes more sense. Thanks! |
@girishramnani - I can see this point too. This is supposed to allow the user to specify a devfile project. We will have to clarify this in docs/help text. |
Comments have been addressed in the latest commit. Now:
I'll see if I can restart a discussion via an issue/PR to |
I think we have terminology confusion here regarding the terminology "project", with this new feature, we have two definitions for "project" now:
IMO, we should either make the terminology more clear in both our code (eg. help page, comment, etc) and documentation or we choose to use another terminology such as |
I agree with @kadel, it's inconsistent with other flags if I run
Especially this help message |
Another comment from UX perspective for this use case:
I think we should return the project name directly to user in warning message instead of simply return we are downloading the
|
@GeekArthur - ah I didn't realise the default value would be displayed in the help text. Maybe we can change the name to something clearer that indicates a devfile project has to be passed after the |
Regarding integration test, even though we remove the sub-interactive mode this feature still need to be tested for full-interactive mode as users can use their own devfile with multiple/single projects in their working directory, given currently we don't have tests for interactive mode, we have to wait for this issue #2194, @amitkrout any progress for that issue? It would be great we can finish that as soon as possible. |
/area devfile |
@GeekArthur - Are you suggesting we implement interactive mode to some level in this PR? |
Codecov Report
@@ Coverage Diff @@
## master #3044 +/- ##
==========================================
+ Coverage 44.69% 46.01% +1.32%
==========================================
Files 107 108 +1
Lines 10126 10259 +133
==========================================
+ Hits 4526 4721 +195
+ Misses 5164 5082 -82
- Partials 436 456 +20
Continue to review full report at Codecov.
|
Not adding extra interactive mode to this PR, just adding auto tests to test the changes with existing interactive mode to ensure no regression, but that can't be implemented for now due to #3044 (comment), for this PR I manually test it, so we all good. |
Understood, just wanted to be sure. I changed the default string and warning message so hopefully the help text is a little bit more clear now. As for the |
I agree that the terminology is confusing :-( |
@johnmcollier @kadel Done :) |
/retest |
/approve |
/retest |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kadel 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 |
Looks good to me, i believe the documentation has been updated in this PR. |
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.
Code looks good, and CI failure is known flake.
/lgtm
/retest |
What type of PR is this?
/kind feature
What does does this PR do / why we need it:
This PR will enable the user to specify which project they want to download when using the
--downloadSource
flag. If no project is specified when using the flag, we download the first one in the list if there is only one, or resort to interactive mode if there are multiple.Due to a limitation with the
NoOptDefVal
attribute inflags
the format must be--downloadSource=<project-name>
or just--downloadSource
. See: spf13/pflag#134Which issue(s) this PR fixes:
Fixes: #3000
How to test changes / Special notes to the reviewer:
Set odo to experimental mode
Run an
odo create nodejs --downloadSource
and optionally specify a project using--downloadSource=<project-name>
.Since the currently supported devfiles only have one project, the tests don't cover the interactive mode portion (although I'm not sure how that could be tested anyway)