Skip to content

Notify users when upgrades are available or restart is required for network or VPC#7610

Merged
DaanHoogland merged 11 commits intoapache:mainfrom
shapeblue:notify-user-on-upgrade
Sep 4, 2024
Merged

Notify users when upgrades are available or restart is required for network or VPC#7610
DaanHoogland merged 11 commits intoapache:mainfrom
shapeblue:notify-user-on-upgrade

Conversation

@vishesh92
Copy link
Copy Markdown
Member

@vishesh92 vishesh92 commented Jun 9, 2023

Description

This PR adds a feature in UI to notify when:

  • a new version of CloudStack is available (only for admins)
  • Custom alert message set in config.json

On login, if there are any networks or VPCs which need restart, insert a message in the notification panel.

This PR also adds a small UI improvement in the UI to show which network/UI requires restart and filtering networks/VPCs which require restart.

P.S. - As of now, after upgrading ACS restart required is not set to true for network or VPC even if the router needs an upgrade.

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)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

Custom alert message (configured in config.json)

This is useful if the operator wants to display a custom message to the users. The operator needs to set the message by setting the value of alertMessage in the config.json. Type of message can be configured by alertMessageType in config.json. Possible values are success, info, warning and error.

Details

image

New release available for cloudstack

Details

image

Restart required notification

Details

image

Show in UI that a restart is required

Details

image

Add filter on restart required

Details

image

How Has This Been Tested?

@codecov
Copy link
Copy Markdown

codecov bot commented Jun 9, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 15.57%. Comparing base (a5f5560) to head (29410de).
Report is 13 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##               main    #7610     +/-   ##
===========================================
  Coverage     15.57%   15.57%             
- Complexity    12047    12048      +1     
===========================================
  Files          5505     5505             
  Lines        482621   482680     +59     
  Branches      61174    60013   -1161     
===========================================
+ Hits          75176    75188     +12     
- Misses       399141   399187     +46     
- Partials       8304     8305      +1     
Flag Coverage Δ
uitests 4.17% <ø> (+<0.01%) ⬆️
unittests 16.35% <ø> (+<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.

@vishesh92
Copy link
Copy Markdown
Member Author

Replaced notification with an alert component.
image

@yadvr
Copy link
Copy Markdown
Member

yadvr commented Jun 15, 2023

@vishesh92 I suppose this a screenshot for admin; a user I would prefer a single alert (too many makes the UI look poor). Click that could open a form with more details. Also, can we merge notification for both guest networks and VPCs? (for the end user these are just networks.

Alternatively; you can display as part of the dashboard (perhaps not top of the UI) - let's discuss. Let me try if the demo env can be used to test changes for further feedback.

@blueorangutan ui

@blueorangutan
Copy link
Copy Markdown

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

@vishesh92
Copy link
Copy Markdown
Member Author

@rohityadavcloud I manually changed the value of restartrequired in database to true to test this. Version check should work with 4.19-SNAPSHOT.

@blueorangutan
Copy link
Copy Markdown

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

@DaanHoogland DaanHoogland added this to the 4.19.0.0 milestone Jun 22, 2023
Comment thread ui/public/locales/en.json Outdated
Comment thread ui/src/store/modules/user.js Outdated
Comment thread ui/public/locales/en.json Outdated
Copy link
Copy Markdown
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

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

clgtm

@github-actions
Copy link
Copy Markdown

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

Copy link
Copy Markdown
Contributor

@shwstppr shwstppr left a comment

Choose a reason for hiding this comment

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

Looks okay largely but existing comments needs to be addressed

Comment thread ui/src/components/page/GlobalLayout.vue Outdated
@shwstppr
Copy link
Copy Markdown
Contributor

@vishesh92 can you please look into merge conflicts and outstanding comments? SHould this be considered for 4.19?

@vishesh92
Copy link
Copy Markdown
Member Author

@shwstppr Have some changes that needs to be done. Leaving this PR for 4.19.1 or 4.20. I will update the milestone.

@vishesh92 vishesh92 modified the milestones: 4.19.0.0, 4.19.1.0 Oct 10, 2023
@sureshanaparti
Copy link
Copy Markdown
Contributor

@vishesh92 Is this PR targeted for 4.19.1? If so, please rebase and update target branch.

@sureshanaparti
Copy link
Copy Markdown
Contributor

@vishesh92 Please resolve the conflicts, & check/address the comments. Thanks.

@sureshanaparti sureshanaparti modified the milestones: 4.19.1.0, 4.19.2 Jun 24, 2024
@vishesh92 vishesh92 force-pushed the notify-user-on-upgrade branch from 87ce972 to 932bd69 Compare July 23, 2024 20:42
@vishesh92 vishesh92 removed this from the 4.19.2.0 milestone Jul 24, 2024
@yadvr yadvr added this to the 4.20.0.0 milestone Jul 31, 2024
@apache apache deleted a comment from blueorangutan Aug 30, 2024
@apache apache deleted a comment from blueorangutan Aug 30, 2024
@blueorangutan
Copy link
Copy Markdown

@vishesh92 a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 10883

@vishesh92 vishesh92 changed the title UI: Notify users when upgrades are available or restart is required UI: Notify users when upgrades are available or restart is required for network or VPC Sep 2, 2024
@vishesh92 vishesh92 force-pushed the notify-user-on-upgrade branch from 479f9c4 to 8854016 Compare September 2, 2024 07:34
@vishesh92
Copy link
Copy Markdown
Member Author

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@vishesh92 a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@vishesh92 vishesh92 changed the title UI: Notify users when upgrades are available or restart is required for network or VPC Notify users when upgrades are available or restart is required for network or VPC Sep 2, 2024
@blueorangutan
Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 10903

@vishesh92 vishesh92 force-pushed the notify-user-on-upgrade branch from 8854016 to 27046cb Compare September 2, 2024 11:29
@vishesh92
Copy link
Copy Markdown
Member Author

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@vishesh92 a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 10909

@vishesh92
Copy link
Copy Markdown
Member Author

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@vishesh92 a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@vishesh92 vishesh92 requested a review from shwstppr September 3, 2024 06:07
@blueorangutan
Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 10922

Copy link
Copy Markdown
Contributor

@shwstppr shwstppr left a comment

Choose a reason for hiding this comment

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

Code looks good

Comment on lines +352 to +379

api('listNetworks', { restartrequired: true, forvpc: false }).then(response => {
if (response.listnetworksresponse.count > 0) {
store.dispatch('AddHeaderNotice', {
key: 'NETWORK_RESTART_REQUIRED',
title: i18n.global.t('label.network.restart.required'),
description: i18n.global.t('message.network.restart.required'),
path: '/guestnetwork/',
query: { restartrequired: true, forvpc: false },
status: 'done',
timestamp: new Date()
})
}
}).catch(ignored => {})

api('listVPCs', { restartrequired: true }).then(response => {
if (response.listvpcsresponse.count > 0) {
store.dispatch('AddHeaderNotice', {
key: 'VPC_RESTART_REQUIRED',
title: i18n.global.t('label.vpc.restart.required'),
description: i18n.global.t('message.vpc.restart.required'),
path: '/vpc/',
query: { restartrequired: true },
status: 'done',
timestamp: new Date()
})
}
}).catch(ignored => {})
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@vishesh92 are these used? We are showing a header notice and then also a warn label for individual network/vpc?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes. This adds a notification in notifications drop down. Which results in something like below
image

And the warn label is shown on network and vpc page if the resource needs a restart.

@DaanHoogland
Copy link
Copy Markdown
Contributor

@blueorangutan ui

@blueorangutan
Copy link
Copy Markdown

@DaanHoogland 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/7610 (QA-JID-438)

Copy link
Copy Markdown
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

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

lgtm, tested in qa and a lab env by manipulating the (meta) data storages

@DaanHoogland DaanHoogland marked this pull request as ready for review September 4, 2024 07:22
@DaanHoogland DaanHoogland merged commit f9451fc into apache:main Sep 4, 2024
@DaanHoogland DaanHoogland deleted the notify-user-on-upgrade branch September 4, 2024 07:24
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Sep 6, 2024
…etwork or VPC (apache#7610)

Co-authored-by: Harikrishna <harikrishna.patnala@gmail.com>
Co-authored-by: dahn <daan.hoogland@gmail.com>
@NuxRo
Copy link
Copy Markdown
Contributor

NuxRo commented Oct 3, 2025

Good feature, but anything that makes CloudStack rely on external resources should be disable-able.

Some/Many corporate environments are run in closed down intranets where this is causing UI errors and generating reports from users. I know of at least 2 such situations.

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.

9 participants