Skip to content

Conversation

winterhazel
Copy link
Member

@winterhazel winterhazel commented Mar 26, 2024

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)
  • 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
  • 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.

Copy link

codecov bot commented Mar 26, 2024

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.

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 ⚠️
...ommand/admin/network/CreateNetworkOfferingCmd.java 0.00% 50 Missing ⚠️
...ck/api/command/admin/vpc/CreateVPCOfferingCmd.java 11.62% 35 Missing and 3 partials ⚠️
...nt/resource/consoleproxy/ConsoleProxyResource.java 0.00% 36 Missing ⚠️
...in/java/com/cloud/agent/api/storage/OVFHelper.java 10.71% 24 Missing and 1 partial ⚠️
...gent/src/main/java/com/cloud/agent/AgentShell.java 9.09% 20 Missing ⚠️
api/src/main/java/com/cloud/storage/Storage.java 68.33% 16 Missing and 3 partials ⚠️
...pi/src/main/java/com/cloud/agent/api/to/NicTO.java 0.00% 12 Missing ⚠️
.../main/java/com/cloud/deploy/DeploymentPlanner.java 7.69% 12 Missing ⚠️
...nternallb/ListInternalLoadBalancerElementsCmd.java 0.00% 11 Missing ⚠️
... 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%) ⬇️
unittests 16.18% <21.52%> (+0.49%) ⬆️

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.

@sureshanaparti
Copy link
Contributor

@blueorangutan ui

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

Copy link
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

@DaanHoogland
Copy link
Contributor

qa does not seem to be responsive, not tested!

Copy link
Collaborator

@lucas-a-martins lucas-a-martins left a comment

Choose a reason for hiding this comment

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

LGTM

I manually tested by creating a volume snapshot and then deleting the volume.

Before the proposed changes
  • The snapshot details page shows a link to the volume even after the volume has been removed.

Before-changes

  • Clicking the link redirected me to a 404 page.

404-Before

After the proposed changes
  • The snapshot details page does not show a link to the removed volume.

After-changes

I'm not sure if this is within the scope of this PR, but on the Volume Snapshots page, where it displays the list of volume snapshots, a link to the removed volume is still being shown and redirects to a 404 page.

volume-snapshot-list

@DaanHoogland
Copy link
Contributor

DaanHoogland commented Apr 24, 2024

@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

@winterhazel
Copy link
Member Author

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
Copy link
Member Author

winterhazel commented May 28, 2024

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
Copy link
Member Author

@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?

Copy link

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

@winterhazel winterhazel changed the title Fix link to removed volumes being shown in info card Fix link to removed volumes being shown in info card and list view Jun 28, 2024
@rohityadavcloud rohityadavcloud modified the milestones: 4.20.0.0, 4.19.2.0 Jun 29, 2024
Copy link
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

Copy link
Collaborator

@lucas-a-martins lucas-a-martins left a comment

Choose a reason for hiding this comment

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

LGTM

I tested the current iteration of this PR and everything is working as intended, including the changes to the volume snapshot list view.

Volume snapshot view
  • Before deleting the volume:

list-view-before-delete

  • After deleting the volume:

list-view-after-delete

Snapshot details view
  • Before deleting the volume:

snapshot-details-before-delete

  • After deleting the volume:

snapshot-details-after-delete

@DaanHoogland
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@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
Copy link

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

@DaanHoogland
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

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

@blueorangutan
Copy link

[SF] Trillian Build Failed (tid-10948)

@blueorangutan
Copy link

[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

@JoaoJandre
Copy link
Contributor

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

@JoaoJandre JoaoJandre merged commit 49cd5ba into apache:4.19 Jul 24, 2024
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Jul 31, 2024
…pache#8833)

* Framework for validating links in the front-end

* Rename valid links map in the list view
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.

7 participants