Skip to content

feat(scalityui): expose Guardian shell-ui config (canUseGuardian, guardianOrigin)#89

Merged
JBWatenbergScality merged 2 commits into
mainfrom
improvement/scalityui-guardian-shell-config
Jun 25, 2026
Merged

feat(scalityui): expose Guardian shell-ui config (canUseGuardian, guardianOrigin)#89
JBWatenbergScality merged 2 commits into
mainfrom
improvement/scalityui-guardian-shell-config

Conversation

@JBWatenbergScality

Copy link
Copy Markdown
Collaborator

What

shell-ui's ShellJSONFileConfig recently gained two Guardian fields that the ScalityUI CR did not expose, so they could never be set in the operator-generated config.json:

  • canUseGuardian — feature flag for the embedded Guardian AI assistant (sibling of canChangeTheme, consumed identically in shell-ui's NavBar.tsx)
  • guardianOrigin — origin URL (scheme + host + port) used as the assistant iframe src and the postMessage target origin

Changes

  • api/v1alpha1/scalityui_types.go — add CanUseGuardian *bool (default false) and GuardianOrigin string to the existing UIConfig block
  • internal/controller/scalityui/controller.gocreateConfigJSON now emits canUseGuardian (default false when no uiConfig) and guardianOrigin (only when set)
  • regenerated CRD schema + deepcopy
  • extended createConfigJSON unit tests (default + custom cases)

Notes

  • Both fields placed in UIConfig since canUseGuardian is a feature-flag sibling of the existing canChange* flags and shell-ui reads them as flat top-level keys.
  • guardianOrigin is emitted only when non-empty so shell-ui keeps its own default-origin fallback; the assistant only renders when both canUseGuardian and guardianOrigin are present.
  • userGroupsMapping is also unmapped in the operator but predates the shell-ui config file (not a recent addition), so it is intentionally left out of this PR.

🤖 Generated with Claude Code

@JBWatenbergScality JBWatenbergScality marked this pull request as ready for review June 24, 2026 15:42
Copilot AI review requested due to automatic review settings June 24, 2026 15:42

@ZiyangLinScality ZiyangLinScality 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.

LGTM

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.

Pull request overview

This PR updates the ScalityUI operator API and config generation so users can configure shell-ui’s embedded Guardian assistant via the ScalityUI CR, ensuring the operator-generated config.json can include canUseGuardian and guardianOrigin.

Changes:

  • Add canUseGuardian and guardianOrigin fields to UIConfig (API + CRD schema + deepcopy regeneration).
  • Update createConfigJSON to emit canUseGuardian and conditionally emit guardianOrigin.
  • Extend createConfigJSON tests for default and custom configurations.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
internal/controller/scalityui/controller.go Emits canUseGuardian and conditionally guardianOrigin into generated config.json.
internal/controller/scalityui/controller_test.go Adds assertions covering default and custom Guardian-related config output.
config/crd/bases/ui.scality.com_scalityuis.yaml Regenerates CRD schema to include the new uiConfig fields and defaults.
api/v1alpha1/zz_generated.deepcopy.go Regenerates deepcopy logic to include CanUseGuardian.
api/v1alpha1/scalityui_types.go Adds CanUseGuardian and GuardianOrigin to the UIConfig API type with docs/defaults.
Files not reviewed (1)
  • api/v1alpha1/zz_generated.deepcopy.go: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/controller/scalityui/controller.go Outdated
…rdianOrigin)

shell-ui's ShellJSONFileConfig recently gained two Guardian fields that
the ScalityUI CR did not expose, so they could never be set in the
generated config.json:

- canUseGuardian: feature flag for the embedded Guardian AI assistant
- guardianOrigin: origin URL used as the assistant iframe src and
  postMessage target

Add both to the existing UIConfig block and emit them in
createConfigJSON. guardianOrigin is only emitted when set so shell-ui
keeps its own default-origin fallback; canUseGuardian defaults to false.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@JBWatenbergScality JBWatenbergScality force-pushed the improvement/scalityui-guardian-shell-config branch from 41ea36e to 11ee2c2 Compare June 24, 2026 15:45
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@JBWatenbergScality JBWatenbergScality merged commit e75315c into main Jun 25, 2026
3 checks passed
@JBWatenbergScality JBWatenbergScality deleted the improvement/scalityui-guardian-shell-config branch June 25, 2026 08:17
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.

3 participants