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

Remove devfile push cmd #2598

Conversation

kanchwala-yusuf
Copy link
Contributor

What type of PR is this?

/kind feature

What does does this PR do / why we need it:
This PR removes the push-devfile command and replaces it's behavior by adding the --devfile flag to the odo push command itself.

Which issue(s) this PR fixes:

Fixes #2538

How to test changes / Special notes to the reviewer:
The experimental mode needs to be enabled and the --devfile flag needs to be explicitly set for the devfile feature to work.

@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. Required by Prow. label Feb 12, 2020
@elsony
Copy link

elsony commented Feb 12, 2020

Do we need the --devfile flag to decide whether we use the devfile path for odo push? It means that the user will need to specify --devfile on every odo push command. Will it be simpler if we detect the existence of the devfile in the project to switch to use the devfile code path for odo push when EXPERIMENTAL flag is set to true?

@kanchwala-yusuf
Copy link
Contributor Author

/retest

@kanchwala-yusuf
Copy link
Contributor Author

Do we need the --devfile flag to decide whether we use the devfile path for odo push? It means that the user will need to specify --devfile on every odo push command. Will it be simpler if we detect the existence of the devfile in the project to switch to use the devfile code path for odo push when EXPERIMENTAL flag is set to true?

@elsony,
While the devfile feature is in experimental mode, wouldn't it make sense to provide the odo user with flexibility to choose between the orthodox odo push behavior and the new devfile feature? The --devfile precisely does that. If we automatically detect the presence of devfile.yaml, even though the experimental mode is enabled, there is no way for the user to switch back to the old odo push behavior. The only way is to disable the experimental mode.

We may add other experimental features which are not related to devfiles (operator hub integration for example), in such a case we end up using devfiles even for these experimental features.

Your suggestion would definitely be helpful, when the devfile feature is not in experimental mode anymore and devfile is accepted as the default standard for configuring odo.

cc: @kadel

@kanchwala-yusuf kanchwala-yusuf changed the title [WIP] Remove devfile push cmd Remove devfile push cmd Feb 13, 2020
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. Required by Prow. label Feb 13, 2020
@kanchwala-yusuf
Copy link
Contributor Author

/test v4.2-integration-e2e-benchmark

@kadel
Copy link
Member

kadel commented Feb 13, 2020

Do we need the --devfile flag to decide whether we use the devfile path for odo push? It means that the user will need to specify --devfile on every odo push command. Will it be simpler if we detect the existence of the devfile in the project to switch to use the devfile code path for odo push when EXPERIMENTAL flag is set to true?

@elsony,
While the devfile feature is in experimental mode, wouldn't it make sense to provide the odo user with flexibility to choose between the orthodox odo push behavior and the new devfile feature? The --devfile precisely does that. If we automatically detect the presence of devfile.yaml, even though the experimental mode is enabled, there is no way for the user to switch back to the old odo push behavior. The only way is to disable the experimental mode.

We may add other experimental features which are not related to devfiles (operator hub integration for example), in such a case we end up using devfiles even for these experimental features.

Your suggestion would definitely be helpful, when the devfile feature is not in experimental mode anymore and devfile is accepted as the default standard for configuring odo.

cc: @kadel

I was actually also thinking that if experimental is enabled and there is devfile.yaml in the directory odo push should automatically pick it up.
One of the reasons why ODO_EXPERIMENTAL can be useful is to test odo behavior before we make it default. And I think that this is how it should work.

EXPERIMENTAL devfile.yaml present .odo/config.yaml present odo push behavior odo push --devfile devfile.yaml
TRUE yes yes use devfile.yaml use devfile.yaml
TRUE yes no use devfile.yaml use devfile.yaml
TRUE no yes use .odo/config.yaml use devfile.yaml
TRUE no no error out (not existing component) error out (not existing component)
FALSE yes yes use .odo/config.yaml error out (not existing flag --devfile)
FALSE yes no use .odo/config.yaml error out (not existing flag --devfile)
FALSE no yes use .odo/config.yaml error out (not existing flag --devfile)
FALSE no no error out (not existing component) error out (not existing flag --devfile)

--devfile flag is still needed as it will force the use of devfile even if someone names it differently. For example ODO_EXPERIMENTAL=true odo push --devfile mydevfile.yaml

@kanchwala-yusuf
Copy link
Contributor Author

Do we need the --devfile flag to decide whether we use the devfile path for odo push? It means that the user will need to specify --devfile on every odo push command. Will it be simpler if we detect the existence of the devfile in the project to switch to use the devfile code path for odo push when EXPERIMENTAL flag is set to true?

@elsony,
While the devfile feature is in experimental mode, wouldn't it make sense to provide the odo user with flexibility to choose between the orthodox odo push behavior and the new devfile feature? The --devfile precisely does that. If we automatically detect the presence of devfile.yaml, even though the experimental mode is enabled, there is no way for the user to switch back to the old odo push behavior. The only way is to disable the experimental mode.
We may add other experimental features which are not related to devfiles (operator hub integration for example), in such a case we end up using devfiles even for these experimental features.
Your suggestion would definitely be helpful, when the devfile feature is not in experimental mode anymore and devfile is accepted as the default standard for configuring odo.
cc: @kadel

I was actually also thinking that if experimental is enabled and there is devfile.yaml in the directory odo push should automatically pick it up.
One of the reasons why ODO_EXPERIMENTAL can be useful is to test odo behavior before we make it default. And I think that this is how it should work.

EXPERIMENTAL devfile.yaml present .odo/config.yaml present odo push behavior odo push --devfile devfile.yaml
TRUE yes yes use devfile.yaml use devfile.yaml
TRUE yes no use devfile.yaml use devfile.yaml
TRUE no yes use .odo/config.yaml use devfile.yaml
TRUE no no error out (not existing component) error out (not existing component)
FALSE yes yes use .odo/config.yaml error out (not existing flag --devfile)
FALSE yes no use .odo/config.yaml error out (not existing flag --devfile)
FALSE no yes use .odo/config.yaml error out (not existing flag --devfile)
FALSE no no error out (not existing component) error out (not existing flag --devfile)
--devfile flag is still needed as it will force the use of devfile even if someone names it differently. For example ODO_EXPERIMENTAL=true odo push --devfile mydevfile.yaml

@kadel,
Wouldn't it make sense to implement the above matrix when the devfile feature implementation is complete? Currently, only the devfile parser has been implemented. The complete odo push workflow for devfile is still under development.

We can implement the above matrix, once the devfile feature implementation is complete and then gradually move the devfile feature out of the experimental mode.

Another aspect here is that with the above matrix, wouldn't it be difficult for us to add any other feature into experimental mode, since we would be defaulting to devfile feature?

@codecov
Copy link

codecov bot commented Feb 13, 2020

Codecov Report

Merging #2598 into master will decrease coverage by 0.14%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2598      +/-   ##
==========================================
- Coverage   42.77%   42.62%   -0.15%     
==========================================
  Files          74       74              
  Lines        7089     7089              
==========================================
- Hits         3032     3022      -10     
- Misses       3768     3774       +6     
- Partials      289      293       +4
Impacted Files Coverage Δ
pkg/component/watch.go 66% <0%> (-6.67%) ⬇️

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 e21d6c6...7e54afb. Read the comment docs.

@kanchwala-yusuf
Copy link
Contributor Author

After having a chat with @kadel, it seems that we want the features in experimental mode to work just the way we would want them to work when these features are removed out of the experimental mode. So, I would make the necessary changes to accommodate for the suggestion given by @kadel and @elsony .

@kanchwala-yusuf
Copy link
Contributor Author

/test v4.1-integration-e2e-benchmark

@amitkrout
Copy link
Contributor

How to test changes / Special notes to the reviewer:
The experimental mode needs to be enabled and the --devfile flag needs to be explicitly set for the devfile feature to work.

@kanchwala-yusuf As a user i want to visualize the change done by this pr, so can you please elaborate it or may be the steps would really be helpful.

@kadel
Copy link
Member

kadel commented Feb 14, 2020

/approve

@openshift-ci-robot
Copy link
Collaborator

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. Required by Prow. label Feb 14, 2020
@dharmit
Copy link
Member

dharmit commented Feb 17, 2020

After having a chat with @kadel, it seems that we want the features in experimental mode to work just the way we would want them to work when these features are removed out of the experimental mode. So, I would make the necessary changes to accommodate for the suggestion given by @kadel and @elsony .

Do we think this will have any impact on the work-flow of Adapters that use our tool? If yes, have we discussed the changes they need to make?

Copy link
Member

@dharmit dharmit left a comment

Choose a reason for hiding this comment

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

Just one question in the code and one question outside the code. Looks good otherwise. 👍

@@ -32,6 +34,9 @@ const PushRecommendedCommandName = "push"
// PushOptions encapsulates options that push command uses
type PushOptions struct {
*CommonPushOptions

// devfile path
devfilePath string
Copy link
Member

Choose a reason for hiding this comment

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

Why not make this a part of the CommonPushOptions struct in common_push.go?

Copy link
Contributor Author

@kanchwala-yusuf kanchwala-yusuf Feb 17, 2020

Choose a reason for hiding this comment

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

Because the changes in this PR do not affect the common push code path in common_push.go.

In my understanding, common push has code which is common to the various odo push code paths whereas in the case of devfile there is no common code at all (atleast for now).

Copy link
Member

Choose a reason for hiding this comment

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

I think odo push is commong across different use cases, i.e., local sourcetype or git sourcetype or binary sourcetype. It behaves according to the underlying sourcetype. Considering DevFile is going to replace odo config (.odo/config.yaml) at some point, IMO, it would make more sense to make devfilePath string a part of CommonPushOptions.

Having said that, I agree that it's probably OK to keep it as-is right now. I hope we don't forget/overlook when we make it a default behaviour. 😉

@kadel
Copy link
Member

kadel commented Feb 17, 2020

Do we think this will have any impact on the work-flow of Adapters that use our tool? If yes, have we discussed the changes they need to make?

Not at this point. This is one of the reasons why we want to hide it under an experimental flag, at least for now.

@dharmit
Copy link
Member

dharmit commented Feb 18, 2020

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. Required by Prow. label Feb 18, 2020
@openshift-bot
Copy link

/retest

Please review the full test history for this PR and help us cut down flakes.

8 similar comments
@openshift-bot
Copy link

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit df98d82 into redhat-developer:master Feb 19, 2020
@cdrage cdrage added the kind/feature Categorizes issue as a feature request. For PRs, that means that the PR is the implementation label Mar 12, 2020
@rm3l rm3l added estimated-size/L (20-40) Rough sizing for Epics. About 2 sprints of work for a person. and removed size/L labels Jun 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. Required by Prow. estimated-size/L (20-40) Rough sizing for Epics. About 2 sprints of work for a person. kind/feature Categorizes issue as a feature request. For PRs, that means that the PR is the implementation lgtm Indicates that a PR is ready to be merged. Required by Prow.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove push-devfile sub command from odo
10 participants