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 2941: Add RpmRepositoryVersionErrataList to tangy #6

Merged
merged 7 commits into from
Apr 17, 2024

Conversation

Andrewgdewar
Copy link
Member

@Andrewgdewar Andrewgdewar commented Mar 15, 2024

Adds a function to list errata in repository versions, supports pagination and filtering on errata id, type, and severity

Can be tested with this backend PR

pkg/tangy/rpm.go Outdated Show resolved Hide resolved
Comment on lines 32 to 44
func (r *RpmSuite) CreateTestRepositoryWithErrata(t *testing.T) {
_, err := r.client.LookupOrCreateDomain(r.domainName)
require.NoError(t, err)

repoHref, remoteHref, err := r.client.CreateRepository(r.domainName, testRepoNameWithErrata, testRepoWithErrata)
require.NoError(t, err)

syncTask, err := r.client.SyncRpmRepository(repoHref, remoteHref)
require.NoError(t, err)

_, err = r.client.PollTask(syncTask)
require.NoError(t, err)
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you refactor this to update the existing "CreateTestRepository" method to take a name and URL as input? Then we can use that method for any repository creation.

@@ -244,6 +262,49 @@ func (r *RpmSuite) TestRpmRepositoryVersionEnvironmentSearch() {
assert.Len(r.T(), search, 0)
}

func (r *RpmSuite) TestRpmRepositoryVersionErrataListFilter() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you also add some cases to make sure that limit and offset are working?

@xbhouse
Copy link
Contributor

xbhouse commented Apr 16, 2024

i haven't found a repo with packages that include severities in the errata, so i haven't been able to really test that filter yet here. i've verified it works with the backend and UI, but if you know of any repos i could use to test here let me know

@swadeley
Copy link
Member

i haven't found a repo with packages that include severities in the errata, so i haven't been able to really test that filter yet here. i've verified it works with the backend and UI, but if you know of any repos i could use to test here let me know

Hi, this repo has severity:
https://stephenw.fedorapeople.org/fakerepos/multiple_errata/

@xbhouse
Copy link
Contributor

xbhouse commented Apr 17, 2024

@swadeley do the package errata in that repo have an updatedDate? trying to view that repo's package errata has surfaced an error: can't scan into dest[6]: cannot scan NULL into *string"

these are the values expected and i'm just assuming updatedDate is missing since it's the 7th one:
id, errataId, title, summary, description, issuedDate, updatedDate, type, severity, rebootSuggested

if updatedDate can be null (which makes sense if it can), i'll need to add a change

@xbhouse
Copy link
Contributor

xbhouse commented Apr 17, 2024

ok, changed updatedDate to *string and can now view the errata. thanks again

Copy link
Collaborator

@rverdile rverdile left a comment

Choose a reason for hiding this comment

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

looks good! remember to do the release after you merge!

@xbhouse xbhouse merged commit b9362eb into content-services:main Apr 17, 2024
1 of 2 checks passed
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.

5 participants