Skip to content

Centralize path building into a new system class#407

Open
MoralCode wants to merge 29 commits into
mainfrom
feat/centralize-paths
Open

Centralize path building into a new system class#407
MoralCode wants to merge 29 commits into
mainfrom
feat/centralize-paths

Conversation

@MoralCode

Copy link
Copy Markdown
Contributor

Description
Similar to other changes made in the past 6 months to build SystemConfig and SystemEnv, this PR introduces SystemPaths - 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

  • Yes, I signed my commits.

Generative AI disclosure

Please select one option:

  • This contribution was NOT assisted or created by Generative AI tools.
  • This contribution was assisted or created by Generative AI tools.

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.

MoralCode added 27 commits June 24, 2026 10:16
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>
Comment thread collectoss/api/gunicorn_conf.py Outdated
Comment thread collectoss/application/cli/backend.py
Comment thread collectoss/application/paths.py
@@ -10,6 +10,7 @@
import warnings
from statistics import mean

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
W0611: Unused mean imported from statistics (unused-import)

Comment thread collectoss/tasks/data_analysis/pull_request_analysis_worker/tasks.py Outdated
Comment thread collectoss/tasks/git/dependency_libyear_tasks/core.py Outdated
Comment thread collectoss/tasks/git/dependency_tasks/core.py Outdated
Comment thread collectoss/tasks/git/scc_value_tasks/core.py Outdated
Comment thread tests/test_classes/test_paths.py Outdated
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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
W0611: Unused get_history imported from sqlalchemy.orm.attributes (unused-import)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

process_dependency_metrics file not found - Facade race condition

1 participant