feat(scalityui): expose Guardian shell-ui config (canUseGuardian, guardianOrigin)#89
Merged
JBWatenbergScality merged 2 commits intoJun 25, 2026
Conversation
Contributor
There was a problem hiding this comment.
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
canUseGuardianandguardianOriginfields toUIConfig(API + CRD schema + deepcopy regeneration). - Update
createConfigJSONto emitcanUseGuardianand conditionally emitguardianOrigin. - Extend
createConfigJSONtests 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.
…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>
41ea36e to
11ee2c2
Compare
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
What
shell-ui's
ShellJSONFileConfigrecently gained two Guardian fields that theScalityUICR did not expose, so they could never be set in the operator-generatedconfig.json:canUseGuardian— feature flag for the embedded Guardian AI assistant (sibling ofcanChangeTheme, consumed identically in shell-ui'sNavBar.tsx)guardianOrigin— origin URL (scheme + host + port) used as the assistant iframesrcand the postMessage target originChanges
api/v1alpha1/scalityui_types.go— addCanUseGuardian *bool(defaultfalse) andGuardianOrigin stringto the existingUIConfigblockinternal/controller/scalityui/controller.go—createConfigJSONnow emitscanUseGuardian(defaultfalsewhen nouiConfig) andguardianOrigin(only when set)createConfigJSONunit tests (default + custom cases)Notes
UIConfigsincecanUseGuardianis a feature-flag sibling of the existingcanChange*flags and shell-ui reads them as flat top-level keys.guardianOriginis emitted only when non-empty so shell-ui keeps its own default-origin fallback; the assistant only renders when bothcanUseGuardianandguardianOriginare present.userGroupsMappingis 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