cloudstack
cloudstack copied to clipboard
Fix 404 when moving a VM to out of a project
Description
In a project's view, after assigning an instance belonging to the project to a user account through the instance's page, the UI tries to refresh the information about the instance. However, as the project does not have permission to view instances from other accounts, the user is redirected to a 404.
This PR adds a check in the UI to avoid showing this 404.
Types of changes
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] New feature (non-breaking change which adds functionality)
- [X] 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
Bug Severity
- [ ] BLOCKER
- [ ] Critical
- [ ] Major
- [X] Minor
- [ ] Trivial
Screenshots (if appropriate):
How Has This Been Tested?
In the root admin account, I made the following tests:
Number | Test | Previous result | New result | Expected result? (Y/N) |
---|---|---|---|---|
1 | In a project's view, I assigned an instance belonging to the project to a user account | UI gets redirected to a 404 | UI gets redirected to the instance listing | Y |
2 | In a project's view, I tried to assign an instance belonging to the project to the project itself | An error is shown, as the previous and the new owner are the same. The UI stays in the same page | An error is shown, as the previous and the new owner are the same. The UI stays in the same page | Y |
3 | In a project's view, I assigned an instance belonging to the project to another project in the same domain | UI gets redirected to a 404 | UI gets redirected to the instance listing | Y |
4 | In a project's view, I assigned an instance belonging to the project to another project in a subdomain | UI gets redirected to a 404 | UI gets redirected to the instance listing | Y |
5 | In the default view, I assigned an instance belonging to account A to account B | The UI refreshes the information about the instance | The UI refreshes the information about the instance | Y |
Codecov Report
Attention: 276 lines
in your changes are missing coverage. Please review.
Comparison is base (
a0e592e
) 30.94% compared to head (4f97039
) 30.76%.
:exclamation: Current head 4f97039 differs from pull request most recent head cad306f. Consider uploading reports for the commit cad306f to get more accurate results
Additional details and impacted files
@@ Coverage Diff @@
## 4.19 #8650 +/- ##
============================================
- Coverage 30.94% 30.76% -0.19%
+ Complexity 34234 33089 -1145
============================================
Files 5347 5353 +6
Lines 375585 374585 -1000
Branches 54632 54633 +1
============================================
- Hits 116234 115246 -988
- Misses 244047 244068 +21
+ Partials 15304 15271 -33
Flag | Coverage Δ | |
---|---|---|
simulator-marvin-tests | 24.62% <14.82%> (-0.22%) |
:arrow_down: |
uitests | 4.38% <ø> (-0.02%) |
:arrow_down: |
unit-tests | 16.43% <16.86%> (-0.13%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@blueorangutan ui
@DaanHoogland a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.
UI build: :heavy_check_mark: Live QA URL: https://qa.cloudstack.cloud/simulator/pr/8650 (QA-JID-280)
@winterhazel, as this PR fixes the 404 error, it's Types of changes
should be defined as Bug fix
.
@winterhazel can you change base branch to 4.19 as it's a fix.
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.
@winterhazel , does this not occur on 4.18? or should it go into the 4.18 branch?
@DaanHoogland this problem also occurs on 4.18.
I'm not sure if this PR can still go to 4.18 though, as @JoaoJandre recently froze the branch and will move most pending items to the next milestone. Will there be another milestone in 4.18 this PR can go to?
@DaanHoogland this problem also occurs on 4.18.
I'm not sure if this PR can still go to 4.18 though, as @JoaoJandre recently froze the branch and will move most pending items to the next milestone. Will there be another milestone in 4.18 this PR can go to?
It does not matter, we can put it on the branch so people building their own have it, and we will still merge it forward to 4.19 whether there will be a 4.18.3 or not.
that said, just say no and we can merge it now
Alright, I'll keep this for 4.19.