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

visualize serverless function in topology #8233

Conversation

nemesis09
Copy link
Contributor

@nemesis09 nemesis09 commented Feb 24, 2021

Story:
https://issues.redhat.com/browse/ODC-5480

Problem/Description:
Serverless functions should be visually identifiable on topology

Solution:
use distinct icon and background color to distinctly identify serverless function in topology

Screens:
Topology
Screenshot from 2021-02-24 17-34-04

Topology List View
Screenshot from 2021-02-25 14-49-15

Test Coverage:
Screenshot from 2021-02-24 17-36-14

Browser Conformation:

  • Firefox
  • Chrome
  • Safari
  • Edge

@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. label Feb 24, 2021
@openshift-ci-robot openshift-ci-robot added the component/knative Related to knative-plugin label Feb 24, 2021
const {
metadata: { labels },
} = item?.obj;
const isServerlessFunction = labels && labels['boson.dev/function'];
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const isServerlessFunction = labels && labels['boson.dev/function'];
const isServerlessFunction = labels?.['boson.dev/function'];

and better put label boson.dev/function in a const as it has been used multiple places.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -0,0 +1,3 @@
.odc-serverless-function-label {
margin-left: var(--pf-global--spacer--md);
}
Copy link
Member

Choose a reason for hiding this comment

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

nit: add a new line here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done


const ServerlessFunctionLabel: React.FC = () => (
<Label variant="filled" className="odc-serverless-function-label" color="purple">
Function
Copy link
Member

Choose a reason for hiding this comment

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

localize the string

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

const {
metadata: { labels },
} = getResource(element);
const isServerlessFunction = labels && labels['boson.dev/function'];
Copy link
Member

Choose a reason for hiding this comment

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

Same here

Suggested change
const isServerlessFunction = labels && labels['boson.dev/function'];
const isServerlessFunction = labels?.['boson.dev/function'];

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@openshift-ci-robot openshift-ci-robot added the kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated label Feb 24, 2021
@nemesis09 nemesis09 changed the title [WIP] visualize serverless function in topology visualize serverless function in topology Feb 24, 2021
@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. label Feb 24, 2021
@nemesis09
Copy link
Contributor Author

@vikram-raj
I've updated the PR and addressed the reviews. PTAL

@christianvogt
Copy link
Contributor

@openshift/team-devconsole-ux @serenamarie125 are we still putting the function label in the header?

@nemesis09
Copy link
Contributor Author

/assign @invincibleJai

@nemesis09
Copy link
Contributor Author

/retest

@nemesis09 nemesis09 force-pushed the visualize-serverless-function branch 2 times, most recently from e697f24 to d7a2680 Compare February 24, 2021 17:03
@christianvogt
Copy link
Contributor

/approve

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 24, 2021
@invincibleJai
Copy link
Member

Looks good

cc @vikram-raj

@vikram-raj
Copy link
Member

@nemesis09 tests are failing because knative-plugin.json is not updated. Please run yarn i18n and update the PR.

@nemesis09
Copy link
Contributor Author

@nemesis09 tests are failing because knative-plugin.json is not updated. Please run yarn i18n and update the PR.

updated

@vikram-raj
Copy link
Member

vikram-raj commented Feb 24, 2021

image

function icon needs to be updated in the topology list view as well. nodetest is knative function.

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 25, 2021
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 25, 2021
@nemesis09
Copy link
Contributor Author

image

function icon needs to be updated in the topology list view as well. nodetest is knative function.

updated PR addressing the review comment. PTAL

Copy link
Member

@vikram-raj vikram-raj left a comment

Choose a reason for hiding this comment

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

Verified the changes. and it works as expected

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 25, 2021
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: christianvogt, nemesis09, vikram-raj

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

@vikram-raj
Copy link
Member

/retest

@openshift-merge-robot openshift-merge-robot merged commit 60182ab into openshift:master Feb 25, 2021
@spadgett spadgett added this to the v4.8 milestone Mar 1, 2021
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. component/core Related to console core functionality component/knative Related to knative-plugin kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants