Centralize path building into a new system class#407
Open
MoralCode wants to merge 29 commits into
Open
Conversation
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
…etween all of them Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
…ed via env Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
This is done as a special case for historical compatibility for users who are not yet using the config file. No additional paths should be moved to the database. Doing so, especially with the config directory, will potentially create a catch-22. Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
This may be useful for other parts of CollectOSS to initialize various directories from a default set of files Signed-off-by: Adrian Edwards <adredwar@redhat.com>
…vironment variable Signed-off-by: Adrian Edwards <adredwar@redhat.com>
… to SystemPaths Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
…path Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
| @@ -10,6 +10,7 @@ | |||
| import warnings | |||
| from statistics import mean | |||
There was a problem hiding this comment.
[pylint] reported by reviewdog 🐶
W0611: Unused mean imported from statistics (unused-import)
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
| import sys | ||
|
|
||
| from collectoss.application.paths import SystemPaths | ||
| from sqlalchemy.orm.attributes import get_history |
There was a problem hiding this comment.
[pylint] reported by reviewdog 🐶
W0611: Unused get_history imported from sqlalchemy.orm.attributes (unused-import)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Similar to other changes made in the past 6 months to build
SystemConfigandSystemEnv, this PR introducesSystemPaths- a class full of static methods to help assemble filesystem paths across the application.Its designed to be easy to import and use anywhere (only a couple of the functions require database access for backwards compatibility reasons)
This PR helps fix the weird logging location identified in #51 and also fixes #247 (hopefully)
Notes for Reviewers
Not yet tested. Probably need to make sure it runs to full collection AND validate the fix for #247
Signed commits
Generative AI disclosure
Please select one option:
If AI tools were used, please provide details below:
- What tools were used? Sonnet 4.6 medium via cursor
- How were these tools used? mostly light in-editor code completion, helping write unit tests and other minor tasks
- Did you review these outputs before submitting this PR? yes. Code was primarily written by me with light AI assistance. I was overriding the code completion suggestions fairly often.