Skip to content

api: fix inverted value comparison in ImageStoreDetailResponse.equals - #14023

Merged
sureshanaparti merged 1 commit into
apache:4.20from
nagaboinaramgopal:fix/imagestoredetail-equals
Sep 10, 2026
Merged

sureshanaparti merged 1 commit into
apache:4.20from
nagaboinaramgopal:fix/imagestoredetail-equals

Conversation

@nagaboinaramgopal

Copy link
Copy Markdown
Contributor

Description

ImageStoreDetailResponse.equals() had the value comparison inverted - it
returned false when the two responses had the same value and true when
the values differed:

else if (this.getValue().equals(other.getValue()))
    return false;

So two identical details were treated as unequal, and two details differing only
by value were treated as equal — which corrupts any Set/Map/dedup keyed on
ImageStoreDetailResponse. It also threw an NPE when the value was null.

Fixed by comparing with !Objects.equals(getValue(), other.getValue()), which
restores the correct result and is null-safe.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Feature/Enhancement Scale or Bug Severity

Bug Severity

  • Minor

How Has This Been Tested?

Added unit tests covering equal name+value, differing value, and differing name.
Also built the standard packages and deployed on a KVM advanced zone.

@DaanHoogland DaanHoogland left a comment

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.

seems this is unused code as no error reports have ever been filed, but changed clgtm

@codecov

codecov Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 19.79%. Comparing base (2cd8c5e) to head (1415c74).
⚠️ Report is 9 commits behind head on 4.20.

Additional details and impacted files
@@             Coverage Diff              @@
##               4.20   #14023      +/-   ##
============================================
+ Coverage     16.34%   19.79%   +3.44%     
- Complexity    13574    20000    +6426     
============================================
  Files          5669     6371     +702     
  Lines        501368   575899   +74531     
  Branches      60903    70495    +9592     
============================================
+ Hits          81964   113975   +32011     
- Misses       410219   449491   +39272     
- Partials       9185    12433    +3248     
Flag Coverage Δ
uitests 3.53% <ø> (-0.62%) ⬇️
unittests 21.06% <100.00%> (+3.85%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

equals() returned false when the two responses had the SAME value and true
when the values DIFFERED (the value branch was inverted):

    else if (this.getValue().equals(other.getValue()))
        return false;

So two identical details were treated as unequal and two details differing
only by value were treated as equal, corrupting any Set/Map/dedup keyed on
ImageStoreDetailResponse. It also NPEd when value was null.

Compare with !Objects.equals(getValue(), other.getValue()), which restores
the correct result and is null-safe.

Adds tests for equal name+value, differing value, and differing name.
@nagaboinaramgopal
nagaboinaramgopal force-pushed the fix/imagestoredetail-equals branch from 6498f93 to 1415c74 Compare September 3, 2026 17:15
@nagaboinaramgopal
nagaboinaramgopal changed the base branch from main to 4.20 September 3, 2026 17:49
@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

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

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

@sureshanaparti sureshanaparti left a comment

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.

clgtm

@sureshanaparti

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

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

@blueorangutan

blueorangutan commented Sep 10, 2026 •

Copy link
Copy Markdown

[SF] Trillian test result (tid-16948)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 63682 seconds
Marvin logs: [archive removed]
Smoke tests completed. 132 look OK, 8 have errors, 1 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_DeployVmAntiAffinityGroup_in_project Error 104.40 test_affinity_groups_projects.py
test_DeployVmAntiAffinityGroup Error 40.37 test_affinity_groups.py
test_01_browser_migrate_template Error 68.44 test_image_store_object_migration.py
test_03_deploy_and_scale_kubernetes_cluster Failure 34.40 test_kubernetes_clusters.py
test_08_upgrade_kubernetes_ha_cluster Failure 0.11 test_kubernetes_clusters.py
test_01_non_strict_host_anti_affinity Failure 162.97 test_nonstrict_affinity_group.py
test_02_non_strict_host_affinity Error 90.23 test_nonstrict_affinity_group.py
test_01_isolate_network_FW_PF_default_routes_egress_true Failure 149.82 test_routers_network_ops.py
test_01_RVR_Network_FW_PF_SSH_default_routes_egress_true Failure 259.25 test_routers_network_ops.py
ContextSuite context=TestMigrateVMStrictTags>:setup Error 0.00 test_vm_strict_host_tags.py
test_hostha_enable_ha_when_host_in_maintenance Error 305.78 test_hostha_kvm.py
all_test_human_readable_logs Skipped --- test_human_readable_logs.py

@sureshanaparti

Copy link
Copy Markdown
Contributor

not related failures in the smoke tests.

@sureshanaparti sureshanaparti modified the milestones: 4.22.2, 4.20.4 Sep 10, 2026
@sureshanaparti
sureshanaparti merged commit b93f603 into apache:4.20 Sep 10, 2026
25 of 27 checks passed
@github-project-automation github-project-automation Bot moved this from Ready to Done in CloudStack Testing Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

4 participants