Skip to content

rpm: add function to determine if paths are RPM#1473

Merged
github-actions[bot] merged 2 commits intoquay:mainfrom
crozzy:rpm-filechecker
Apr 7, 2025
Merged

rpm: add function to determine if paths are RPM#1473
github-actions[bot] merged 2 commits intoquay:mainfrom
crozzy:rpm-filechecker

Conversation

@crozzy
Copy link
Copy Markdown
Contributor

@crozzy crozzy commented Jan 24, 2025

Allow language indexers to check if the filepaths they are interested in have been installed via RPM.

The first iteration of this came in the form of #1320 which would save all the RPM files with an rpm.Filescanner and compare them to the language Package's file during the Resolve step however it required saving lots of filepath data to the database in order to make the determination.

This changeset allows dynamic checking of RPM files during language indexing (akin to how we use the INSTALLER file currently) without the extra storage requirements (that could be huge with a large, diverse corpus of images). Also, as the results are cached for the request duration we don't need to trade reduced storage for increased memory/io.

@crozzy crozzy force-pushed the rpm-filechecker branch 3 times, most recently from 244e040 to 364e886 Compare January 28, 2025 22:53
@crozzy
Copy link
Copy Markdown
Contributor Author

crozzy commented Jan 28, 2025

supersedes #1320

@crozzy crozzy marked this pull request as ready for review January 28, 2025 23:10
@crozzy crozzy requested a review from a team as a code owner January 28, 2025 23:10
@crozzy crozzy requested review from RTann and removed request for a team January 28, 2025 23:10
@crozzy crozzy force-pushed the rpm-filechecker branch 2 times, most recently from 48703f5 to 25156b2 Compare February 4, 2025 23:17
@crozzy crozzy requested a review from RTann February 4, 2025 23:24
BradLugo
BradLugo previously approved these changes Feb 6, 2025
Copy link
Copy Markdown
Contributor

@BradLugo BradLugo left a comment

Choose a reason for hiding this comment

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

LGTM after @RTann's comments are resolved

@crozzy crozzy force-pushed the rpm-filechecker branch 3 times, most recently from 83b1075 to 0eacf93 Compare February 6, 2025 16:14
@crozzy crozzy requested a review from RTann February 6, 2025 16:40
BradLugo
BradLugo previously approved these changes Mar 27, 2025
Copy link
Copy Markdown
Contributor

@BradLugo BradLugo left a comment

Choose a reason for hiding this comment

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

I have just one hang-up, but it's non-blocking. I think we should get more reviewers' approval before merging.

BradLugo
BradLugo previously approved these changes Mar 27, 2025
Copy link
Copy Markdown
Contributor

@BradLugo BradLugo left a comment

Choose a reason for hiding this comment

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

LGTM! I still think we should get more reviewers' approval before merging 🙂

RTann
RTann previously approved these changes Apr 4, 2025
return nil, fmt.Errorf("rpm: error reading native db: %w", err)
return nil, err
}
pkgs = append(pkgs, ps...)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I was afraid of blindly doing this for the return nil, nil case in getDBObjects, but since that returns a slice, it should be ok, and this should truly be a no-op. Another idea may be to return some InvalidNativeDB error and then opt to ignore it here. Either works

@crozzy crozzy force-pushed the rpm-filechecker branch from 40bb4b4 to 5d704fe Compare April 7, 2025 17:50
@crozzy crozzy dismissed stale reviews from BradLugo and RTann via 08e184f April 7, 2025 18:24
@crozzy crozzy force-pushed the rpm-filechecker branch 2 times, most recently from 08e184f to 9dfa98b Compare April 7, 2025 18:27
crozzy added 2 commits April 7, 2025 13:54
Allow language indexers to check if the filepaths they are interested in
have been installed via RPM.

Signed-off-by: crozzy <joseph.crosland@gmail.com>
Check whether interesting paths were installed by RPM during language
level indexing.

Signed-off-by: crozzy <joseph.crosland@gmail.com>
@crozzy crozzy force-pushed the rpm-filechecker branch from 9dfa98b to 1a72e8e Compare April 7, 2025 20:54
@crozzy crozzy requested a review from hdonnay April 7, 2025 21:16
Copy link
Copy Markdown
Member

@hdonnay hdonnay left a comment

Choose a reason for hiding this comment

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

SGTM

@crozzy
Copy link
Copy Markdown
Contributor Author

crozzy commented Apr 7, 2025

/fast-forward

@github-actions github-actions bot merged commit 1a72e8e into quay:main Apr 7, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants