Skip to content

ui: refactor advisories enabled usage and more#12676

Open
shwstppr wants to merge 5 commits intoapache:mainfrom
shwstppr:ui-adv-improv
Open

ui: refactor advisories enabled usage and more#12676
shwstppr wants to merge 5 commits intoapache:mainfrom
shwstppr:ui-adv-improv

Conversation

@shwstppr
Copy link
Copy Markdown
Contributor

@shwstppr shwstppr commented Feb 21, 2026

Description

Considers advisoriesDisabled as false if no value is found in the config or if set to false.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

Considers advisoriesDisabled as false if no value is found in the config
or if set to false.

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 18.01%. Comparing base (c361409) to head (6ca2263).
⚠️ Report is 11 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##               main   #12676    +/-   ##
==========================================
  Coverage     18.00%   18.01%            
- Complexity    16466    16473     +7     
==========================================
  Files          5977     5978     +1     
  Lines        537777   537889   +112     
  Branches      66037    66047    +10     
==========================================
+ Hits          96844    96887    +43     
- Misses       430011   430079    +68     
- Partials      10922    10923     +1     
Flag Coverage Δ
uitests 3.52% <ø> (-0.01%) ⬇️
unittests 19.17% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@sudo87 sudo87 left a comment

Choose a reason for hiding this comment

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

clgtm

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@shwstppr shwstppr changed the title ui: refactor advisories enabled usage ui: refactor advisories enabled usage and more Feb 21, 2026
@shwstppr
Copy link
Copy Markdown
Contributor Author

@blueorangutan ui

@blueorangutan
Copy link
Copy Markdown

@shwstppr a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors advisory system usage in the UI by introducing a centralized hasNoItems utility function and adding new advisories for VNF appliances and instances. The PR aims to improve code maintainability by reducing duplication and providing a consistent approach to checking resource availability for advisory conditions.

Changes:

  • Added hasNoItems utility function to centralize API-based advisory condition checking
  • Refactored existing Kubernetes cluster advisories to use the new utility function
  • Added new advisories for instance and VNF appliance deployment prerequisites (templates, ISOs, compute offerings, networks)
  • Updated router configuration to handle advisoriesDisabled config with proper null/undefined handling
  • Added new localization messages for the new advisories
  • Added advisoriesDisabled config option to config.json

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
ui/src/utils/advisory/index.js New utility file with hasNoItems helper function for checking API resource availability
ui/src/config/section/network.js Added advisories for VNF appliance deployment (template and compute offering checks)
ui/src/config/section/compute.js Added advisories for instance deployment (image, compute offering, network checks) and refactored CKS advisories
ui/src/config/router.js Improved handling of advisoriesDisabled config with nullish coalescing operator
ui/public/locales/en.json Added localization messages for new advisory warnings
ui/public/config.json Added advisoriesDisabled: false configuration option

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

return a
}
return items.length === 0
} catch (error) {
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

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

The error handling silently returns false when an API call fails, which could hide legitimate errors and cause advisories not to appear when they should. Consider logging the error or providing more specific error handling, especially since API failures could indicate permission issues or connectivity problems that users should be aware of.

Suggested change
} catch (error) {
} catch (error) {
console.error(`Failed to fetch items for advisory check via API ${apiName}`, error)

Copilot uses AI. Check for mistakes.
@blueorangutan
Copy link
Copy Markdown

UI build: ✔️
Live QA URL: https://qa.cloudstack.cloud/simulator/pr/12676 (QA-JID-879)

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 4, 2026

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@shwstppr
Copy link
Copy Markdown
Contributor Author

@blueorangutan ui

@blueorangutan
Copy link
Copy Markdown

@shwstppr a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

UI build: ✔️
Live QA URL: https://qa.cloudstack.cloud/simulator/pr/12676 (QA-JID-907)

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants