-
Notifications
You must be signed in to change notification settings - Fork 603
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
Added resource quota warning message in topology and add page #11962
Added resource quota warning message in topology and add page #11962
Conversation
/cc @divyanshiGupta |
/retest |
We should be a little careful about this because often you are at quota for something and it's expected and normal (particularly for object counts). It might not be something you can/want to change. If we always show a warning, it could permanently show up for users of those projects. Minimally I think we need to let users dismiss the alert. This is what we had in 3.x for reference: openshift/origin-web-console#2116 |
</Alert> | ||
) : null} | ||
<AddPageLayout title={t('devconsole~Add')} /> | ||
</> |
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.
@lokanandaprabhu I will suggest that you extract the code from this file and create a separate ResourceQuotaAlert component and use that in Add/Topology pages so that we can avoid duplicating code.
Having a notification would be so much better, unfortunately we still don't have a notification drawer for non-cluster admins 😢 Regarding the alert being dismissable - @spadgett I had a couple of concerns there. If it is dismissable, do we need to remember that per user per session per "quota"? How would they discover that this is indeed still an issue if they return to the project a week later? |
@andrew-ronaldson FYI this what we discussed this morning. Would be great to get your feedback on the format of the inline notification as well! |
9a1f97d
to
d069965
Compare
@lokanandaprabhu code looks good to me. Once we have a +1 for this PR from PM/UX side will add lgtm. cc: @serenamarie125 |
As discussed in our ODC call, would like to see the following updates:
|
If we make them dismissable, we should remember not just the ResourceQuota, but the specific resource in that quota which was at limit. Related to this, it would be good to show specifically what resource is at quota in the alert (at least if there's only one?). I don't know how much value making it per session brings if it comes back every time I login :/
That's the thing: it might not actually be a problem. Maybe this should be an info alert or displayed some other way that is still visible, but a little less strong? |
@spadgett curious why you're saying it shouldn't be a warning. All of the RQ information which is already surfaced in the Project Dashboard is warning level, so we were surfacing it at a higher level.
|
I guess I see a warning as "you should probably fix this." In the case of quota, if I'm allowed 1 deployment and I'm using that 1 deployment, is it really a problem? Is it something I really need to fix? Or is it more of an "FYI, this is OK, but you won't be able to create more." On the other hand if I'm importing from a git repo and I can't create any more deployments, then we might warn the user before they get too far ("what you're about to try won't work...").
Yeah. "You have reached your pods quota (2/2) for this namespace" or something like that with a link to the quota resource. |
@serenamarie125 @spadgett @jerolimov @invincibleJai @divyanshiGupta , Hi team, I updated the PR to add label instead of Alert. PTAL. Thanks. |
I like this approach so much better! I do have one more question ... I would have thought we'd be using medium and large spacers, but it looks like we are using Also, the spacing to the right of the GOLD label on the Overview page looks larger than on Topology. Would you mind verifying that they are the same on each page? Thanks! |
Hi @serenamarie125 , For the Add page, we have decided to use (existing gap + 8px), the existing gap is 24px, so I added 32 px which is For Topology page, we have decided to go for 24px. |
/retest |
@lokanandaprabhu Please run yarn i18n and push the changes. |
f182261
to
6bbe856
Compare
frontend/packages/topology/src/components/utils/checkResourceQuota.tsx
Outdated
Show resolved
Hide resolved
import { getUsedPercentage } from '@console/app/src/components/resource-quota/utils'; | ||
import { ResourceQuotaModel } from '../../../../../public/models'; | ||
|
||
export const checkQuotaLimit = (resourecQuota: any) => { |
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.
can we have type here? and as it's a list so can have it as plural resourecQuotas
and will be good to add unit test for checkQuotaLimit
.
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.
Here resourecQuotas
will be either ClusterResourceQuotaKind
or ResourceQuotaKind
, I tried to add union of these two types but getting below error
Each member of the union type '(<U>(callbackfn: (value: ClusterResourceQuotaKindProps, index: number, array: ClusterResourceQuotaKindProps[]) => U, thisArg?: any) => U[]) | (<U>(callbackfn: (value: ResourceQuotaKindProps, index: number, array: ResourceQuotaKindProps[]) => U, thisArg?: any) => U[])' has signatures, but none of those signatures are compatible with each other.
When I check about the error, array.map does not correctly handles the union types . https://stackoverflow.com/questions/49510832/how-to-map-over-union-array-type
I tried the solution provided but error still remains.
Any feedback on this will be helpful.
frontend/packages/topology/src/components/utils/checkResourceQuota.tsx
Outdated
Show resolved
Hide resolved
frontend/packages/topology/src/components/export-app/ExportApplication.tsx
Outdated
Show resolved
Hide resolved
frontend/packages/topology/src/components/utils/checkResourceQuota.tsx
Outdated
Show resolved
Hide resolved
6bbe856
to
df1f019
Compare
/retest |
@topology @add-flow @ODC6771 | ||
Feature: Update user in topology and add flow if Quotas has been reached in a namespace | ||
If any resource reached resource quota limit, a warning alert will be displayed for the user in Add page and Topology page. |
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.
Feature for topology and Add page needs to be separated in different packages
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.
Separated e2e tests.
/retest |
513f3f8
to
621c136
Compare
frontend/packages/dev-console/integration-tests/features/addFlow/resource-quota-warning.feature
Outdated
Show resolved
Hide resolved
frontend/packages/dev-console/integration-tests/features/addFlow/resource-quota-warning.feature
Outdated
Show resolved
Hide resolved
frontend/packages/dev-console/integration-tests/features/addFlow/resource-quota-warning.feature
Outdated
Show resolved
Hide resolved
frontend/packages/dev-console/integration-tests/features/addFlow/resource-quota-warning.feature
Outdated
Show resolved
Hide resolved
621c136
to
438aa2d
Compare
...ges/dev-console/integration-tests/support/step-definitions/addFlow/resource-quota-warning.ts
Outdated
Show resolved
Hide resolved
438aa2d
to
8669ead
Compare
8669ead
to
32374fe
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: divyanshiGupta, invincibleJai, lokanandaprabhu, sanketpathak, serenamarie125 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 |
/label px-approved |
@lokanandaprabhu: 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. |
JIRA:
https://issues.redhat.com/browse/ODC-6771
Solution Description:
Screen shots / Gifs for design review:
new-RQ-warning-alert.mov
---CHROME screenshots---TOPOLOGY PAGE---
----FIREFOX screenshots----TOPOLOGY PAGE---
---CHROME screenshots---ADD PAGE---
----FIREFOX screenshots----ADD PAGE---
Steps to create Applied cluster resource quota:
$ oc new-project developer-test
$ oc create clusterquota for-user --project-annotation-selector openshift.io/requester=developer --hard pods=10 --hard secrets=20
Browser conformance:
/kind feature