Project

General

Profile

Bug #26981

/katello/api/repository_sets/:id returns too many repositories

Added by John Mitsch 4 months ago. Updated 4 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
API
Target version:
Difficulty:
Triaged:
Yes
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1712811

Description of problem:
When calling the /katello/api/repository_sets/:id API endpoint, Katello (in 6.5) will return every version/copy of a repository when it is published to multiple contentviews/environments:

GET /katello/api/repository_sets/2456
[DEBUG] Params: {
"organization_id" => 3
}
[DEBUG] Headers: {
:params => {
"organization_id" => 3
}
}
[DEBUG] Response: {
"enabled" => true,
"product" => {
"id" => 9,
"name" => "Red Hat Enterprise Linux Server"
},
"repositories" => [
[ 0] {
"id" => 86206,
"name" => "Red Hat Enterprise Linux 7 Server RPMs x86_64 7Server",
"arch" => "x86_64",
"releasever" => "7Server"
},
[ 1] {
"id" => 86216,
"name" => "Red Hat Enterprise Linux 7 Server RPMs x86_64 7Server",
"arch" => "x86_64",
"releasever" => "7Server"
},

[1544] {
"id" => 23549,
"name" => "Red Hat Enterprise Linux 7 Server RPMs x86_64 7Server",
"arch" => "x86_64",
"releasever" => "7Server"
},
[1545] {
"id" => 1,
"name" => "Red Hat Enterprise Linux 7 Server RPMs x86_64 7Server",
"arch" => "x86_64",
"releasever" => "7Server"
}
],
"name" => "Red Hat Enterprise Linux 7 Server (RPMs)",
"vendor" => "Red Hat",
"label" => "rhel-7-server-rpms",
"id" => "2456",
"type" => "yum",
"gpgUrl" => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release",
"contentUrl" => "/content/dist/rhel/server/7/$releasever/$basearch/os"
}

In 6.4, the response only lists the "real" repository:

[DEBUG 2019-05-22T09:35:50 API] Params: {}
[DEBUG 2019-05-22T09:35:50 API] Headers: {
:params => {}
}
[DEBUG 2019-05-22T09:35:50 API] Response: {
"enabled" => false,
"product" => {
"id" => 23,
"name" => "Red Hat Ansible Engine"
},
"repositories" => [
[0] {
"id" => 1,
"name" => "Red Hat Ansible Engine 2.6 RPMs for Red Hat Enterprise Linux 7 Server x86_64",
"arch" => "x86_64",
"releasever" => nil
}
],
"name" => "Red Hat Ansible Engine 2.6 RPMs for Red Hat Enterprise Linux 7 Server",
"vendor" => "Red Hat",
"label" => "rhel-7-server-ansible-2.6-rpms",
"id" => "7387",
"type" => "yum",
"gpgUrl" => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release",
"contentUrl" => "/content/dist/rhel/server/7/7Server/$basearch/ansible/2.6/os"
}

This "breaks" Foreman Ansible Modules/Nailgun as Nailgun will query repository information for each of the 1545 repositories listed, which takes a lot of time

How reproducible:

Steps to Reproduce:
1.
2.
3.

Actual results:

Expected results:

Additional info:

Associated revisions

Revision 95b17ce4 (diff)
Added by Ian Ballou 4 months ago

Fixes #26981 - repository_sets/:id returns too many repositories

History

#1 Updated by The Foreman Bot 4 months ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/Katello/katello/pull/8153 added

#2 Updated by Samir Jha 4 months ago

  • Triaged changed from No to Yes
  • Target version set to Katello 3.13.0
  • Subject changed from /katello/api/repository_sets/:id returns too many repositories to /katello/api/repository_sets/:id returns too many repositories

#3 Updated by Ian Ballou 4 months ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF