-
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
base: 4.20
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## 4.20 #12472 +/- ##
============================================
- Coverage 16.24% 16.24% -0.01%
+ Complexity 13393 13390 -3
============================================
Files 5657 5657
Lines 499107 499120 +13
Branches 60574 60576 +2
============================================
Hits 81069 81069
- Misses 409001 409014 +13
Partials 9037 9037
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
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)
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?