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 #38076 - Sanitize content_view repository_ids param #11253

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

quba42
Copy link
Contributor

@quba42 quba42 commented Dec 10, 2024

What are the changes introduced in this pull request?

For the content_view APIs, the repository_ids param is now cast to a list of integers even if it is supplied as a list of strings before being passed to the backend. This ensures the backend always gets consistent data and can perform list comparisons with data taken from the DB.

Considerations taken when implementing this change?

We could of course implement the needed handling within the affected actions instead of the API controller, however, this seems like a less robust design approach, since such special handling can be easily forgotten for the next action that needs it.

What are the testing steps for this pull request?

This PR is most easily tested in combination with these PRs:

Simply create a rolling CV, add a repo to it using Hammer, and then add another repo to it using Hammer. => Everything works.
Now revert this commit and repeat these steps. => Chaos and errors ensue. (Because Hammer sends a list of strings to the API, taking the list difference with the repository_ids already in the rolling CV, will cause Katello to attempt adding the same repo to the rolling CV multiple times in a single task).

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.

2 participants