Skip to content

HMS-5923: add support for rhel10 #1085

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

Merged
merged 4 commits into from
May 14, 2025
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
Binary file modified configs/manifest.zip
Binary file not shown.
4 changes: 4 additions & 0 deletions mk/repos.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@ repos-import: ## Import External repo urls
.PHONY: repos-import-rhel9
repos-import-rhel9: ## Import only rhel 9 repos
OPTIONS_REPOSITORY_IMPORT_FILTER=rhel9 go run ./cmd/external-repos/main.go import

.PHONY: repos-import-rhel10
repos-import-rhel10: ## Import only rhel 10 repos
OPTIONS_REPOSITORY_IMPORT_FILTER=rhel10 go run ./cmd/external-repos/main.go import
10 changes: 10 additions & 0 deletions pkg/config/popular_repositories.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
[
{
"suggested_name": "EPEL 10 Everything x86_64",
"url": "https://dl.fedoraproject.org/pub/epel/10/Everything/x86_64/",
"distribution_versions": [
"10"
],
"distribution_arch": "x86_64",
"gpg_key": "-----BEGIN PGP PUBLIC KEY BLOCK-----\n\nmQINBGV4X6kBEAC3eQxgiWuo08uc3mHo4ELux++uqTnYz/tJzEf9Ou3h36WnhumA\nNvs+Ts5h8PBx879Y9/aIX1Z20p1kf6tBCinZnEJu59n+TAAsph0+XQlV1l5YkleK\nZ2ff/Fg65k8QcLXWaIGykA/FaKznRiSurGuD6tRGhJw7DawEwBJr8QZSkRUpnH1L\nURW97Q/iKrRPiE5VEayE0y8eAL28jIIiFvR+4oJMzvCsRRB/2wYZ2MlJOW91hcYf\nmbUoXKOBD5UzsJylu7kj25K/ge8rEJ7KicOOwcdYddxsU3Dx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IbI8lYZw5n4XTK4b+byHRBYsOTHiTsGvjTF2Y7oSwW2CVUmL6RZ23mI4qoY\n1p5kzRS+GjT1acnTei/FTsOlIKCsjfeHx7uxCkX6xpAD8P3UtLQqfsgH0CL4vSZt\nTGO6L1InQlp4ZG3OYIomTKbD3/R0wod3U3dTqdulQMXL895u6OLTY3spY2m2MO2k\np9Dfd2pKuxK9Mys=\n=mhQZ\n-----END PGP PUBLIC KEY BLOCK-----",
"metadata_verification": false
},
{
"suggested_name": "EPEL 9 Everything x86_64",
"url": "https://dl.fedoraproject.org/pub/epel/9/Everything/x86_64/",
Expand Down
4 changes: 4 additions & 0 deletions pkg/config/value_constraints.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const ANY_VERSION = "any"
const El7 = "7"
const El8 = "8"
const El9 = "9"
const El10 = "10"

const FailedIntrospectionsLimit = 20
const SnapshotForceInterval = 24 // In hours
Expand Down Expand Up @@ -58,6 +59,9 @@ var DistributionVersions = [...]DistributionVersion{
}, {
Name: "el9",
Label: El9,
}, {
Name: "el10",
Label: El10,
},
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/dao/repository_configs.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ func (r repositoryConfigDaoImpl) List(
"name": "name",
"url": "url",
"distribution_arch": "arch",
"distribution_versions": "array_to_string(versions, ',')",
"distribution_versions": "((SELECT min(v::int) FROM unnest(versions) AS v WHERE v <> 'any'), cardinality(versions))", // sort by lowest version numerically (excluding 'any'), then by number of versions
"package_count": "package_count",
"last_introspection_time": "last_introspection_time",
"last_introspection_status": "last_introspection_status",
Expand Down
26 changes: 20 additions & 6 deletions pkg/dao/repository_configs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1788,17 +1788,25 @@ func (suite *RepositoryConfigSuite) TestListFilterMultipleVersions() {

quantity := 20

_, err := seeds.SeedRepositoryConfigurations(suite.tx, quantity/2,
seeds.SeedOptions{OrgID: orgID, Versions: &[]string{config.El7, config.El8, config.El9}})
_, err := seeds.SeedRepositoryConfigurations(suite.tx, quantity/4,
seeds.SeedOptions{OrgID: orgID, Versions: &[]string{config.El7, config.El8, config.El9, config.El10}})
assert.Nil(t, err)

_, err = seeds.SeedRepositoryConfigurations(suite.tx, quantity/2,
_, err = seeds.SeedRepositoryConfigurations(suite.tx, quantity/4,
seeds.SeedOptions{OrgID: orgID, Versions: &[]string{config.El7}})
assert.Nil(t, err)

_, err = seeds.SeedRepositoryConfigurations(suite.tx, quantity/4,
seeds.SeedOptions{OrgID: orgID, Versions: &[]string{config.El8, config.El9, config.El10}})
assert.Nil(t, err)

_, err = seeds.SeedRepositoryConfigurations(suite.tx, quantity/4,
seeds.SeedOptions{OrgID: orgID, Versions: &[]string{config.El9, config.El10}})
assert.Nil(t, err)

// Seed data to a 2nd org to verify no crossover
_, err = seeds.SeedRepositoryConfigurations(suite.tx, quantity,
seeds.SeedOptions{OrgID: "kdksfkdf", Versions: &[]string{config.El7, config.El8, config.El9}})
seeds.SeedOptions{OrgID: "kdksfkdf", Versions: &[]string{config.El7, config.El8, config.El9, config.El10}})
assert.Nil(t, err)

repoConfigDao := GetRepositoryConfigDao(suite.tx, suite.mockPulpClient, suite.mockFsClient)
Expand All @@ -1811,12 +1819,18 @@ func (suite *RepositoryConfigSuite) TestListFilterMultipleVersions() {
assert.Equal(t, quantity, len(response.Data))
assert.Equal(t, int64(quantity), count)

// By setting the above seed values and SortBy to "version asc", we expect the first page to contain 10 versions of length 1 and 10 versions of length 3
// By setting the above seed values and SortBy to "version asc", we expect the first page to
// contain 5 versions of length 1, 5 versions of length 4, 5 versions of length 3, and 5 versions of length 2:
// [7], [7, 8, 9, 10], [8, 9, 10], [9, 10]
firstItem := len(response.Data[0].DistributionVersions)
secondItem := len(response.Data[5].DistributionVersions)
thirdItem := len(response.Data[10].DistributionVersions)
lastItem := len(response.Data[len(response.Data)-1].DistributionVersions)

assert.Equal(t, firstItem, 1)
assert.Equal(t, lastItem, 3)
assert.Equal(t, secondItem, 4)
assert.Equal(t, thirdItem, 3)
assert.Equal(t, lastItem, 2)
}

func (suite *RepositoryConfigSuite) TestListFilterSearch() {
Expand Down
72 changes: 72 additions & 0 deletions pkg/external_repos/redhat_repos.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,5 +142,77 @@
"arch": "x86_64",
"distribution_version": "8",
"feature_name": "OPENSHIFT-OCP-x86_64"
},
{
"name": "Red Hat Enterprise Linux 10 for x86_64 - BaseOS (RPMs)",
"content_label": "rhel-10-for-x86_64-baseos-rpms",
"url": "https://cdn.redhat.com/content/dist/rhel10/10/x86_64/baseos/os",
"arch": "x86_64",
"distribution_version": "10",
"selector": "rhel10",
"feature_name": "RHEL-OS-x86_64"
},
{
"name": "Red Hat Enterprise Linux 10 for x86_64 - AppStream (RPMs)",
"content_label": "rhel-10-for-x86_64-appstream-rpms",
"url": "https://cdn.redhat.com/content/dist/rhel10/10/x86_64/appstream/os",
"arch": "x86_64",
"distribution_version": "10",
"selector": "rhel10",
"feature_name": "RHEL-OS-x86_64"
},
{
"name": "Red Hat CodeReady Linux Builder for RHEL 10 x86_64 (RPMs)",
"content_label": "codeready-builder-for-rhel-10-x86_64-rpms",
"url": "https://cdn.redhat.com/content/dist/rhel10/10/x86_64/codeready-builder/os",
"arch": "x86_64",
"distribution_version": "10",
"selector": "rhel10",
"feature_name": "RHEL-OS-x86_64"
},
{
"name": "Red Hat Enterprise Linux 10 for ARM 64 - BaseOS (RPMs)",
"content_label": "rhel-10-for-aarch64-baseos-rpms",
"url": "https://cdn.redhat.com/content/dist/rhel10/10/aarch64/baseos/os",
"arch": "aarch64",
"distribution_version": "10",
"selector": "rhel10",
"feature_name": "RHEL-OS-x86_64"
},
{
"name": "Red Hat Enterprise Linux 10 for ARM 64 - AppStream (RPMs)",
"content_label": "rhel-10-for-aarch64-appstream-rpms",
"url": "https://cdn.redhat.com/content/dist/rhel10/10/aarch64/appstream/os",
"arch": "aarch64",
"distribution_version": "10",
"selector": "rhel10",
"feature_name": "RHEL-OS-x86_64"
},
{
"name": "Red Hat CodeReady Linux Builder for RHEL 10 ARM 64 (RPMs)",
"content_label": "codeready-builder-for-rhel-10-aarch64-rpms",
"url": "https://cdn.redhat.com/content/dist/rhel10/10/aarch64/codeready-builder/os",
"arch": "aarch64",
"distribution_version": "10",
"selector": "rhel10",
"feature_name": "RHEL-OS-x86_64"
},
{
"name":"Red Hat Enterprise Linux 10 for x86_64 - Extensions (RPMs)",
"content_label":"rhel-10-for-x86_64-extensions-rpms",
"url":"https://cdn.redhat.com/content/dist/rhel10/10/x86_64/extensions/os",
"arch":"x86_64",
"distribution_version":"10",
"selector": "rhel10",
"feature_name":"RHEL-OS-x86_64"
Copy link
Member

Choose a reason for hiding this comment

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

This is actually available for arm too. The features api seems broken for arm, i'll report that, but i think this should work:

{
        "name":"Red Hat Enterprise Linux 10 for ARM 64 - Extensions (RPMs)",
        "content_label":"rhel-10-for-aarch64-extensions-rpms",
        "url":"https://cdn.redhat.com/content/dist/rhel10/10/aarch64/extensions/os",
        "arch":"aarch64",
        "distribution_version":"10",
        "selector": "rhel10",
        "feature_name":"RHEL-OS-x86_64"
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added!

},
{
"name":"Red Hat Enterprise Linux 10 for ARM 64 - Extensions (RPMs)",
"content_label":"rhel-10-for-aarch64-extensions-rpms",
"url":"https://cdn.redhat.com/content/dist/rhel10/10/aarch64/extensions/os",
"arch":"aarch64",
"distribution_version":"10",
"selector": "rhel10",
"feature_name":"RHEL-OS-x86_64"
}
]
5 changes: 3 additions & 2 deletions pkg/handler/popular_repositories_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ func (s *PopularReposSuite) TestPopularRepos() {
paginationData := api.PaginationData{Limit: 1}
s.dao.RepositoryConfig.WithContextMock().On("List", test.MockCtx(), test_handler.MockOrgId, paginationData, api.FilterData{Search: "https://dl.fedoraproject.org/pub/epel/9/Everything/x86_64/"}).Return(collection, int64(0), nil)
s.dao.RepositoryConfig.On("List", test.MockCtx(), test_handler.MockOrgId, paginationData, api.FilterData{Search: "https://dl.fedoraproject.org/pub/epel/8/Everything/x86_64/"}).Return(collection, int64(0), nil)
s.dao.RepositoryConfig.On("List", test.MockCtx(), test_handler.MockOrgId, paginationData, api.FilterData{Search: "https://dl.fedoraproject.org/pub/epel/10/Everything/x86_64/"}).Return(collection, int64(0), nil)

path := fmt.Sprintf("%s/popular_repositories/?limit=%d", api.FullRootPath(), 10)
req := httptest.NewRequest(http.MethodGet, path, nil)
Expand All @@ -97,9 +98,9 @@ func (s *PopularReposSuite) TestPopularRepos() {
assert.Nil(s.T(), err)
assert.Equal(s.T(), http.StatusOK, code)
assert.Equal(s.T(), 0, response.Meta.Offset)
assert.Equal(s.T(), int64(2), response.Meta.Count)
assert.Equal(s.T(), int64(3), response.Meta.Count)
assert.Equal(s.T(), 10, response.Meta.Limit)
assert.Equal(s.T(), 2, len(response.Data))
assert.Equal(s.T(), 3, len(response.Data))
assert.Equal(s.T(), response.Data[0].ExistingName, "")
}

Expand Down
Loading