HMS-10725: support filtering systems by workspace id#2214
Draft
xbhouse wants to merge 1 commit into
Draft
Conversation
Reviewer's GuideAdds support for filtering systems by inventory workspace/group ID alongside existing group name filtering, wiring the new filter through request parsing, query construction, tests, and API documentation. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2214 +/- ##
==========================================
+ Coverage 59.23% 59.26% +0.02%
==========================================
Files 137 137
Lines 8795 8801 +6
==========================================
+ Hits 5210 5216 +6
Misses 3037 3037
Partials 548 548
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:
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="manager/controllers/utils.go" line_range="394-401" />
<code_context>
- if strings.Contains(key, "group_name") {
+ if strings.Contains(key, "group_name") || strings.Contains(key, "group_id") {
groups := []string{}
for _, v := range values {
- name := v
- group, err := utils.ParseInventoryGroup(nil, &name)
+ var group string
+ var err error
+ if strings.Contains(key, "group_id") {
+ group, err = utils.ParseInventoryGroup(&v, nil)
+ } else {
+ group, err = utils.ParseInventoryGroup(nil, &v)
+ }
if err != nil {
// couldn't marshal inventory group to json
</code_context>
<issue_to_address>
**issue (bug_risk):** Avoid taking the address of the `range` loop variable `v` when calling `ParseInventoryGroup`.
This change reintroduces the Go `range`-variable-address pitfall: `&v` is reused across iterations. It only works as long as `ParseInventoryGroup` never stores or uses the pointer asynchronously. To keep this future-proof, copy `v` into a new local (e.g. `id := v`, `name := v`) and pass the address of that local in both branches.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
MichaelMraka
approved these changes
May 27, 2026
Contributor
Author
|
this may not be needed anymore, inventory is going to revert the breaking changes. i'll move this to draft until the revert to make sure |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds support for filtering systems by workspace(group) ID. Inventory started using group IDs instead of names, which broke workspace filtering in the Patch systems UI.
Related Inventory ticket for more context: https://redhat.atlassian.net/browse/RHINENG-21928
Secure Coding Practices Checklist GitHub Link
Secure Coding Checklist
Summary by Sourcery
Add support for filtering systems by inventory workspace (group) ID in the systems listing APIs.
New Features:
Tests: