Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor module visibility to add visibility for new modules #359

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

armanddidierjean
Copy link
Member

@armanddidierjean armanddidierjean commented Mar 2, 2024

Description

With this PR, modules visibility are stored with a column visible: bool in db.

This allows at startup to add default group ids for new modules, instead of only adding them during the database first initialization

Breaking change: this PR will delete existing Visibilities

Copy link

codecov bot commented Mar 2, 2024

Codecov Report

Attention: Patch coverage is 65.51724% with 10 lines in your changes are missing coverage. Please review.

Project coverage is 80.27%. Comparing base (c82323c) to head (e41c3c9).

❗ Current head e41c3c9 differs from pull request most recent head 7cac715. Consider uploading reports for the commit 7cac715 to get more accurate results

Files Patch % Lines
app/utils/initialization.py 42.85% 8 Missing ⚠️
app/app.py 60.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #359      +/-   ##
==========================================
- Coverage   80.47%   80.27%   -0.20%     
==========================================
  Files          86       86              
  Lines        5766     5774       +8     
==========================================
- Hits         4640     4635       -5     
- Misses       1126     1139      +13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

app/core/models_core.py Outdated Show resolved Hide resolved
from app.api import ( # We need to do it here, because the list is not initialized at startup
module_list,
)
# We need to import the module_list here, because the it is not initialized at startup
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
# We need to import the module_list here, because the it is not initialized at startup
# We need to import the module_list here, because it is not initialized at startup

root=module.root,
db=db,
)
if module_awareness is None:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
if module_awareness is None:
if module_awareness is not None:

@julien4215
Copy link
Collaborator

julien4215 commented Apr 29, 2024

Instead of deleting the ModuleVisibility table, the migration file could add all modules in the table ModuleAwarness because all these modules already use visibility

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants