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

Bug 1868013: Point admin monitoring links to admin #6263

Merged

Conversation

abhinandan13jan
Copy link
Contributor

@abhinandan13jan abhinandan13jan commented Aug 7, 2020

Adresses

https://issues.redhat.com/browse/ODC-4397

Issue

Monitoring links in admin point to Dev-monitoring. Use of getCurrentPerspective poses problem in incognito

Solution

Altering Links to conditionally point to admin/dev monitoring based on the current URL(location)

Screenshot

Screencast from 08-17-2020 02_51_43 PM

Screencast from 08-07-2020 06_32_21 PM

Test

Fixed

Browser

Chrome

@openshift-ci-robot openshift-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. component/dev-console Related to dev-console labels Aug 7, 2020
@abhinandan13jan abhinandan13jan force-pushed the monitoring-links branch 2 times, most recently from 606387c to a613e50 Compare August 11, 2020 08:26
@abhinandan13jan abhinandan13jan changed the title WIP Monitoring links Point admin monitoring links to admin Aug 11, 2020
@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 Aug 11, 2020
@debsmita1
Copy link
Contributor

Thank you for working on this. This works fine, I'm just unsure about the part where you are redirecting the user to /monitoring/dashboards when clicked on view monitoring dashboard in admin perspective. In the dev side, we do show workload specific dashboard so that part is fine. May be @cshinn can help here

@abhinandan13jan
Copy link
Contributor Author

/retitle Bug 1868013: Point admin monitoring links to admin

@openshift-ci-robot openshift-ci-robot changed the title Point admin monitoring links to admin Bug 1868013: Point admin monitoring links to admin Aug 11, 2020
@openshift-ci-robot openshift-ci-robot added bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels Aug 11, 2020
@openshift-ci-robot
Copy link
Contributor

@abhinandan13jan: This pull request references Bugzilla bug 1868013, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.6.0) matches configured target release for branch (4.6.0)
  • bug is in the state NEW, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1868013: Point admin monitoring links to admin

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.

@abhinandan13jan
Copy link
Contributor Author

/kind bug

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Aug 11, 2020
@@ -132,7 +133,11 @@ const MonitoringOverview: React.FC<MonitoringOverviewProps> = (props) => {
<>
<div className="odc-monitoring-overview__view-monitoring-dashboard">
<Link
to={`/dev-monitoring/ns/${resource?.metadata?.namespace}/?workloadName=${resource?.metadata?.name}&workloadType=${resource?.kind}`}
to={
currentPath.startsWith('/k8s')
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 would be better if we can do it based on the active perspective. WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sahil143 The issue with checking last active perspective is that it returns 'admin' on incognito while You are on dev

Copy link
Contributor

Choose a reason for hiding this comment

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

@abhinandan13jan Why would last active perspective return admin on incognito while you're on dev? Both localStorage and redux store gets initialized as expected on incognito as well otherwise the application wouldn't work.

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 it's a good idea to check for a specific URL pattern. What if this component is added to some other page later which doesn't conform to the above URL pattern? The whole logic would break then. I think it's better to use activePerspective from redux here..

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with @rohitkrai03. We shouldn't be checking based on the URL pattern. If it is returning admin on incognito while in dev then it's a bug and we should look to fix it.

Copy link
Contributor

@debsmita1 debsmita1 Aug 18, 2020

Choose a reason for hiding this comment

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

@sahil143 @rohitkrai03 The problem is if you copy a dev-perspective URL and open it in incognito, the activePerspective in the redux is set as admin . Have a look at the below screenshot
Screenshot from 2020-08-18 22-49-32

Copy link
Contributor

@sahil143 sahil143 Aug 19, 2020

Choose a reason for hiding this comment

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

@debsmita1 That happens for any devconsole url in incognito. I think it's a known issue.

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 have updated to use getActivePerspective for convention as well and it seems to work fine given that the whole thing would finally run at a cluster URl

@cshinn
Copy link

cshinn commented Aug 12, 2020

@abhinandan13jan @debsmita1 It seems like the best thing to link to in the admin console would be the grafana-dashboard-k8s-resources-workload board for the relevant namespace/workload. It has the same context as the dev version would and shows the same data as the sidebar
Screen Shot 2020-08-12 at 9 53 27 AM

@abhinandan13jan
Copy link
Contributor Author

abhinandan13jan commented Aug 17, 2020

@abhinandan13jan @debsmita1 It seems like the best thing to link to in the admin console would be the grafana-dashboard-k8s-resources-workload board for the relevant namespace/workload. It has the same context as the dev version would and shows the same data as the sidebar

@cshinn We can redirect to monitoring/dashboards/grafana-dashboard-k8s-resources-workload but the namespace or workload name cannot be sent over the URL. So, it will not have the context cc: @debsmita1

Screencast from 08-17-2020 02_51_43 PM

I've updated to use grafana-dashboard-k8s-resources-workload dashboard

@openshift-ci-robot
Copy link
Contributor

@abhinandan13jan: This pull request references Bugzilla bug 1868013, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.6.0) matches configured target release for branch (4.6.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1868013: Point admin monitoring links to admin

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.

@debsmita1
Copy link
Contributor

cc @invincibleJai @kyoto ^

@@ -132,7 +133,11 @@ const MonitoringOverview: React.FC<MonitoringOverviewProps> = (props) => {
<>
<div className="odc-monitoring-overview__view-monitoring-dashboard">
<Link
to={`/dev-monitoring/ns/${resource?.metadata?.namespace}/?workloadName=${resource?.metadata?.name}&workloadType=${resource?.kind}`}
to={
currentPath.startsWith('/k8s')
Copy link
Contributor

Choose a reason for hiding this comment

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

@abhinandan13jan Why would last active perspective return admin on incognito while you're on dev? Both localStorage and redux store gets initialized as expected on incognito as well otherwise the application wouldn't work.

@@ -132,7 +133,11 @@ const MonitoringOverview: React.FC<MonitoringOverviewProps> = (props) => {
<>
<div className="odc-monitoring-overview__view-monitoring-dashboard">
<Link
to={`/dev-monitoring/ns/${resource?.metadata?.namespace}/?workloadName=${resource?.metadata?.name}&workloadType=${resource?.kind}`}
to={
currentPath.startsWith('/k8s')
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 it's a good idea to check for a specific URL pattern. What if this component is added to some other page later which doesn't conform to the above URL pattern? The whole logic would break then. I think it's better to use activePerspective from redux here..

@abhinandan13jan
Copy link
Contributor Author

@rohitkrai03 @sahil143 @debsmita1 I have updated to use getActivePerspective and it seems to work fine

@abhinandan13jan
Copy link
Contributor Author

/retest

Copy link
Contributor

@rohitkrai03 rohitkrai03 left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci-robot openshift-ci-robot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Aug 20, 2020
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

2 similar comments
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@invincibleJai
Copy link
Member

/hold

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 20, 2020
@invincibleJai
Copy link
Member

invincibleJai commented Aug 20, 2020

in Admin perspective if i go from sidebar to dashboard , it doesn't selects current namespace

@cshinn We can redirect to monitoring/dashboards/grafana-dashboard-k8s-resources-workload but the namespace or workload name cannot be sent over the URL. So, it will not have the context cc: @debsmita1

@kyoto can add here , if there is a way to update proper ns/workloads in this scenario or redirecting to grafana-dashboard-k8s-resources-workload is the way now cc @abhinandan13jan

image

@rohitkrai03
Copy link
Contributor

rohitkrai03 commented Aug 20, 2020

in Admin perspective if i go from sidebar to dashboard , it doesn't selects current namespace

@cshinn We can redirect to monitoring/dashboards/grafana-dashboard-k8s-resources-workload but the namespace or workload name cannot be sent over the URL. So, it will not have the context cc: @debsmita1

@kyoto can add here , if there is a way to update proper ns/workloads in this scenario or redirecting to grafana-dashboard-k8s-resources-workload is the way now cc @abhinandan13jan

image

AFAIK, there's no support for passing namespace or workload context in the grafana dashboard route currently. Even the namespace dropdown selects first item in the dropdown instead of activeNamespace from redux store. This results in user being redirected to wrong namespace context. Not sure what we can do for the scope of this PR.

In 4.5 we are sending user to dev monitoring dashboard which keeps user in correct namespace context. Maybe we should keep doing that till we have support for namespace and workload context in grafana dashboard on admin side. WDYT @kyoto?
cc: @christianvogt

@kyoto
Copy link
Member

kyoto commented Aug 21, 2020

In the admin perspective Dashboards page, the "Namespace" dropdown represents a variable in the dashboard definition (same as "Workload" and "Type"). The page therefore doesn't have any knowledge of what the variable "Namespace" means, so it isn't connected to the active namespace.

Unfortunately, there's currently no way to automatically select a value from the "Namespace" dropdown (or any other variable dropdown).

@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Aug 21, 2020
@abhinandan13jan
Copy link
Contributor Author

/retest

@invincibleJai
Copy link
Member

In the admin perspective Dashboards page, the "Namespace" dropdown represents a variable in the dashboard definition (same as "Workload" and "Type"). The page therefore doesn't have any knowledge of what the variable "Namespace" means, so it isn't connected to the active namespace.

Unfortunately, there's currently no way to automatically select a value from the "Namespace" dropdown (or any other variable dropdown).

Make sense so existing 4.5 behaviour seems better than linking to the admin perspective dashboard for a different namespace cc @cshinn

@invincibleJai
Copy link
Member

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 21, 2020
@invincibleJai
Copy link
Member

/lgtm

Verified the changes

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 21, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abhinandan13jan, invincibleJai, rohitkrai03

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-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@andrewballantyne
Copy link
Contributor

/retest

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit 11fe709 into openshift:master Aug 22, 2020
@openshift-ci-robot
Copy link
Contributor

@abhinandan13jan: All pull requests linked via external trackers have merged: openshift/console#6263. Bugzilla bug 1868013 has been moved to the MODIFIED state.

In response to this:

Bug 1868013: Point admin monitoring links to admin

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.

@spadgett spadgett added this to the v4.6 milestone Aug 26, 2020
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. bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. component/dev-console Related to dev-console kind/bug Categorizes issue or PR as related to a bug. 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