Skip to content

settings grouped by category#259

Merged
mateodurante merged 4 commits into
developfrom
feature/setting_groups
May 26, 2026
Merged

settings grouped by category#259
mateodurante merged 4 commits into
developfrom
feature/setting_groups

Conversation

@mateodurante
Copy link
Copy Markdown
Contributor

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

  • Introduced the CONSTANCE_GROUPS dictionary in project/settings.py to categorize all configuration options by theme (e.g., "Team / General", "Email", "Cases", "Events", "SSO / OIDC"), making the settings more organized and easier to navigate.
  • Updated the get_settings utility and ConstanceSerializer to include a group field for each setting, allowing the frontend or API consumers to display settings by group. [1] [2] [3]

2. Addition and Reorganization of Settings

  • Added and reorganized numerous settings in 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

  • Introduced a comprehensive set of configuration options for OpenID Connect (OIDC) Single Sign-On, including endpoints, client credentials, scopes, claim mappings, and user creation behavior. This makes it possible to enable and configure SSO via environment variables.

4. API and Serializer Enhancements

  • Extended the ConstanceSerializer in ngen/serializers/tools.py to include a new group field, exposing the configuration group in API responses.
  • Modified the get_settings function in ngen/utils.py to attach the appropriate group to each setting, defaulting to "Other" or "Environment / Static" as needed. [1] [2]

5. Minor Corrections

  • Fixed a typo in the description for artifact enrichment settings.

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.

  • Configuration grouping and group field in API (project/settings.py, ngen/utils.py, ngen/serializers/tools.py) [1] [2] [3] [4]
  • Major expansion and reorganization of settings, including new features and improved documentation (project/settings.py) [1] [2] [3] [4] [5]
  • Full SSO/OIDC configuration support (project/settings.py)
  • Serializer and utility updates to expose groupings (ngen/serializers/tools.py, ngen/utils.py) [1] [2] [3]
  • Typo fix in artifact enrichment setting description (project/settings.py)

Copilot AI review requested due to automatic review settings May 26, 2026 17:07
@mateodurante mateodurante changed the title setting grouped by category settings grouped by category May 26, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_GROUPS and reorganized/expanded CONSTANCE_CONFIG, including new OIDC/SSO settings.
  • Extended the settings API payload to include a group field 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_SECRET is a credential but is not included in CONSTANCE_CONFIG_PASSWORDS, so it will be returned in cleartext via the settings API and shown in the UI. Add it to CONSTANCE_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.

Comment thread project/settings.py
Comment thread project/settings.py Outdated
Comment thread project/settings.py
Comment thread frontend/src/views/setting/EditSetting.jsx
Comment thread frontend/src/views/setting/EditSetting.jsx Outdated
Comment thread frontend/src/views/setting/EditSetting.jsx Outdated
Comment thread frontend/src/views/setting/EditSetting.jsx Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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,
    ),

Comment thread project/settings.py
Comment thread frontend/src/views/setting/EditSetting.jsx Outdated
Comment thread frontend/src/views/setting/EditSetting.jsx Outdated
@mateodurante mateodurante merged commit 2cba517 into develop May 26, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants