Fixes #38924 - Allow scoped search on 'persistence' field at /api/v2/hosts/:id/packages#11583
Merged
Conversation
jeremylenz
reviewed
Dec 1, 2025
| @@ -24,5 +24,6 @@ class Jail < Safemode::Jail | |||
| 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 | |||
Member
There was a problem hiding this comment.
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.
Member
Author
There was a problem hiding this comment.
How does the new code look? I ended up pulling the complete_value constants from the persistence model itself.
jeremylenz
approved these changes
Dec 2, 2025
Member
jeremylenz
left a comment
There was a problem hiding this comment.
index_by(&:itself), nifty! TIL
LGTM 👍
Member
Member
|
Sending |
Member
Author
|
I have a fix ready in #11584, sorry about that. |
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.

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: