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 #36820 - translate modulemd content counts #10765

Merged
merged 1 commit into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/services/katello/pulp3/pulp_content_unit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class PulpContentUnit
# Any class that extends this class should define:
# Class#update_model

# rubocop:disable Metrics/MethodLength
def self.katello_name_from_pulpcore_name(pulpcore_name, repo)
# Counts shouldn't be needed for more than the default generic content unit type.
if repo.generic?
Expand All @@ -25,6 +26,8 @@ def self.katello_name_from_pulpcore_name(pulpcore_name, repo)
::Katello::PackageGroup::CONTENT_TYPE
when ::Katello::Pulp3::Erratum::PULPCORE_CONTENT_TYPE
::Katello::Erratum::CONTENT_TYPE
when ::Katello::Pulp3::ModuleStream::PULPCORE_CONTENT_TYPE
'module_stream'
when ::Katello::Pulp3::DockerTag::PULPCORE_CONTENT_TYPE
::Katello::DockerTag::CONTENT_TYPE
when ::Katello::Pulp3::DockerManifest::PULPCORE_CONTENT_TYPE
Expand All @@ -41,6 +44,7 @@ def self.katello_name_from_pulpcore_name(pulpcore_name, repo)
pulpcore_name
end
end
# rubocop:enable Metrics/MethodLength

def self.content_api
fail NotImplementedError
Expand Down
2 changes: 1 addition & 1 deletion test/models/concerns/smart_proxy_extensions_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def test_update_content_counts
expected_counts = { "content_view_versions" =>
{ yum_repo.content_view_version.id.to_s =>
{ "repositories" =>
{ yum_repo.id.to_s => { "erratum" => 4, "srpm" => 1, "rpm" => 31, "rpm.modulemd" => 7, "rpm.modulemd_defaults" => 3, "package_group" => 7, "rpm.packagecategory" => 1 },
{ yum_repo.id.to_s => { "erratum" => 4, "srpm" => 1, "rpm" => 31, "module_stream" => 7, "rpm.modulemd_defaults" => 3, "package_group" => 7, "rpm.packagecategory" => 1 },
file_repo.id.to_s => { "file" => 100 },
ansible_repo.id.to_s => { "ansible.collection" => 802 },
container_repo.id.to_s => { "container.blob" => 30, "docker_manifest_list" => 1, "docker_manifest" => 9, "docker_tag" => 5 },
Expand Down