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

Do not save component name in env.yaml #5852

Merged

Conversation

cdrage
Copy link
Member

@cdrage cdrage commented Jun 21, 2022

What type of PR is this:

/kind bug

What does this PR do / why we need it:

By default we should be saving the namespace / project name, not the app name /
component name.

Which issue(s) this PR fixes:

Fixes #5780
Fixes #5886

PR acceptance criteria:

  • Unit test

  • Integration test

  • Documentation

How to test changes / Special notes to the reviewer:

Signed-off-by: Charlie Drage charlie@charliedrage.com

@netlify
Copy link

netlify bot commented Jun 21, 2022

Deploy Preview for odo-docusaurus-preview canceled.

Name Link
🔨 Latest commit 1ee8de7
🔍 Latest deploy log https://app.netlify.com/sites/odo-docusaurus-preview/deploys/62e18526bbc88700083c3245

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Jun 21, 2022
@openshift-ci openshift-ci bot requested review from feloy and valaparthvi June 21, 2022 12:50
@cdrage cdrage changed the title Don't save component name in env.yaml [WIP] Don't save component name in env.yaml Jun 21, 2022
@openshift-ci openshift-ci bot 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 Jun 21, 2022
@cdrage
Copy link
Member Author

cdrage commented Jun 21, 2022

/retest

@cdrage cdrage force-pushed the dont-save-component-name branch 2 times, most recently from d9c44d6 to 1174ff3 Compare June 22, 2022 12:29
@feloy
Copy link
Contributor

feloy commented Jun 22, 2022

I think you will have to make the change on deploy command also (pkg/odo/cli/deploy/deploy.go)

@cdrage cdrage force-pushed the dont-save-component-name branch from 1174ff3 to 116fdd2 Compare June 27, 2022 18:23
@feloy feloy changed the title [WIP] Don't save component name in env.yaml [WIP] Do not save component name in env.yaml Jun 28, 2022
@feloy
Copy link
Contributor

feloy commented Jun 28, 2022

Renaming the PR because of #5663

@odo-robot
Copy link

odo-robot bot commented Jun 29, 2022

Unit Tests on commit 7ac3c60 finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented Jun 29, 2022

Kubernetes Tests on commit 7ac3c60 finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented Jun 29, 2022

OpenShift Tests on commit 7ac3c60 finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented Jun 29, 2022

Windows Tests (OCP) on commit 7ac3c60 finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented Jun 29, 2022

Validate Tests on commit 7ac3c60 finished successfully.
View logs: TXT HTML

@cdrage cdrage force-pushed the dont-save-component-name branch 3 times, most recently from 184b1b0 to 5cb7c50 Compare July 6, 2022 17:44
@valaparthvi
Copy link
Contributor

@cdrage can you also take #5886 into account while working on this PR? Philippe mentioned your changes should fix the issue, and I was wondering if you could add a test if required.

@cdrage
Copy link
Member Author

cdrage commented Jul 7, 2022

Thanks @valaparthvi I'll cover a test.

The problem is that I am going on PTO shortly so I won't be able to get back to this for another week.

I'm also running into this issue: #5927 which is not helping with regards to diagnosing what integration test is failing. So I've been working on that so I can test these changes locally.

Unfortunately the IBM test cloud isn't showing the logging (see K8s slack) for which test is failing as the log (I presume) is too large to show.

I'll let you know what progress I get with this, but this is my current update!

@cdrage cdrage force-pushed the dont-save-component-name branch from 5cb7c50 to df24674 Compare July 7, 2022 19:56
@openshift-ci openshift-ci bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. Required by Prow. label Jul 14, 2022
@openshift-ci
Copy link

openshift-ci bot commented Jul 14, 2022

@cdrage: PR needs rebase.

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.

@cdrage cdrage force-pushed the dont-save-component-name branch from df24674 to 67e495e Compare July 18, 2022 12:46
@cdrage cdrage force-pushed the dont-save-component-name branch from 7e1e631 to 60e8f49 Compare July 21, 2022 19:12
@cdrage cdrage force-pushed the dont-save-component-name branch 2 times, most recently from 010b0a1 to fb14d31 Compare July 23, 2022 00:06
@sonarqubecloud
Copy link

Please retry analysis of this Pull-Request directly on SonarCloud.

@valaparthvi valaparthvi reopened this Jul 26, 2022
@cdrage cdrage force-pushed the dont-save-component-name branch from fb14d31 to 8940174 Compare July 26, 2022 23:39
@cdrage
Copy link
Member Author

cdrage commented Jul 26, 2022

Rebasing and re-pushing, but up for another review! 👍

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. Required by Prow. label Jul 27, 2022
@rm3l rm3l self-requested a review July 27, 2022 15:45
Copy link
Member

@rm3l rm3l left a comment

Choose a reason for hiding this comment

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

LGTM feature-wise, but would it be possible to clean up the code by removing both Name and AppName fields from the ComponentSettings struct?
I guess this will require cleaning up further things, like removing the GetApplication and GetName methods from the LocalConfigProvider interface as well..

Maybe I've missed something, but I think that this way, we would be sure no one can use that information (I've tested this PR against an existing project that already has component and app names in its env.yaml files, but then from the code perspective, there is currently nothing in this PR preventing from loading and using such information).

@cdrage
Copy link
Member Author

cdrage commented Jul 27, 2022

LGTM feature-wise, but would it be possible to clean up the code by removing both Name and AppName fields from the ComponentSettings struct? I guess this will require cleaning up further things, like removing the GetApplication and GetName methods from the LocalConfigProvider interface as well..

Maybe I've missed something, but I think that this way, we would be sure no one can use that information (I've tested this PR against an existing project that already has component and app names in its env.yaml files, but then from the code perspective, there is currently nothing in this PR preventing from loading and using such information).

Let's leave this for now for a future refactor as that'd have to include a lot of changes to LocalConfigProvider and ComponentSEttings.

<!--
Thank you for opening a PR! Here are some things you need to know before submitting:

1. Please read our developer guideline: https://github.com/redhat-developer/odo/wiki/Dev:-odo-Dev-Guidelines
2. Label this PR accordingly with the '/kind' line
3. Ensure you have written and ran the appropriate tests: https://github.com/redhat-developer/odo/wiki/Dev:-Writing-and-running-tests
4. Read how we approve and LGTM each PR: https://github.com/redhat-developer/odo/wiki/Pull-Requests:-Review-guideline

Documentation:

If you are pushing a change to documentation, please read: https://github.com/redhat-developer/odo/wiki/Documentation:-Contributing
-->

**What type of PR is this:**

<!--
Add one of the following kinds:
/kind feature
/kind cleanup
/kind tests
/kind documentation

Feel free to use other [labels](https://github.com/redhat-developer/odo/labels) as needed. However one of the above labels must be present or the PR will not be reviewed. This instruction is for reviewers as well.
-->
/kind bug

**What does this PR do / why we need it:**

By default we should be saving the namespace / project name, not the app name /
component name.

**Which issue(s) this PR fixes:**
<!--
Specifying the issue will automatically close it when this PR is merged
-->

Fixes redhat-developer#5780
Fixes redhat-developer#5886

**PR acceptance criteria:**

- [X] Unit test

- [X] Integration test

- [X] Documentation

**How to test changes / Special notes to the reviewer:**

Signed-off-by: Charlie Drage <charlie@charliedrage.com>
@cdrage cdrage force-pushed the dont-save-component-name branch from 8940174 to 1ee8de7 Compare July 27, 2022 18:34
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. Required by Prow. label Jul 27, 2022
@openshift-ci
Copy link

openshift-ci bot commented Jul 27, 2022

New changes are detected. LGTM label has been removed.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

No Coverage information No Coverage information
1.3% 1.3% Duplication

@openshift-ci
Copy link

openshift-ci bot commented Jul 27, 2022

@cdrage: The following test 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/unit 40f6804 link true /test unit

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.

@rm3l
Copy link
Member

rm3l commented Jul 28, 2022

LGTM feature-wise, but would it be possible to clean up the code by removing both Name and AppName fields from the ComponentSettings struct? I guess this will require cleaning up further things, like removing the GetApplication and GetName methods from the LocalConfigProvider interface as well..
Maybe I've missed something, but I think that this way, we would be sure no one can use that information (I've tested this PR against an existing project that already has component and app names in its env.yaml files, but then from the code perspective, there is currently nothing in this PR preventing from loading and using such information).

Let's leave this for now for a future refactor as that'd have to include a lot of changes to LocalConfigProvider and ComponentSEttings.

Alright - let's track this in a separate issue then.

/approve

@openshift-ci
Copy link

openshift-ci bot commented Jul 28, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rm3l

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 Jul 28, 2022
@valaparthvi
Copy link
Contributor

/override ci/prow/v4.10-integration-e2e

@openshift-ci
Copy link

openshift-ci bot commented Jul 28, 2022

@valaparthvi: Overrode contexts on behalf of valaparthvi: ci/prow/v4.10-integration-e2e

In response to this:

/override ci/prow/v4.10-integration-e2e

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.

@cdrage cdrage added the lgtm Indicates that a PR is ready to be merged. Required by Prow. label Jul 28, 2022
@cdrage
Copy link
Member Author

cdrage commented Jul 28, 2022

Re-added LGTM due to rebase

@openshift-merge-robot openshift-merge-robot merged commit 83e9945 into redhat-developer:main Jul 28, 2022
cdrage added a commit to cdrage/odo that referenced this pull request Aug 31, 2022
<!--
Thank you for opening a PR! Here are some things you need to know before submitting:

1. Please read our developer guideline: https://github.com/redhat-developer/odo/wiki/Dev:-odo-Dev-Guidelines
2. Label this PR accordingly with the '/kind' line
3. Ensure you have written and ran the appropriate tests: https://github.com/redhat-developer/odo/wiki/Dev:-Writing-and-running-tests
4. Read how we approve and LGTM each PR: https://github.com/redhat-developer/odo/wiki/Pull-Requests:-Review-guideline

Documentation:

If you are pushing a change to documentation, please read: https://github.com/redhat-developer/odo/wiki/Documentation:-Contributing
-->

**What type of PR is this:**

<!--
Add one of the following kinds:
/kind feature
/kind cleanup
/kind tests
/kind documentation

Feel free to use other [labels](https://github.com/redhat-developer/odo/labels) as needed. However one of the above labels must be present or the PR will not be reviewed. This instruction is for reviewers as well.
-->
/kind bug

**What does this PR do / why we need it:**

By default we should be saving the namespace / project name, not the app name /
component name.

**Which issue(s) this PR fixes:**
<!--
Specifying the issue will automatically close it when this PR is merged
-->

Fixes redhat-developer#5780
Fixes redhat-developer#5886

**PR acceptance criteria:**

- [X] Unit test

- [X] Integration test

- [X] Documentation

**How to test changes / Special notes to the reviewer:**

Signed-off-by: Charlie Drage <charlie@charliedrage.com>
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. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. Required by Prow.
Projects
None yet
5 participants