-
Notifications
You must be signed in to change notification settings - Fork 303
Fixes #38924 - Allow scoped search on 'persistence' field at /api/v2/hosts/:id/packages
#11583
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
Conversation
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.
| scoped_search :on => :release | ||
| scoped_search :on => :arch | ||
| scoped_search :on => :vendor, :complete_value => true | ||
| scoped_search :relation => :host_installed_packages, :on => :persistence, :complete_value => true |
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.
Based on the scoped_search docs I'd recommend using :complete_value => { true => true, false => false }. I'm pretty sure we do that in a few other places in Katello. Also consider only_explicit: true since this won't commonly be searched without the field name.
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.
How does the new code look? I ended up pulling the complete_value constants from the persistence model itself.
jeremylenz
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.
index_by(&:itself), nifty! TIL
LGTM 👍
|
Sending |
|
I have a fix ready in #11584, sorry about that. |

What are the changes introduced in this pull request?
On the
/api/v2/hosts/:id/packagesendpoint, 'persistence' is now a scoped_search field, meaning we can use--searchand--orderin hammer on persistence info. This is particularly important for users who would just like to see their transient host installed packages on a bootc environment.Considerations taken when implementing this change?
What are the testing steps for this pull request?
hammer host package list --host-id <id> --order 'persistence ASC'works.hammer host package list --host-id <id> --search 'persistence = transient'works.Summary by Sourcery
New Features: