Skip to content
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

Fixes #37587 - Reuse API parameter handling from base #11126

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ekohl
Copy link
Member

@ekohl ekohl commented Aug 30, 2024

What are the changes introduced in this pull request?

Foreman's API base controller provides a search_and_pagination parameter group that has all the fields needed. Then it also provides some helpers to parse these values properly.

This reuses those helpers. It also aligns on per_page=all handling instead of a separate full_result=true. That parameter is now deprecated.

Considerations taken when implementing this change?

This doesn't go all the way and reuse Foreman's resource_scope_for_index since that's a much bigger refactor. Katello's API method here is also bigger and allows more options. Whether that's a good thing is questionable, but one I didn't have time to look at.

Long term I'd like to see both APIs aligned. If Foreman's base controller should be extended, that's entirely possible.

Right now it's a very much untested idea based on what I saw in #11124.

What are the testing steps for this pull request?

There should be no regressions in the API. Since it touches on the base API, that can be difficult to test.

ekohl added 2 commits August 30, 2024 20:17
This method has been unused since ElasticSearch was dropped.

Fixes: 26cbfb4 ("Refs #11753 - remove elastic search from content view filter rules")
Foreman's API base controller provides a search_and_pagination parameter
group that has all the fields needed. Then it also provides some helpers
to parse these values properly.

This reuses those helpers. It also aligns on per_page=all handling
instead of a separate full_result=true. That parameter is now
deprecated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant