-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add ability to filter by version for listHosts and listMgmtServers APIs #12472
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to filter by version for listHosts and listMgmtServers APIs #12472
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## 4.20 #12472 +/- ##
=========================================
Coverage 16.24% 16.24%
- Complexity 13393 13398 +5
=========================================
Files 5657 5658 +1
Lines 499107 499204 +97
Branches 60574 60587 +13
=========================================
+ Hits 81069 81100 +31
- Misses 409001 409063 +62
- Partials 9037 9041 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
sureshanaparti
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clgtm
|
@blueorangutan package |
|
@sureshanaparti 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. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16451 |
|
@blueorangutan test |
|
@nvazquez a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
DaanHoogland
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clgtm
|
[SF] Trillian test result (tid-15226)
|
| sc.addAnd("name", SearchCriteria.Op.EQ, name); | ||
| } | ||
| if (version != null) { | ||
| sc.addAnd("version", SearchCriteria.Op.EQ, version); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shall we use "LIKE" for better usage like simply searching for 4.20.3 without "-snapshot".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also for searching 4.20 or 22.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@harikrishna-patnala @DaanHoogland I think passing the parameter must be an exact search to match the other parameters behaviour. However, this API supports the keyword parameter and uses LIKE for name, status and type - we can include version as well here
RosiKyu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Key Findings
- Version filter is case-insensitive (TC7)
- Partial versions don't match - uses EQ operator for exact match only (TC6, TC12)
- Filter combines correctly with other parameters (TC3, TC4, TC10)
- Backward compatible - APIs return all results when version parameter is omitted (TC5, TC11)
Note on review comments: As suggested by @harikrishna-patnala and @DaanHoogland, using LIKE instead of EQ would allow more flexible searches (e.g., version=4.20 to match all 4.20.x versions). Current implementation requires exact version string.
Test Case Summary
| TC | Description | Path | Result |
|---|---|---|---|
| TC1 | listHosts - Filter by exact version | API | PASSED |
| TC2 | listHosts - Filter by non-existent version | API | PASSED |
| TC3 | listHosts - Combine version + state filter | API | PASSED |
| TC4 | listHosts - Combine version + zoneid filter | API | PASSED |
| TC5 | listHosts - No version parameter (baseline) | API | PASSED |
| TC6 | listHosts - Partial version (EQ behavior) | API | PASSED |
| TC7 | listHosts - Case sensitivity check | API | PASSED |
| TC8 | listMgmtServers - Filter by exact version | API | PASSED |
| TC9 | listMgmtServers - Filter by non-existent version | API | PASSED |
| TC10 | listMgmtServers - Combine version + id filter | API | PASSED |
| TC11 | listMgmtServers - No version parameter (baseline) | API | PASSED |
| TC12 | listMgmtServers - Partial version (EQ behavior) | API | PASSED |
Detailed Test Execution Results:
TC1: listHosts - Filter by exact version
Objective: Verify version filter returns hosts matching exact version string
Expected Result: Returns both KVM hosts (count: 2)
Actual Result:
(localcloud) 🐱 > list hosts version=4.20.3.0-SNAPSHOT type=routing filter=id,name,state,version
{
"count": 2,
"host": [
{
"id": "7e760736-6211-4fc7-9fec-e0203994d859",
"name": "ref-trl-10697-k-Mol9-rositsa-kyuchukova-kvm1",
"state": "Up",
"version": "4.20.3.0-SNAPSHOT"
},
{
"id": "f60b9127-0823-4049-90bc-7f0b1079aac7",
"name": "ref-trl-10697-k-Mol9-rositsa-kyuchukova-kvm2",
"state": "Up",
"version": "4.20.3.0-SNAPSHOT"
}
]
}
TC2: listHosts - Filter by non-existent version
Objective: Verify filter returns empty when version doesn't exist
Expected Result: Empty result
Actual Result:
(localcloud) 🐱 > list hosts version=9.99.99.0 type=routing filter=id,name,state,version
(no output - empty result)
TC3: listHosts - Combine version + state filter
Objective: Verify version filter works combined with state filter
Expected Result: Returns both KVM hosts
Actual Result:
(localcloud) 🐱 > list hosts version=4.20.3.0-SNAPSHOT state=Up type=routing filter=id,name,state,version
{
"count": 2,
"host": [
{
"id": "7e760736-6211-4fc7-9fec-e0203994d859",
"name": "ref-trl-10697-k-Mol9-rositsa-kyuchukova-kvm1",
"state": "Up",
"version": "4.20.3.0-SNAPSHOT"
},
{
"id": "f60b9127-0823-4049-90bc-7f0b1079aac7",
"name": "ref-trl-10697-k-Mol9-rositsa-kyuchukova-kvm2",
"state": "Up",
"version": "4.20.3.0-SNAPSHOT"
}
]
}
TC4: listHosts - Combine version + zoneid filter
Objective: Verify version filter works combined with zoneid filter
Expected Result: Returns both KVM hosts
Actual Result:
(localcloud) 🐱 > list hosts version=4.20.3.0-SNAPSHOT zoneid=de53c48f-9137-4de9-84aa-931ce6eb3999 type=routing filter=id,name,state,version
{
"count": 2,
"host": [
{
"id": "7e760736-6211-4fc7-9fec-e0203994d859",
"name": "ref-trl-10697-k-Mol9-rositsa-kyuchukova-kvm1",
"state": "Up",
"version": "4.20.3.0-SNAPSHOT"
},
{
"id": "f60b9127-0823-4049-90bc-7f0b1079aac7",
"name": "ref-trl-10697-k-Mol9-rositsa-kyuchukova-kvm2",
"state": "Up",
"version": "4.20.3.0-SNAPSHOT"
}
]
}
TC5: listHosts - No version parameter (baseline)
Objective: Verify existing behavior unchanged without version parameter
Expected Result: Returns both hosts
Actual Result:
(localcloud) 🐱 > list hosts type=routing filter=id,name,version
{
"count": 2,
"host": [
{
"id": "7e760736-6211-4fc7-9fec-e0203994d859",
"name": "ref-trl-10697-k-Mol9-rositsa-kyuchukova-kvm1",
"version": "4.20.3.0-SNAPSHOT"
},
{
"id": "f60b9127-0823-4049-90bc-7f0b1079aac7",
"name": "ref-trl-10697-k-Mol9-rositsa-kyuchukova-kvm2",
"version": "4.20.3.0-SNAPSHOT"
}
]
}
TC6: listHosts - Partial version (EQ behavior)
Objective: Verify partial version doesn't match (EQ operator)
Expected Result: Empty result
Actual Result:
(localcloud) 🐱 > list hosts version=4.20.3 type=routing filter=id,name,version
(no output - empty result)
TC7: listHosts - Case sensitivity check
Objective: Test if version filter is case-sensitive
Expected Result: Test behavior
Actual Result:
(localcloud) 🐱 > list hosts version=4.20.3.0-snapshot type=routing filter=id,name,version
{
"count": 2,
"host": [
{
"id": "7e760736-6211-4fc7-9fec-e0203994d859",
"name": "ref-trl-10697-k-Mol9-rositsa-kyuchukova-kvm1",
"version": "4.20.3.0-SNAPSHOT"
},
{
"id": "f60b9127-0823-4049-90bc-7f0b1079aac7",
"name": "ref-trl-10697-k-Mol9-rositsa-kyuchukova-kvm2",
"version": "4.20.3.0-SNAPSHOT"
}
]
}
Note: Filter is case-insensitive
TC8: listMgmtServers - Filter by exact version
Objective: Verify version filter returns management servers matching exact version
Expected Result: Returns 1 management server
Actual Result:
(localcloud) 🐱 > list managementservers version=4.20.3.0-SNAPSHOT filter=id,name,state,version
{
"count": 1,
"managementserver": [
{
"id": "ae59e241-6c54-46de-9391-b75aebd1578c",
"name": "ref-trl-10697-k-mol9-rositsa-kyuchukova-mgmt1.sofia.shapeblue.com",
"state": "Up",
"version": "4.20.3.0-SNAPSHOT"
}
]
}
TC9: listMgmtServers - Filter by non-existent version
Objective: Verify filter returns empty when version doesn't exist
Expected Result: Empty result
Actual Result:
(localcloud) 🐱 > list managementservers version=9.99.99.0 filter=id,name,state,version
(no output - empty result)
TC10: listMgmtServers - Combine version + id filter
Objective: Verify version filter works combined with id filter
Expected Result: Returns the management server
Actual Result:
(localcloud) 🐱 > list managementservers version=4.20.3.0-SNAPSHOT id=ae59e241-6c54-46de-9391-b75aebd1578c filter=id,name,state,version
{
"count": 1,
"managementserver": [
{
"id": "ae59e241-6c54-46de-9391-b75aebd1578c",
"name": "ref-trl-10697-k-mol9-rositsa-kyuchukova-mgmt1.sofia.shapeblue.com",
"state": "Up",
"version": "4.20.3.0-SNAPSHOT"
}
]
}
TC11: listMgmtServers - No version parameter (baseline)
Objective: Verify existing behavior unchanged without version parameter
Expected Result: Returns 1 management server
Actual Result:
(localcloud) 🐱 > list managementservers filter=id,name,version
{
"count": 1,
"managementserver": [
{
"id": "ae59e241-6c54-46de-9391-b75aebd1578c",
"name": "ref-trl-10697-k-mol9-rositsa-kyuchukova-mgmt1.sofia.shapeblue.com",
"version": "4.20.3.0-SNAPSHOT"
}
]
}
TC12: listMgmtServers - Partial version (EQ behavior)
Objective: Verify partial version doesn't match (EQ operator)
Expected Result: Empty result
Actual Result:
(localcloud) 🐱 > list managementservers version=4.20 filter=id,name,version
(no output - empty result)
|
@blueorangutan package |
|
@nvazquez 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. |
|
Thanks for the reviews @harikrishna-patnala @DaanHoogland @RosiKyu - I have addressed the remaining review comment by adding the version as part of the keyword parameter search:
|
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16532 |
|
@blueorangutan test |
|
@nvazquez a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
RosiKyu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
versionparameter uses exact match (EQ operator) - TC6, TC12keywordparameter now includes version in LIKE search - TC13, TC14, TC15, TC16- Version filter is case-insensitive (TC7)
- Filter combines correctly with other parameters
- Backward compatible - APIs return all results when version parameter is omitted
Review comment addressed: Users can now use keyword=4.20 to find all 4.20.x versions as suggested by @harikrishna-patnala and @DaanHoogland.
Additional Test Cases (after review comment addressed)
| TC | Description | Path | Result |
|---|---|---|---|
| TC13 | listHosts - keyword with partial version (LIKE) | API | PASSED |
| TC14 | listHosts - keyword with "SNAPSHOT" (LIKE) | API | PASSED |
| TC15 | listMgmtServers - keyword with partial version (LIKE) | API | PASSED |
| TC16 | listMgmtServers - keyword with "SNAPSHOT" (LIKE) | API | PASSED |
Overall: 16/16 tests PASSED
TC13: listHosts - keyword with partial version (LIKE)
Objective: Verify keyword parameter searches version using LIKE
Expected Result: Returns hosts matching partial version
Actual Result:
(localcloud) 🐱 > list hosts keyword=4.20.3 type=routing filter=id,name,version
{
"count": 2,
"host": [
{
"id": "7e760736-6211-4fc7-9fec-e0203994d859",
"name": "ref-trl-10697-k-Mol9-rositsa-kyuchukova-kvm1",
"version": "4.20.3.0-SNAPSHOT"
},
{
"id": "f60b9127-0823-4049-90bc-7f0b1079aac7",
"name": "ref-trl-10697-k-Mol9-rositsa-kyuchukova-kvm2",
"version": "4.20.3.0-SNAPSHOT"
}
]
}
TC14: listHosts - keyword with "SNAPSHOT" (LIKE)
Objective: Verify keyword parameter matches version suffix
Expected Result: Returns hosts with SNAPSHOT in version
Actual Result:
(localcloud) 🐱 > list hosts keyword=SNAPSHOT type=routing filter=id,name,version
{
"count": 2,
"host": [
{
"id": "7e760736-6211-4fc7-9fec-e0203994d859",
"name": "ref-trl-10697-k-Mol9-rositsa-kyuchukova-kvm1",
"version": "4.20.3.0-SNAPSHOT"
},
{
"id": "f60b9127-0823-4049-90bc-7f0b1079aac7",
"name": "ref-trl-10697-k-Mol9-rositsa-kyuchukova-kvm2",
"version": "4.20.3.0-SNAPSHOT"
}
]
}
TC15: listMgmtServers - keyword with partial version (LIKE)
Objective: Verify keyword parameter searches version using LIKE
Expected Result: Returns mgmt servers matching partial version
Actual Result:
(localcloud) 🐱 > list managementservers keyword=4.20.3 filter=id,name,version
{
"count": 1,
"managementserver": [
{
"id": "ae59e241-6c54-46de-9391-b75aebd1578c",
"name": "ref-trl-10697-k-mol9-rositsa-kyuchukova-mgmt1.sofia.shapeblue.com",
"version": "4.20.3.0-SNAPSHOT"
}
]
}
TC16: listMgmtServers - keyword with "SNAPSHOT" (LIKE)
Objective: Verify keyword parameter matches version suffix
Expected Result: Returns mgmt servers with SNAPSHOT in version
Actual Result:
(localcloud) 🐱 > list managementservers keyword=SNAPSHOT filter=id,name,version
{
"count": 1,
"managementserver": [
{
"id": "ae59e241-6c54-46de-9391-b75aebd1578c",
"name": "ref-trl-10697-k-mol9-rositsa-kyuchukova-mgmt1.sofia.shapeblue.com",
"version": "4.20.3.0-SNAPSHOT"
}
]
}
|
[SF] Trillian test result (tid-15275)
|
harikrishna-patnala
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @nvazquez LGTM
Description
This PR allows filtering hosts and management servers by version through their listing APIs
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?