Skip to content

Enable user management, workspace group creation, and auto-consent by default in config sample - #5068

Open
Marcus Robinson (marrobi) with Copilot wants to merge 8 commits into
mainfrom
copilot/enable-user-management-workspace-consent
Open

Enable user management, workspace group creation, and auto-consent by default in config sample#5068
Marcus Robinson (marrobi) with Copilot wants to merge 8 commits into
mainfrom
copilot/enable-user-management-workspace-consent

Conversation

Copilot AI commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

What is being addressed

config.sample.yaml shipped with user_management_enabled, auto_workspace_group_creation, and auto_grant_workspace_consent all set to false, so users following the default deployment path miss out on UI-based user/workspace assignment, automatic AAD security group creation, and auto-granted consent — requiring extra manual configuration for a good out-of-the-box experience.

While validating this, a related regression was found: templates/workspaces/base/template_schema.json defaulted the updateable create_aad_groups property to false while porter.yaml defaulted it to true. Since RJSF materializes the schema default whenever an older workspace has no stored value for the property, submitting an unrelated edit to an existing workspace could silently send false, causing Terraform to destroy the workspace's AAD role groups and app-role assignments.

How is this addressed

  • Config sample: Set user_management_enabled, auto_workspace_group_creation, and auto_grant_workspace_consent to true in config.sample.yaml, with inline comments noting the Entra ID licensing implications of group creation.
  • Documentation: Updated docs/tre-admins/environment-variables.md and docs/tre-admins/auth.md to reflect the new sample defaults and reiterate the additional Entra permissions/licensing trade-offs.
  • Regression fix: Corrected templates/workspaces/base/template_schema.json's create_aad_groups default to true, matching porter.yaml.
  • Regression test: Added api_app/tests_ma/test_templates/test_workspace_base_template_defaults.py, which parses both porter.yaml and template_schema.json and fails if the create_aad_groups defaults diverge or are not true.
  • Versioning: Bumped tre-workspace-base from 2.10.1 to 2.10.2 and updated CHANGELOG.md under Unreleased (ENHANCEMENTS and BUG FIXES).

…ps schema default

Co-authored-by: marrobi <17089773+marrobi@users.noreply.github.com>
Copilot AI changed the title [WIP] Enable user management, workspace group creation, and workspace consent by default in config sample Enable user management, workspace group creation, and auto-consent by default in config sample Sep 7, 2026
Comment thread templates/workspaces/base/template_schema.json Outdated
Comment thread templates/workspaces/base/template_schema.json Outdated
@marrobi

Copy link
Copy Markdown
Member

Copilot address comemnts.

Co-authored-by: marrobi <17089773+marrobi@users.noreply.github.com>
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

Unit Test Results

0 tests   0 ✅  0s ⏱️
0 suites  0 💤
0 files    0 ❌

Results for commit 6ca0d3e.

♻️ This comment has been updated with latest results.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The authentication documentation names a different Entra permission from the one deployment actually grants.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Enables user-management features by default and prevents workspace edits from disabling Entra role groups.

Changes:

  • Enables three authentication and user-management settings.
  • Aligns workspace schema and Porter defaults.
  • Adds regression coverage, documentation, versioning, and changelog updates.
File summaries
File Description
config.sample.yaml Enables the three features by default.
templates/workspaces/base/template_schema.json Defaults AAD group creation to true.
templates/workspaces/base/porter.yaml Bumps the workspace bundle version.
docs/tre-admins/environment-variables.md Documents sample defaults and implications.
docs/tre-admins/auth.md Updates authentication defaults documentation.
api_app/tests_ma/test_templates/test_workspace_base_template_defaults.py Verifies schema and Porter defaults remain aligned.
api_app/tests_ma/test_templates/__init__.py Marks the test package.
CHANGELOG.md Records the enhancement and regression fix.
Review details
  • Files reviewed: 7/8 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread docs/tre-admins/auth.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@marrobi
Marcus Robinson (marrobi) marked this pull request as ready for review September 8, 2026 11:28
Copilot AI review requested due to automatic review settings September 8, 2026 11:28
@marrobi
Marcus Robinson (marrobi) requested a review from a team as a code owner September 8, 2026 11:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The documentation references a nonexistent Terraform default, and the new test relies on an undeclared direct dependency.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

api_app/tests_ma/test_templates/test_workspace_base_template_defaults.py:5

  • This test directly imports PyYAML, but neither api_app/requirements.txt nor api_app/requirements-dev.txt declares it. The test image currently depends on PyYAML arriving transitively through another package, so an unrelated dependency change can break test collection. Add a pinned PyYAML dependency to requirements-dev.txt.
  • Files reviewed: 7/8 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment thread docs/tre-admins/environment-variables.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 8, 2026 11:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The regression test cannot access template files in the API test image and is not triggered by template-only changes.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 7/8 changed files
  • Comments generated: 2
  • Review effort level: Balanced

Comment on lines +16 to +17
REPO_ROOT = Path(__file__).resolve().parents[3]
BASE_WORKSPACE_DIR = REPO_ROOT / "templates" / "workspaces" / "base"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Moved the regression check to tests/test_workspace_base_template_defaults.py so it runs from the repository root, outside the API image context. The CI step now executes it from the root in commit 70953788.

raise AssertionError(f"Property '{PARAM_NAME}' not found in {schema_path}")


def test_workspace_base_create_aad_groups_defaults_are_consistent_and_true():

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added a repository-level CI filter for templates/workspaces/base/porter.yaml and template_schema.json, with a dedicated validation step running the regression check. This is in commit 70953788.

Co-authored-by: marrobi <17089773+marrobi@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The empty API file triggers the stale-version CI failure, and the new test is omitted from its own workflow filter.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 8/9 changed files
  • Comments generated: 2
  • Review effort level: Balanced


- name: Workspace base template defaults
if: ${{ steps.filter.outputs.workspace_base_template == 'true' }}
run: python tests/test_workspace_base_template_defaults.py

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed the empty api_app/tests_ma/test_templates/__init__.py so this non-API change no longer trips the stale API version gate. Commit 0a624a33.

Comment thread .github/workflows/build_validation_develop.yml
Co-authored-by: marrobi <17089773+marrobi@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The defaults are aligned, documented, versioned, and protected by a passing targeted CI check.

Review details
  • Files reviewed: 8/8 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

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.

Enable user management, workspace group creation, and workspace consent by default in config sample

3 participants