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
Bug 1868013: Point admin monitoring links to admin #6263
Conversation
606387c
to
a613e50
Compare
Thank you for working on this. This works fine, I'm just unsure about the part where you are redirecting the user to |
/retitle Bug 1868013: Point admin monitoring links to admin |
@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
In response to this:
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. |
/kind bug |
@@ -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') |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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..
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
@abhinandan13jan @debsmita1 It seems like the best thing to link to in the admin console would be the |
@cshinn We can redirect to I've updated to use |
a613e50
to
24420e1
Compare
@abhinandan13jan: This pull request references Bugzilla bug 1868013, which is valid. 3 validation(s) were run on this bug
In response to this:
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. |
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') |
There was a problem hiding this comment.
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') |
There was a problem hiding this comment.
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..
24420e1
to
942696a
Compare
@rohitkrai03 @sahil143 @debsmita1 I have updated to use getActivePerspective and it seems to work fine |
/retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/retest Please review the full test history for this PR and help us cut down flakes. |
2 similar comments
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest Please review the full test history for this PR and help us cut down flakes. |
/hold |
in Admin perspective if i go from sidebar to dashboard , it doesn't selects current namespace
@kyoto can add here , if there is a way to update proper ns/workloads in this scenario or redirecting to |
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 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? |
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). |
942696a
to
2d1ab62
Compare
/retest |
2d1ab62
to
cfd1d17
Compare
Make sense so existing 4.5 behaviour seems better than linking to the admin perspective dashboard for a different namespace cc @cshinn |
/hold cancel |
/lgtm Verified the changes |
[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 |
/retest Please review the full test history for this PR and help us cut down flakes. |
/retest |
/retest Please review the full test history for this PR and help us cut down flakes. |
@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:
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. |
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
Test
Fixed
Browser
Chrome