Skip to content

ui: prevent scheduling readyforshutdown job when api inaccessible#8448

Merged
shwstppr merged 1 commit intoapache:mainfrom
shapeblue:fix-readyforshutdownjob-nonadmin
Jan 8, 2024
Merged

ui: prevent scheduling readyforshutdown job when api inaccessible#8448
shwstppr merged 1 commit intoapache:mainfrom
shapeblue:fix-readyforshutdownjob-nonadmin

Conversation

@shwstppr
Copy link
Copy Markdown
Contributor

@shwstppr shwstppr commented Jan 5, 2024

Description

Non-admin accounts may not have access to the readyForShutdown API therefore UI should not schedule the job.

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

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

Without fix errors can be seen for the readyForShutdown API call when logged in as normal account,
Screenshot from 2024-01-05 11-57-55

How Has This Been Tested?

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

Non-admin account may not have access to the readyForShutdown API therefore UI should not schedule the job.

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@shwstppr shwstppr added this to the 4.19.0.0 milestone Jan 5, 2024
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 5, 2024

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (9d4f071) 30.80% compared to head (4acd066) 30.80%.
Report is 4 commits behind head on main.

Files Patch % Lines
ui/src/components/page/GlobalLayout.vue 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8448      +/-   ##
============================================
- Coverage     30.80%   30.80%   -0.01%     
+ Complexity    33981    33976       -5     
============================================
  Files          5341     5341              
  Lines        374864   374870       +6     
  Branches      54518    54521       +3     
============================================
- Hits         115485   115475      -10     
- Misses       244114   244132      +18     
+ Partials      15265    15263       -2     
Flag Coverage Δ
simulator-marvin-tests 24.72% <ø> (-0.01%) ⬇️
uitests 4.39% <0.00%> (ø)
unit-tests 16.46% <ø> (+<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.

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 (good cleanup!)

@shwstppr
Copy link
Copy Markdown
Contributor Author

shwstppr commented Jan 5, 2024

@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/8448 (QA-JID-254)

Copy link
Copy Markdown
Member

@harikrishna-patnala harikrishna-patnala left a comment

Choose a reason for hiding this comment

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

@shwstppr agree for the issue and fix but I don't see this getting called for admin account also, anything we are missing here ?

image

I've verified on other server and there I can see that at regular intervals but not in above case

image

@shwstppr
Copy link
Copy Markdown
Contributor Author

shwstppr commented Jan 8, 2024

@harikrishna-patnala did you try on qa server?
QA server (its management server) is on 4.18 and readyForShutDown feature is in main/4.19. Probably that's why it is not showing. Otherwise, I'll check

@harikrishna-patnala
Copy link
Copy Markdown
Member

@harikrishna-patnala did you try on qa server? QA server (its management server) is on 4.18 and readyForShutDown feature is in main/4.19. Probably that's why it is not showing. Otherwise, I'll check

I've tried on the env built on top this PR @shwstppr https://qa.cloudstack.cloud/simulator/pr/8448

@shwstppr
Copy link
Copy Markdown
Contributor Author

shwstppr commented Jan 8, 2024

@harikrishna-patnala let me build an env

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@shwstppr 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]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 8227

Copy link
Copy Markdown
Contributor

@Pearl1594 Pearl1594 left a comment

Choose a reason for hiding this comment

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

LGTM

@shwstppr shwstppr merged commit 5c32a0e into apache:main Jan 8, 2024
@DaanHoogland DaanHoogland deleted the fix-readyforshutdownjob-nonadmin branch January 8, 2024 15:03
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Jan 9, 2024
…ache#8448)

Non-admin account may not have access to the readyForShutdown API therefore UI should not schedule the job.

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
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.

5 participants