cloudstack icon indicating copy to clipboard operation
cloudstack copied to clipboard

Fix link to removed volumes being shown in info card and list view

Open winterhazel opened this issue 1 year ago • 10 comments

Description

The volume snapshots and the snapshot details page show a link to the snapshotted volume. However, if the volume has been removed, it is not possible to access its page, resulting in a 404 when a user clicks the link.

This PR adds a validation in the UI in order to avoid showing this link when the volume has been removed.

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):

When the volume exists, a link is shown.

Screenshot from 2024-03-26 09-18-39

If the volume has been removed, the link does not get shown.

Screenshot from 2024-03-26 09-18-54

How Has This Been Tested?

  1. I created a volume snapshot and verified that the volume snapshots and the snapshot details page showed a link to the volume;
  2. I removed the volume and verified that the link was not shown anymore.

winterhazel avatar Mar 26 '24 11:03 winterhazel

Codecov Report

Attention: Patch coverage is 21.52918% with 390 lines in your changes missing coverage. Please review.

Project coverage is 15.42%. Comparing base (53faf0f) to head (e558ca6). Report is 18 commits behind head on 4.19.

:exclamation: Current head e558ca6 differs from pull request most recent head 62e405d

Please upload reports for the commit 62e405d to get more accurate results.

Files Patch % Lines
agent/src/main/java/com/cloud/agent/Agent.java 0.00% 62 Missing :warning:
...ommand/admin/network/CreateNetworkOfferingCmd.java 0.00% 50 Missing :warning:
...ck/api/command/admin/vpc/CreateVPCOfferingCmd.java 11.62% 35 Missing and 3 partials :warning:
...nt/resource/consoleproxy/ConsoleProxyResource.java 0.00% 36 Missing :warning:
...in/java/com/cloud/agent/api/storage/OVFHelper.java 10.71% 24 Missing and 1 partial :warning:
...gent/src/main/java/com/cloud/agent/AgentShell.java 9.09% 20 Missing :warning:
api/src/main/java/com/cloud/storage/Storage.java 68.33% 16 Missing and 3 partials :warning:
...pi/src/main/java/com/cloud/agent/api/to/NicTO.java 0.00% 12 Missing :warning:
.../main/java/com/cloud/deploy/DeploymentPlanner.java 7.69% 12 Missing :warning:
...nternallb/ListInternalLoadBalancerElementsCmd.java 0.00% 11 Missing :warning:
... and 49 more
Additional details and impacted files
@@             Coverage Diff              @@
##               4.19    #8833      +/-   ##
============================================
+ Coverage     14.97%   15.42%   +0.45%     
- Complexity    11049    11818     +769     
============================================
  Files          5390     5475      +85     
  Lines        470964   478624    +7660     
  Branches      59210    60820    +1610     
============================================
+ Hits          70528    73834    +3306     
- Misses       392599   396657    +4058     
- Partials       7837     8133     +296     
Flag Coverage Δ
uitests 4.21% <ø> (-0.07%) :arrow_down:
unittests 16.18% <21.52%> (+0.49%) :arrow_up:

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.

codecov[bot] avatar Mar 26 '24 12:03 codecov[bot]

@blueorangutan ui

sureshanaparti avatar Mar 27 '24 09:03 sureshanaparti

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

blueorangutan avatar Mar 27 '24 09:03 blueorangutan

UI build: :heavy_check_mark: Live QA URL: https://qa.cloudstack.cloud/simulator/pr/8833 (QA-JID-309)

blueorangutan avatar Mar 27 '24 09:03 blueorangutan

qa does not seem to be responsive, not tested!

DaanHoogland avatar Mar 29 '24 14:03 DaanHoogland

@winterhazel , I marked this for 4.20 now as it is targeted for main. Do you want this in 4.19?

cc @lucas-a-martins

DaanHoogland avatar Apr 24 '24 06:04 DaanHoogland

Thanks for testing @lucas-a-martins. At first, I think the issue regarding invalid links in the list view should be tackled in another PR, but I'll investigate how it could be implemented to see if it makes sense to unify how the validation is performed with this one.

@winterhazel , I marked this for 4.20 now as it is targeted for main. Do you want this in 4.19?

@DaanHoogland sure, I'll target 4.19.

winterhazel avatar Apr 24 '24 15:04 winterhazel

Hey @lucas-a-martins @DaanHoogland, sorry for the delay.

Looking back at this PR, I think it would be better to implement the link validation in both pages by including the volume's state in the main response and verifying it in the UI, as the approach here (calling another API to obtain a single volume's data) would become unfeasible when we need to validate links for a lot of resources (such as in the volume snapshots page). I suppose this would also be the ideal approach for validating most links to resources.

I will make some changes in this PR to adjust this, and to include the validation in the volume snapshots page as well.

winterhazel avatar May 28 '24 17:05 winterhazel

@lucas-a-martins @DaanHoogland, I changed how the link validation is performed, and included it in the list view as well. Could you guys take another look at this PR?

winterhazel avatar Jun 27 '24 14:06 winterhazel

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

github-actions[bot] avatar Jun 28 '24 11:06 github-actions[bot]

@blueorangutan package

DaanHoogland avatar Jul 23 '24 08:07 DaanHoogland

@DaanHoogland 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 avatar Jul 23 '24 08:07 blueorangutan

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

blueorangutan avatar Jul 23 '24 09:07 blueorangutan

@blueorangutan test

DaanHoogland avatar Jul 23 '24 12:07 DaanHoogland

@DaanHoogland a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

blueorangutan avatar Jul 23 '24 12:07 blueorangutan

[SF] Trillian Build Failed (tid-10948)

blueorangutan avatar Jul 23 '24 12:07 blueorangutan

[SF] Trillian test result (tid-10950) Environment: kvm-alma9 (x2), Advanced Networking with Mgmt server a9 Total time taken: 46197 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr8833-t10950-kvm-alma9.zip Smoke tests completed. 132 look OK, 0 have errors, 0 did not run Only failed and skipped tests results shown below:

Test Result Time (s) Test File

blueorangutan avatar Jul 24 '24 02:07 blueorangutan

Merging based on approvals, CI result and manual tests by @lucas-a-martins

JoaoJandre avatar Jul 24 '24 12:07 JoaoJandre