-
Notifications
You must be signed in to change notification settings - Fork 20
fix: handle non-Immutable FLAGS in getFlagsObject #305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,7 +32,7 @@ export type FlagsObject = { [key: string]: boolean }; | |
|
|
||
| export const getFlagsObject = ({ | ||
| [featureReducerName]: featureState, | ||
| }: RootStateOrAny): FlagsObject => featureState.toObject(); | ||
| }: RootStateOrAny): FlagsObject => featureState?.toObject?.() ?? featureState; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: sed -n '1,130p' src/plugin/utils/useClusterVersion.tsx
rg -n "FlagsObject|RootStateOrAny|toObject|FLAGS|getFlagsObject" src test tests 2>/dev/null | head -240Repository: redhat-developer/gitops-console-plugin Length of output: 3281 🏁 Script executed: #!/bin/bash
set -e
printf '%s\n' '--- relevant files ---'
git ls-files | rg '(^|/)(test|tests|__tests__|fixtures?)(/|$)|useClusterVersion|store|state' | head -200
printf '%s\n' '--- all relevant references ---'
rg -n -S --glob '!node_modules/**' --glob '!dist/**' --glob '!build/**' \
'getFlagsObject|featureReducerName|FLAGS|toObject|CLUSTER_VERSION|FlagsObject|RootStateOrAny' . | head -400
printf '%s\n' '--- package/config clues ---'
rg -n -S --glob 'package.json' --glob 'tsconfig*.json' --glob '*.md' \
'react-redux|immutable|FLAGS|feature flag|feature state' . | head -200Repository: redhat-developer/gitops-console-plugin Length of output: 1425 Check that When 🤖 Prompt for AI Agents |
||
|
|
||
| const getClusterVersionFlag = (state: RootStateOrAny) => getFlagsObject(state)?.['CLUSTER_VERSION']; | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: redhat-developer/gitops-console-plugin
Length of output: 1536
🏁 Script executed:
Repository: redhat-developer/gitops-console-plugin
Length of output: 10370
🏁 Script executed:
Repository: redhat-developer/gitops-console-plugin
Length of output: 31560
Add selector coverage for both UI state shapes. The hook is used by production list components and
ShowOperandsInAllNamespacesRadioGroup, but no test coversuseShowOperandsInAllNamespaces. Add a focused selector test forstate.UI.get(...)andstate.UI.showOperandsInAllNamespaces. Without the compatibility fallback, the direct-property case no longer returns the stored boolean, which breaks the related UI state behavior.🤖 Prompt for AI Agents