Conversation
|
@MaineK00n any thoughts on this PR? |
There was a problem hiding this comment.
Pull request overview
Adds architecture awareness to Red Hat OVAL parsing so affected packages are emitted/stored per-architecture (instead of collapsing across arches).
Changes:
- Introduce an
archResolverto maprpminfo_test→rpminfo_state→ arch text and emit packages per arch. - Update Red Hat package collection to de-duplicate/version-select per
(name, arch)key. - Extend unit tests to cover multi-arch expansion and update comparisons.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| models/redhat/redhat.go | Adds arch resolution and emits models.Package entries per architecture; de-dupes by (name, arch) during collection. |
| models/redhat/redhat_test.go | Updates tests for new collectRedHatPacks signature and adds multi-arch test cases. |
Comments suppressed due to low confidence (1)
models/redhat/redhat_test.go:350
- The sorting comparator ignores Arch (and Version), so packages that differ only by Arch can end up in non-deterministic order (since
collectRedHatPacksbuilds results from a map). This can makeslices.Equalcomparisons flaky. IncludeArch(and any other differentiating fields, e.g. Version/NotFixedYet) in the sort key for bothactualandtt.expected.
sort.Slice(actual, func(i, j int) bool {
if actual[i].Name == actual[j].Name {
return actual[i].ModularityLabel < actual[j].ModularityLabel
}
return actual[i].Name < actual[j].Name
})
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
I'm very busy at the moment, so I won't be able to see it right away. I would like you to fill out the body of the PR and format the commit message by referring to other commits. |
|
The "How Has This Been Tested?" section is insufficient. Please show that the appropriate arch is included, even if it is just the sqlite3 pattern. |
If this Pull Request is work in progress, Add a prefix of “[WIP]” in the title.
What did you implement:
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.
Fixes # (issue)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.
goval-dictionary fetch redhat 9Checklist:
You don't have to satisfy all of the following.
make fmtmake testIs this ready for review?: YES
Reference