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

Add runtime label based on metadata:language/projectType #6112

Merged

Conversation

feloy
Copy link
Contributor

@feloy feloy commented Sep 12, 2022

What type of PR is this:

/kind feature

What does this PR do / why we need it:

Which issue(s) this PR fixes:

Fixes #6044

PR acceptance criteria:

  • Unit test

  • Integration test

  • Documentation

How to test changes / Special notes to the reviewer:

@openshift-ci openshift-ci bot added the kind/feature Categorizes issue as a feature request. For PRs, that means that the PR is the implementation label Sep 12, 2022
@netlify
Copy link

netlify bot commented Sep 12, 2022

Deploy Preview for odo-docusaurus-preview canceled.

Name Link
🔨 Latest commit 6e50b8f
🔍 Latest deploy log https://app.netlify.com/sites/odo-docusaurus-preview/deploys/63208be4e9271d0009e29ddf

@openshift-ci openshift-ci bot requested review from cdrage and rm3l September 12, 2022 07:55
@odo-robot
Copy link

odo-robot bot commented Sep 12, 2022

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

@odo-robot
Copy link

odo-robot bot commented Sep 12, 2022

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

@odo-robot
Copy link

odo-robot bot commented Sep 12, 2022

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

@odo-robot
Copy link

odo-robot bot commented Sep 12, 2022

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

@odo-robot
Copy link

odo-robot bot commented Sep 12, 2022

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

Comment on lines +17 to +19
if runtime != "" {
labels[openshiftRunTimeLabel] = runtime
}
Copy link
Member

Choose a reason for hiding this comment

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

This is an OpenShift specific label, isn't it? It does not make sense to add it to resources that might be deployed in a K8s cluster. Can we ensure it's only added if the cluster is OC?

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'm not sure it is what has been discussed. @kadel WDYT?

Copy link
Member

Choose a reason for hiding this comment

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

This is just a label. Yes, it is OpenShift specific, but there is no harm in always applying this. It might be even better, as there might be another tooling that could eventually leverage that.
And the only OpenShift specific is it's name, functionality wise there is nothing that should tie this only to openshift

@feloy feloy force-pushed the feature-6044/runtime-label branch 3 times, most recently from e046590 to a9de64d Compare September 12, 2022 13:27
if metadata.Language != "" {
return metadata.Language
}
return metadata.ProjectType
Copy link
Member

Choose a reason for hiding this comment

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

I know we already discussed about using the language first and then the project type, but after quickly testing on Dev Sandbox, I think we should use the project type first.

image

The Deployment I created manually in Dev Sandbox has the following label: app.openshift.io/runtime=nodejs, but the one created by odo has app.openshift.io/runtime=javascript, and the right icon is not showing up in Topology View.

Copy link
Contributor Author

@feloy feloy Sep 13, 2022

Choose a reason for hiding this comment

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

What is the behaviour with Java projects?

Copy link
Member

Choose a reason for hiding this comment

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

With a Quarkus app, we have the right icon for the language (Java):

image

If I manually edit the label to use the project type (quarkus) defined in the Devfile, we have a more accurate icon for this:

image

Copy link
Member

Choose a reason for hiding this comment

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

Same point for a SpringBoot app: we currently have the same icon as Quarkus for the language (Java). But if I set the label to the project type (spring) defined in the Devfile, then we have a more specific icon for this component:

image

This is why I was thinking about using the project type first instead.

Copy link
Member

@kadel kadel Sep 13, 2022

Choose a reason for hiding this comment

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

I guess we never will be able to reliably cover all the cases. If we use projectType then there will be a problem with java-maven. I guess we just need to check what approach works for most of the cases.

I'm ok if we go with projectTyp

@sonarcloud
Copy link

sonarcloud bot commented Sep 13, 2022

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 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@rm3l
Copy link
Member

rm3l commented Sep 13, 2022

Thanks for the new changes.

/approve

@openshift-ci
Copy link

openshift-ci bot commented Sep 13, 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 Sep 13, 2022
@cdrage
Copy link
Member

cdrage commented Sep 13, 2022

Tested and works well 👍

Thanks @feloy

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. Required by Prow. label Sep 13, 2022
@feloy
Copy link
Contributor Author

feloy commented Sep 14, 2022

Flaky test

odo add binding interactive command tests
/go/src/github.com/redhat-developer/odo/tests/integration/interactive_add_binding_test.go:16
  when the component is bootstrapped
  /go/src/github.com/redhat-developer/odo/tests/integration/interactive_add_binding_test.go:48
    when binding to a service in a different namespace
    /go/src/github.com/redhat-developer/odo/tests/integration/interactive_add_binding_test.go:219
      [It] should error out if service is not found in the namespace selected
      /go/src/github.com/redhat-developer/odo/tests/integration/interactive_add_binding_test.go:240

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

@openshift-ci
Copy link

openshift-ci bot commented Sep 14, 2022

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

In response to this:

Flaky test

odo add binding interactive command tests
/go/src/github.com/redhat-developer/odo/tests/integration/interactive_add_binding_test.go:16
 when the component is bootstrapped
 /go/src/github.com/redhat-developer/odo/tests/integration/interactive_add_binding_test.go:48
   when binding to a service in a different namespace
   /go/src/github.com/redhat-developer/odo/tests/integration/interactive_add_binding_test.go:219
     [It] should error out if service is not found in the namespace selected
     /go/src/github.com/redhat-developer/odo/tests/integration/interactive_add_binding_test.go:240

/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.

@openshift-merge-robot openshift-merge-robot merged commit 32303b1 into redhat-developer:main Sep 14, 2022
valaparthvi pushed a commit to valaparthvi/odo that referenced this pull request Sep 15, 2022
…loper#6112)

* Add runtime label based on metadata:language/projectType

* Add integration tests for odo dev

* odo deploy integration test

* Reverse priority between pojectType and language
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/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.

add app.openshift.io/runtime label to resources created by odo
6 participants