settings grouped by category#259
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the application configuration system to expose settings grouped by category end-to-end (Django settings → API → frontend), and adds a substantial set of new configuration options, including SSO/OIDC-related settings.
Changes:
- Added
CONSTANCE_GROUPSand reorganized/expandedCONSTANCE_CONFIG, including new OIDC/SSO settings. - Extended the settings API payload to include a
groupfield per setting. - Updated the settings UI to fetch all settings and render them grouped with sidebar navigation and filtering.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
project/settings.py |
Reorganized/expanded Constance settings and introduced CONSTANCE_GROUPS (including new OIDC options). |
ngen/utils.py |
Adds group metadata to the settings list returned by get_settings() (and tags env/static settings). |
ngen/serializers/tools.py |
Exposes the new group field in ConstanceSerializer. |
frontend/src/views/setting/EditSetting.jsx |
Reworked settings UI to load all pages, group settings, add filter + sidebar navigation, and support undo per-field. |
Comments suppressed due to low confidence (1)
project/settings.py:622
OIDC_RP_CLIENT_SECRETis a credential but is not included inCONSTANCE_CONFIG_PASSWORDS, so it will be returned in cleartext via the settings API and shown in the UI. Add it toCONSTANCE_CONFIG_PASSWORDS(and consider whether any other new sensitive OIDC fields should also be masked).
"OIDC_ENABLED": (
os.environ.get("OIDC_ENABLED", "false").lower() in VALUES_TRUE,
gettext_lazy("Enable OpenID Connect Single Sign-On (requires server restart)"),
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
project/settings.py:629
- The OIDC section is duplicated: starting at this point, keys like
OIDC_ENABLED,OIDC_RP_CLIENT_ID, etc. are redefined even though they were already defined a few lines above. In Python dict literals, later duplicates silently override earlier values, which is error-prone and makes the effective defaults unclear. Remove the duplicated block and keep a single authoritative OIDC configuration section.
"OIDC_ENABLED": (
os.environ.get("OIDC_ENABLED", "false").lower() in VALUES_TRUE,
gettext_lazy("Enable OpenID Connect Single Sign-On (requires server restart)"),
bool,
),
"OIDC_RP_CLIENT_ID": (
os.environ.get("OIDC_RP_CLIENT_ID", ""),
gettext_lazy("OIDC Relying Party Client ID"),
str,
),
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.
This pull request introduces a major refactor and enhancement of the application configuration system, focusing on grouping, organizing, and extending the available settings. It adds logical grouping to settings for better maintainability, introduces new configuration options (notably for SSO/OIDC integration), and updates serializers and utilities to support these changes.
Key changes include:
1. Configuration Grouping and Organization
CONSTANCE_GROUPSdictionary inproject/settings.pyto categorize all configuration options by theme (e.g., "Team / General", "Email", "Cases", "Events", "SSO / OIDC"), making the settings more organized and easier to navigate.get_settingsutility andConstanceSerializerto include agroupfield for each setting, allowing the frontend or API consumers to display settings by group. [1] [2] [3]2. Addition and Reorganization of Settings
CONSTANCE_CONFIG, including new options for team info, email, case management, event auto-merging, priorities, artifact handling, taxonomies, contacts, integrations, and especially SSO/OIDC. Deprecated, renamed, or re-ordered some existing settings for clarity. [1] [2] [3] [4] [5]3. SSO / OIDC Integration
4. API and Serializer Enhancements
ConstanceSerializerinngen/serializers/tools.pyto include a newgroupfield, exposing the configuration group in API responses.get_settingsfunction inngen/utils.pyto attach the appropriate group to each setting, defaulting to "Other" or "Environment / Static" as needed. [1] [2]5. Minor Corrections
These changes provide a more scalable and user-friendly configuration management system, paving the way for easier customization and better integration with external identity providers.
project/settings.py,ngen/utils.py,ngen/serializers/tools.py) [1] [2] [3] [4]project/settings.py) [1] [2] [3] [4] [5]project/settings.py)ngen/serializers/tools.py,ngen/utils.py) [1] [2] [3]project/settings.py)