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

Move "GetComponentContext" to a util package #4340

Closed
dharmit opened this issue Jan 4, 2021 · 9 comments
Closed

Move "GetComponentContext" to a util package #4340

dharmit opened this issue Jan 4, 2021 · 9 comments
Labels
area/refactoring Issues or PRs related to code refactoring lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@dharmit
Copy link
Member

dharmit commented Jan 4, 2021

  • In pkg/odo/cli/url, we are calling this method which is in pkg/odo/cli/component.
  • URLCreateOptions and PushOptions are used interchangeably (as I can see, GetComponentContext is in the method set of PushOptions struct).
  • Also, this function gets the value which can be used in other CLI packages as well.

It seems like this function belongs to some kind of util package, or other top level file for some component instead of being in pkg/odo/cli/component/push.go.

Besides that, should it be removed from the method set of PushOptions and put somewhere else? Some kind of common options that are common among various different options viz. PushOptions, URLCreateOptions, ComponentOptions, etc.

Originally posted by @dharmit in #4311 (comment)

/kind discussion
/kind code-refactoring
/good-first-issue

@openshift-ci-robot
Copy link
Collaborator

@dharmit:
This request has been marked as suitable for new contributors.

Please ensure the request meets the requirements listed here.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-good-first-issue command.

In response to this:

  • In pkg/odo/cli/url, we are calling this method which is in pkg/odo/cli/component.
  • URLCreateOptions and PushOptions are used interchangeably (as I can see, GetComponentContext is in the method set of PushOptions struct).
  • Also, this function gets the value which can be used in other CLI packages as well.

It seems like this function belongs to some kind of util package, or other top level file for some component instead of being in pkg/odo/cli/component/push.go.

Besides that, should it be removed from the method set of PushOptions and put somewhere else? Some kind of common options that are common among various different options viz. PushOptions, URLCreateOptions, ComponentOptions, etc.

Originally posted by @dharmit in #4311 (comment)

/kind discussion
/kind code-refactoring
/good-first-issue

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.

@openshift-ci-robot openshift-ci-robot added kind/discussion good first issue Denotes an issue ready for a new contributor. Maintainers will help mentor new contributors. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Jan 4, 2021
@niconosenzo
Copy link
Contributor

@dharmit If this is ok for you, I may have a look and discuss some ideas before submitting any change.

@dharmit
Copy link
Member Author

dharmit commented Feb 1, 2021

@niconosenzo absolutely! Discussing before coding is always welcome! If you'd like to work on this, feel free to assign it to yourself.

@niconosenzo
Copy link
Contributor

/assign

@mik-dass
Copy link
Contributor

mik-dass commented Feb 9, 2021

In pkg/odo/cli/url, we are calling this method which is in pkg/odo/cli/component.
URLCreateOptions and PushOptions are used interchangeably (as I can see, GetComponentContext is in the method set of PushOptions struct).

We are using the GetComponentContext() in other packages like cli for URL etc to trigger the push logic for the now flag in other packages.

https://github.com/openshift/odo/blob/e7664393988c11683588232b50e944484fbea999/pkg/odo/cli/url/create.go#L189

Besides that, should it be removed from the method set of PushOptions and put somewhere else?

The fix would be to design a way so that we can trigger Push() from the component package without requiring the dependency of the component CLI code https://github.com/openshift/odo/blob/e7664393988c11683588232b50e944484fbea999/pkg/odo/cli/url/create.go#L10 but that might need a lot of refactoring.

@dharmit dharmit removed good first issue Denotes an issue ready for a new contributor. Maintainers will help mentor new contributors. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Mar 18, 2021
@niconosenzo niconosenzo removed their assignment Mar 18, 2021
@openshift-bot
Copy link

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci openshift-ci bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 16, 2021
@openshift-bot
Copy link

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten
/remove-lifecycle stale

@openshift-ci openshift-ci bot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jul 17, 2021
@openshift-bot
Copy link

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.

/close

@openshift-ci
Copy link

openshift-ci bot commented Aug 16, 2021

@openshift-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.

/close

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.

@openshift-ci openshift-ci bot closed this as completed Aug 16, 2021
@rm3l rm3l added the area/refactoring Issues or PRs related to code refactoring label Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/refactoring Issues or PRs related to code refactoring lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

6 participants