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

CONSOLE-3323: Switch to admin perspective when user navigates directly to a cluster-scoped route and is in the "All Clusters" perspective #12254

Closed
wants to merge 3 commits into from

Conversation

TheRealJon
Copy link
Member

When manually navigating to a known cluster-scoped route, the console will automatically switch to the admin perspective so that the active cluster context is clear.

@openshift-ci openshift-ci bot added bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. labels Nov 8, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 8, 2022

@TheRealJon: This pull request references Bugzilla bug 2075654, which is invalid:

  • expected the bug to target the "4.13.0" release, but it targets "---" instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

Bug 2075654: Switch to admin perspective when user navigates directly to a cluster-scoped route and is in the "All Clusters" perspective

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-ci openshift-ci bot added component/core Related to console core functionality component/shared Related to console-shared approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Nov 8, 2022
@TheRealJon
Copy link
Member Author

/bugzilla refresh

@openshift-ci openshift-ci bot added bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. and removed bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. labels Nov 8, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 8, 2022

@TheRealJon: This pull request references Bugzilla bug 2075654, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

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

Requesting review from QA contact:
/cc @yapei

In response to this:

/bugzilla refresh

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.

@jhadvig jhadvig changed the title Bug 2075654: Switch to admin perspective when user navigates directly to a cluster-scoped route and is in the "All Clusters" perspective CONSOLE-3323: Switch to admin perspective when user navigates directly to a cluster-scoped route and is in the "All Clusters" perspective Nov 14, 2022
@openshift-ci openshift-ci bot removed bugzilla/severity-medium Referenced Bugzilla bug's severity is medium 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 Nov 14, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 14, 2022

@TheRealJon: No Bugzilla bug is referenced in the title of this pull request.
To reference a bug, add 'Bug XXX:' to the title of this pull request and request another bug refresh with /bugzilla refresh.

In response to this:

CONSOLE-3323: Switch to admin perspective when user navigates directly to a cluster-scoped route and is in the "All Clusters" perspective

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.

@TheRealJon
Copy link
Member Author

/label tide/merge-method-squash

@openshift-ci openshift-ci bot added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Nov 18, 2022
@jhadvig
Copy link
Member

jhadvig commented Nov 29, 2022

Hmm so the frontend test is still failing with the same issue. Wondering if its cause by the fact that we are calling the hook inside a hook, but I doubt that.

@TheRealJon
Copy link
Member Author

Fixed.

@TheRealJon
Copy link
Member Author

QE Approver
/assign @yapei

Docs Approver:
/assign @opayne1

PX Approver:
/assign @RickJWagner

@RickJWagner
Copy link

/label px-approved

@openshift-ci openshift-ci bot added the px-approved Signifies that Product Support has signed off on this PR label Nov 29, 2022
@RickJWagner RickJWagner removed their assignment Nov 29, 2022
@opayne1
Copy link
Contributor

opayne1 commented Nov 29, 2022

/label docs-approved

@openshift-ci openshift-ci bot added the docs-approved Signifies that Docs has signed off on this PR label Nov 29, 2022
@TheRealJon
Copy link
Member Author

/retest

@TheRealJon
Copy link
Member Author

/retest
timed out

@TheRealJon
Copy link
Member Author

/retest
timeout

@jhadvig
Copy link
Member

jhadvig commented Dec 14, 2022

/test e2e-gcp-console

Copy link
Member

@rhamilto rhamilto 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 openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 14, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 14, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rhamilto, TheRealJon

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

@TheRealJon
Copy link
Member Author

/retest
timed out

@TheRealJon
Copy link
Member Author

/retest
known flake

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 21, 2022

@TheRealJon: all tests passed!

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.

'/dashboards',
'/settings',
'/api-explorer',
'/catalog',
Copy link
Contributor

Choose a reason for hiding this comment

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

/catalog route is in dev perspective

Copy link
Contributor

Choose a reason for hiding this comment

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

also do we need list all cluster-scope URL here? it looks like some URLs are missing here, for example if I go to following URLs , I will still stay in ACM perspective

/k8s/cluster/core~v1~Namespace
/k8s/cluster/apiextensions.k8s.io~v1~CustomResourceDefinition
/k8s/cluster/config.openshift.io~v1~Infrastructure/cluster 

Screenshot 2023-01-05 at 3 11 57 PM

@TheRealJon
Copy link
Member Author

/hold

Rethinking how we can solve this issue. I don't think it's safe to assume single/multi cluster context from navigation routes.

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 5, 2023
Copy link
Member

@spadgett spadgett left a comment

Choose a reason for hiding this comment

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

@TheRealJon What is the scenario here? You're in the "All Clusters" perspective and someone sends you a link? Or do you have to manually edit the URL?

cc @KevinFCormier

const clusterRouteMatch = useRouteMatch({ path: CLUSTER_SCOPED_ROUTES });
const isMulticlusterPerspective = activePerspective === 'acm';
const overrideClusterScope = !perspectiveParam && clusterRouteMatch && isMulticlusterPerspective;
const overridePerspective = overrideClusterScope ? 'admin' : perspectiveParam;
Copy link
Member

Choose a reason for hiding this comment

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

Note that the admin perspective can be disabled in the cluster config.

@@ -33,6 +33,17 @@ export const namespacedPrefixes = [
'/status',
];

export const CLUSTER_SCOPED_ROUTES = [
Copy link
Member

Choose a reason for hiding this comment

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

I worry about having a hard-coded list of paths that we need to maintain. It also means we won't be able to support routes contributed by plugins.

@KevinFCormier
Copy link

My thought was to switch the current cluster to local-cluster when using All Clusters, so that ACM links out to console pages will be for the correct cluster. But I suppose if you followed a link to an ACM page, the perspective doesn't change automatically, so my approach would leave that gap.

@TheRealJon
Copy link
Member Author

We've decided against this approach for handling cluster context for now. We may need to revisit, but for now, I will close this PR.

@TheRealJon TheRealJon closed this Feb 1, 2023
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/shared Related to console-shared do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. docs-approved Signifies that Docs has signed off on this PR lgtm Indicates that a PR is ready to be merged. px-approved Signifies that Product Support has signed off on this PR tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants