Skip to content

CNV-62016: add description to ResourceQuota page title#16086

Open
adamviktora wants to merge 1 commit intoopenshift:mainfrom
adamviktora:aaq
Open

CNV-62016: add description to ResourceQuota page title#16086
adamviktora wants to merge 1 commit intoopenshift:mainfrom
adamviktora:aaq

Conversation

@adamviktora
Copy link
Contributor

@adamviktora adamviktora commented Mar 2, 2026

This PR adds description to ResourceQuota page title

  • part of the description is rendered based on the presence of kubevirt-plugin

Design document link for the AAQ feature

Demo

No kubevirt-plugin:
Screenshot 2026-03-02 at 11 32 29

With kubevirt-plugin:

Screen.Recording.2026-03-02.at.11.31.06.mp4

Summary by CodeRabbit

Release Notes

  • New Features
    • Added contextual help text to the Resource Quotas page providing guidance on managing project capacity.
    • Includes conditional link to Application-Aware Quota settings when OpenShift Virtualization is detected.

- part of the description is rendered based on the presence of kubevirt-plugin
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Mar 2, 2026
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Mar 2, 2026

@adamviktora: This pull request references CNV-62016 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Design document link for the AAQ feature


This PR adds description to ResourceQuota page title

  • part of the description is rendered based on the presence of kubevirt-plugin

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot requested review from jhadvig and spadgett March 2, 2026 10:41
@openshift-ci openshift-ci bot added the component/core Related to console core functionality label Mar 2, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 2, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: adamviktora
Once this PR has been reviewed and has the lgtm label, please assign rawagner for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details 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-ci openshift-ci bot added the kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated label Mar 2, 2026
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Mar 2, 2026

@adamviktora: This pull request references CNV-62016 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Design document link for the AAQ feature


This PR adds description to ResourceQuota page title

  • part of the description is rendered based on the presence of kubevirt-plugin

Demo

No kubevirt-plugin:
Screenshot 2026-03-02 at 11 32 29

With kubevirt-plugin:

Screen.Recording.2026-03-02.at.11.31.06.mp4

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Mar 2, 2026

@adamviktora: This pull request references CNV-62016 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Design document link for the AAQ feature


This PR adds description to ResourceQuota page title

  • part of the description is rendered based on the presence of kubevirt-plugin

Demo

No kubevirt-plugin:
Screenshot 2026-03-02 at 11 32 29

With kubevirt-plugin:

Screen.Recording.2026-03-02.at.11.31.06.mp4

Summary by CodeRabbit

Release Notes

  • New Features
  • Added contextual help text to the Resource Quotas page providing guidance on managing project capacity.
  • Includes conditional link to Application-Aware Quota settings when OpenShift Virtualization is detected.

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Mar 2, 2026

@adamviktora: This pull request references CNV-62016 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

This PR adds description to ResourceQuota page title

  • part of the description is rendered based on the presence of kubevirt-plugin

Design document link for the AAQ feature

Demo

No kubevirt-plugin:
Screenshot 2026-03-02 at 11 32 29

With kubevirt-plugin:

Screen.Recording.2026-03-02.at.11.31.06.mp4

Summary by CodeRabbit

Release Notes

  • New Features
  • Added contextual help text to the Resource Quotas page providing guidance on managing project capacity.
  • Includes conditional link to Application-Aware Quota settings when OpenShift Virtualization is detected.

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 openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 2, 2026

📝 Walkthrough

Walkthrough

This change augments the ResourceQuotas page component with contextual help text by introducing feature-flag-dependent rendering logic. The modifications add imports for translation (Trans) and feature flag detection (useFlag), establish checks for KubeVirt plugin activation and quotas feature availability, and conditionally render guidance text with a dynamic link to either quotas or virtualization settings. Supporting translation keys are added to the English locale file. No public API signatures, exported types, or existing translation keys are modified. Changes total +35/-2 in the component and +2/-0 in the translation file.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding description/helpText to the ResourceQuota page title with conditional rendering based on KubeVirt context.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@frontend/public/components/resource-quota.jsx`:
- Around line 700-704: The code reads window.SERVER_FLAGS.consolePlugins without
ensuring window.SERVER_FLAGS exists, causing render-time crashes; update the
isKubevirtPluginActive computation (referencing useFlag, kubevirtFeature, and
isKubevirtPluginActive) to first guard that window.SERVER_FLAGS is defined and
that consolePlugins is an array (e.g. check window.SERVER_FLAGS &&
Array.isArray(window.SERVER_FLAGS.consolePlugins) or use optional chaining)
before calling .includes('kubevirt-plugin') and keep the kubevirtFeature check
intact.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 857c251 and a92297b.

📒 Files selected for processing (2)
  • frontend/public/components/resource-quota.jsx
  • frontend/public/locales/en/public.json

Comment on lines +700 to +704
const kubevirtFeature = useFlag('KUBEVIRT_DYNAMIC');
const isKubevirtPluginActive =
Array.isArray(window.SERVER_FLAGS.consolePlugins) &&
window.SERVER_FLAGS.consolePlugins.includes('kubevirt-plugin') &&
kubevirtFeature;
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Guard global flag access to prevent pre-render crashes.

Line 702 dereferences window.SERVER_FLAGS.consolePlugins before validating window.SERVER_FLAGS. If that global is missing, this page can throw during render.

💡 Proposed fix
     const kubevirtFeature = useFlag('KUBEVIRT_DYNAMIC');
-    const isKubevirtPluginActive =
-      Array.isArray(window.SERVER_FLAGS.consolePlugins) &&
-      window.SERVER_FLAGS.consolePlugins.includes('kubevirt-plugin') &&
+    const consolePlugins = window.SERVER_FLAGS?.consolePlugins;
+    const isKubevirtPluginActive =
+      Array.isArray(consolePlugins) &&
+      consolePlugins.includes('kubevirt-plugin') &&
       kubevirtFeature;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/public/components/resource-quota.jsx` around lines 700 - 704, The
code reads window.SERVER_FLAGS.consolePlugins without ensuring
window.SERVER_FLAGS exists, causing render-time crashes; update the
isKubevirtPluginActive computation (referencing useFlag, kubevirtFeature, and
isKubevirtPluginActive) to first guard that window.SERVER_FLAGS is defined and
that consolePlugins is an array (e.g. check window.SERVER_FLAGS &&
Array.isArray(window.SERVER_FLAGS.consolePlugins) or use optional chaining)
before calling .includes('kubevirt-plugin') and keep the kubevirtFeature check
intact.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 2, 2026

@adamviktora: all tests passed!

Full PR test history. Your PR dashboard.

Details

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-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/core Related to console core functionality jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants