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

Separate layers : Preference #5296

Merged
merged 11 commits into from
Jan 10, 2022

Conversation

feloy
Copy link
Contributor

@feloy feloy commented Dec 16, 2021

What type of PR is this?

/kind cleanup

What does this PR do / why we need it:

Which issue(s) this PR fixes:

Part of #5247

PR acceptance criteria:

How to test changes / Special notes to the reviewer:

@openshift-ci openshift-ci bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. Required by Prow. kind/cleanup labels Dec 16, 2021
@netlify
Copy link

netlify bot commented Dec 16, 2021

✔️ Deploy Preview for odo-docusaurus-preview canceled.

🔨 Explore the source changes: 2bfa3da

🔍 Inspect the deploy log: https://app.netlify.com/sites/odo-docusaurus-preview/deploys/61dc0a4f1b8bd30007f4768a

@feloy
Copy link
Contributor Author

feloy commented Dec 16, 2021

Unit Tests finished with errors.
View logs: TXT HTML

@feloy
Copy link
Contributor Author

feloy commented Dec 16, 2021

Kubernetes Tests finished successfully.
View logs: TXT HTML

@feloy
Copy link
Contributor Author

feloy commented Dec 16, 2021

OpenShift Tests finished successfully.
View logs: TXT HTML

@feloy
Copy link
Contributor Author

feloy commented Dec 16, 2021

Kubernetes Tests finished successfully.
View logs: TXT HTML

@feloy
Copy link
Contributor Author

feloy commented Dec 16, 2021

Unit Tests finished successfully.
View logs: TXT HTML

@feloy
Copy link
Contributor Author

feloy commented Dec 16, 2021

OpenShift Tests finished successfully.
View logs: TXT HTML

@feloy feloy changed the title [wip] Separate layers : Preference Separate layers : Preference Dec 16, 2021
@openshift-ci openshift-ci bot 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 Dec 16, 2021
@feloy
Copy link
Contributor Author

feloy commented Dec 16, 2021

Kubernetes Tests finished successfully.
View logs: TXT HTML

@feloy
Copy link
Contributor Author

feloy commented Dec 16, 2021

Unit Tests finished with errors.
View logs: TXT HTML

@feloy
Copy link
Contributor Author

feloy commented Dec 16, 2021

OpenShift Tests finished successfully.
View logs: TXT HTML

@redhat-developer redhat-developer deleted a comment from odo-robot bot Dec 17, 2021
@redhat-developer redhat-developer deleted a comment from odo-robot bot Dec 17, 2021
@odo-robot
Copy link

odo-robot bot commented Dec 17, 2021

Kubernetes Tests on commit 5b04abd finished successfully.
View logs: TXT HTML

pkg/preference/implem.go Outdated Show resolved Hide resolved
Comment on lines 123 to 128
// preferenceInfo wraps the preference and provides helpers to
// serialize it.
type preferenceInfo struct {
Filename string `yaml:"FileName,omitempty"`
Preference `yaml:",omitempty"`
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it makes more sense to define this on line 174, after defining Preference type.

pkg/preference/implem.go Outdated Show resolved Hide resolved
pkg/preference/implem.go Show resolved Hide resolved
pkg/odo/cli/preference/unset_test.go Outdated Show resolved Hide resolved
pkg/preference/implem.go Show resolved Hide resolved
@dharmit dharmit mentioned this pull request Dec 20, 2021
15 tasks
@feloy
Copy link
Contributor Author

feloy commented Dec 20, 2021

Unit Tests finished with errors.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented Dec 20, 2021

Unit Tests on commit 5b04abd finished successfully.
View logs: TXT HTML

@feloy
Copy link
Contributor Author

feloy commented Dec 20, 2021

OpenShift Tests finished with errors.
View logs: TXT HTML

@feloy
Copy link
Contributor Author

feloy commented Dec 20, 2021

Kubernetes Tests finished successfully.
View logs: TXT HTML

@openshift-ci openshift-ci bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. Required by Prow. label Jan 6, 2022
@feloy
Copy link
Contributor Author

feloy commented Jan 6, 2022

/test v4.9-integration-e2e

  * could not run steps: step [release:latest] failed: release "release-latest" failed: the pod ci-op-1wjwi82z/release-latest was deleted without completing after 29s (failed containers: ) 

@feloy
Copy link
Contributor Author

feloy commented Jan 6, 2022

/test unit

  * could not run steps: step unit failed: "unit" test steps failed: "unit" pod "unit-unit-steps" failed: the pod ci-op-7nl9cs8b/unit-unit-steps was deleted without completing after 7m20s (failed containers: )

@@ -80,7 +80,7 @@ func TestWaitAndGetPodWithEvents(t *testing.T) {

podSelector := fmt.Sprintf("deploymentconfig=%s", tt.podName)

pod, err := fakeClient.WaitAndGetPodWithEvents(podSelector, corev1.PodRunning, "Waiting for component to start")
pod, err := fakeClient.WaitAndGetPodWithEvents(podSelector, corev1.PodRunning, "Waiting for component to start", time.Second)
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this test with DefaultPushTimeout?

return &CreateOptions{
PushOptions: NewPushOptions(prjClient),
PushOptions: NewPushOptions(prjClient, prefClient),
prefClient: prefClient,
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think you will need a separate prefClient here. CreateOptions 'inherits' PushOptions, thereby getting access to prefClient.

Comment on lines 31 to 37
prefClient.EXPECT().UpdateNotification()
prefClient.EXPECT().NamePrefix()
prefClient.EXPECT().Timeout()
prefClient.EXPECT().BuildTimeout()
prefClient.EXPECT().PushTimeout()
prefClient.EXPECT().EphemeralSourceVolume()
prefClient.EXPECT().ConsentTelemetry()
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't you need to return something here?

Copy link
Contributor

@valaparthvi valaparthvi left a comment

Choose a reason for hiding this comment

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

I have one more suggestion, but seems like things are working without it as well.

}

if tt.exists || tt.forceFlag {
prefClient.EXPECT().DeleteConfiguration("arg1")
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this return any error, or if nothing is mentioned, it returns a default value?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I cannot find any documentation on this, but I assume it will return the zero values for all the returned values if we don't specify any other value.

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. Required by Prow. label Jan 10, 2022
@valaparthvi
Copy link
Contributor

/approve

@openshift-ci
Copy link

openshift-ci bot commented Jan 10, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: valaparthvi

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 openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. Required by Prow. label Jan 10, 2022
@feloy
Copy link
Contributor Author

feloy commented Jan 10, 2022

/test v4.9-integration-e2e

dial tcp 3.231.171.100:6443: connect: connection refused

@openshift-ci
Copy link

openshift-ci bot commented Jan 10, 2022

@feloy: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/psi-unit-test-mac 2bfa3da link false /test psi-unit-test-mac
ci/prow/psi-unit-test-windows 2bfa3da link false /test psi-unit-test-windows
ci/prow/psi-kubernetes-integration-e2e 2bfa3da link false /test psi-kubernetes-integration-e2e

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@openshift-merge-robot openshift-merge-robot merged commit e63773c into redhat-developer:main Jan 10, 2022
rnapoles-rh pushed a commit to rnapoles-rh/odo that referenced this pull request Jan 24, 2022
* Refactor preference package

* Unit tests

* Apply suggestions from code review

Co-authored-by: Parthvi Vala <pvala@redhat.com>

* Review

* Review from Dharmit

* Replace panic with LogErrorAndExit

* Remove preference from kclient/oc_server

* Remove preference.New from devfile

* Remove preference.New from kclient/WaitAndGetPodWithEvents

* Get prefClient from CreateOptions

* Parthvi review

Co-authored-by: Parthvi Vala <pvala@redhat.com>
@rm3l rm3l added the area/refactoring Issues or PRs related to code refactoring label Jun 16, 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. area/refactoring Issues or PRs related to code refactoring 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.

5 participants