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 #37864 - API upload of deb-content fails #11221

Merged
merged 1 commit into from
Nov 20, 2024

Conversation

m-bucher
Copy link
Contributor

@m-bucher m-bucher commented Nov 18, 2024

Actually it does not fail but worse, succeed with broken deb-package in katello due to saving the wrong pulp_href.

What are the changes introduced in this pull request?

For deb-repos we have to select the correct created_resource from pulp_task output. We already did that selection in

if repo.deb?
content_unit_href = input[:save_artifact_output][:pulp_tasks].last[:created_resources].find { |href| href.include?("/deb/packages") }
else
content_unit_href = input[:save_artifact_output][:pulp_tasks].last[:created_resources].first
end

What are the testing steps for this pull request?

Use hammer to upload a .deb file into a repository:

hammer repository upload-content --path foo_1.0-1_all.deb --organization ACME --id 42

✔️ Tests 😅

Fixture-debs shamelessly stolen from pulp_deb 😁

@m-bucher m-bucher force-pushed the fix_deb_content_upload branch 5 times, most recently from 330a78b to 401cd94 Compare November 19, 2024 20:11
@m-bucher
Copy link
Contributor Author

Unfortunately, the tests seem to not be the fastest 🐌

I am open for suggestions on making them faster (without blowing the code up unnecessarily due to extensive mocking 😬 ).

Actually it does not fail but worse, succeed with broken deb-package in
katello due to saving the wrong pulp_href.
@m-bucher m-bucher force-pushed the fix_deb_content_upload branch from 401cd94 to 5e45ea7 Compare November 19, 2024 20:31
@m-bucher m-bucher requested a review from sbernhard November 19, 2024 23:04
@nadjaheitmann
Copy link
Contributor

Tested the code changed and it works fine 👍

Copy link
Member

@sbernhard sbernhard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@sbernhard sbernhard merged commit 05f3fc9 into Katello:master Nov 20, 2024
26 of 27 checks passed
@nadjaheitmann nadjaheitmann deleted the fix_deb_content_upload branch November 20, 2024 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants