-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
enhancementImprovements or additions to existing featuresImprovements or additions to existing features
Description
Note
Generated by AI. Edited by @wesleyboar.
Summary
taccsite_cms/settings.py currently scans taccsite_custom subdirectories with a helper like get_subdirs_as_module_names and appends them to INSTALLED_APPS at runtime. This implicit app discovery is brittle and causes surprising behavior.
Files / Locations
taccsite_cms/settings.py— discovery + append toINSTALLED_APPS
Problems / Impact
- Non-deterministic app ordering can break template resolution, signal/middleware ordering, and migrations.
- Makes it hard to reason about which apps are enabled; accidental subdirs can be loaded as apps.
- Hard to test and CI-validate because the environment can produce different lists depending on filesystem order/globs.
- Migration and management commands can behave differently between environments.
Proposed (Backward-Compatible) Approach
- Use existing optional setting
CUSTOM_APPS(list of module names). Use it instead of scanning. - If keeping current scanning behavior as a fallback for backward compatibility:
- Sort discovered module names deterministically (e.g. alphabetically) before appending.
- Emit a deprecation warning (e.g.
logging.warn) when discovery is used.
- Add a validation step on startup (or a management command) that prints the final
INSTALLED_APPSorder and flags duplicates or likely issues. - Document the new setting in
taccsite_custom/README.mdanddocs/with migration steps.
Minimal Migration Plan / Tests
- Tests: unit test that discovery returns a stable, sorted list; integration test that explicitly provided
TACCSITE_CUSTOM_APPSresults in expectedINSTALLED_APPS.
Warning
Teams who want determinism can use setting CUSTOM_APPS, but use of that setting can not be an "opt-in" signal, because all custom Core-CMS instances already use CUSTOM_APPS (for other custom apps).
Client Apps
These apps rely on TACC/Core-CMS:
Metadata
Metadata
Assignees
Labels
enhancementImprovements or additions to existing featuresImprovements or additions to existing features