Skip to content

Conversation

bentito
Copy link
Collaborator

@bentito bentito commented Oct 27, 2022

Adds code to allow audit to use file-based catalogs when encountered.

NB: I went over a specific bundle carefully checking all the fields and values for a specific bundle from the 4.11 Red Hat index where both FBC and sqlite versions of the catalog exist. The only diffs at this point are noted in the comments in the code for both data loading functions (getDataFromIndexDB and getDataFromFBC). These diffs do not seem relevant to any reporting audit does.

@bentito bentito self-assigned this Oct 27, 2022
@coveralls
Copy link

coveralls commented Oct 27, 2022

Pull Request Test Coverage Report for Build 3361633323

  • 0 of 7 (0.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.002%) to 0.893%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/actions/get_bundle.go 0 1 0.0%
pkg/actions/extract_index.go 0 6 0.0%
Totals Coverage Status
Change from base Build 3151813407: -0.002%
Covered Lines: 18
Relevant Lines: 2015

💛 - Coveralls

Comment on lines +183 to +188
// check here to see if it's index.db or file-based catalogs
if isFBC() {
reportData, err = getDataFromFBC(reportData)
} else {
reportData, err = getDataFromIndexDB(reportData)
}
Copy link
Member

Choose a reason for hiding this comment

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

You may want to check out action.Render which supports rendering FBC structs from both SQLite and FBC images.

https://pkg.go.dev/github.com/operator-framework/operator-registry@v1.26.2/alpha/action#Render

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hmm, that looks handy, would allow the reading sqlite code to go away, is there an example using it because I'm only seeing exported function of Run and Allowed? And the tests seem to assume a registry ref can be passed in, but if that's needed it would require more rework to the workflow than I think is warranted... I can see how to make use of a lot of the internal functions if they were externalized, esp: checkDBFile and sqliteToDeclcfg...

@bentito
Copy link
Collaborator Author

bentito commented Nov 8, 2022

Okay, left this open for awhile, I'm going to merge it without the changes to preserve audit's internal workflow for now.

@bentito bentito merged commit afbe6f7 into operator-framework:main Nov 8, 2022
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.

3 participants