codeant-ai-for-open-source[bot] commented on code in PR #38369:
URL: https://github.com/apache/superset/pull/38369#discussion_r2895217768


##########
superset-frontend/src/visualizations/presets/MainPreset.ts:
##########
@@ -101,7 +101,7 @@ export default class MainPreset extends Preset {
         ]
       : [];
 
-    const agGridTablePlugin = isFeatureEnabled(FeatureFlag.AgGridTableEnabled)
+    const agGridTablePlugin = true

Review Comment:
   **Suggestion:** The ag‑grid table plugin registration is currently hardcoded 
to always be enabled (`true` in the ternary), which ignores feature flag 
configuration and will register the plugin even when the feature flag is meant 
to disable it; this breaks the intended gating behavior and can expose an 
experimental chart in environments where it should be off. [logic error]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ⚠️ AG Grid Table chart visible despite AG_GRID_TABLE_ENABLED false.
   - ⚠️ Experimental chart bypasses feature-flag gating in MainPreset 
constructor.
   ```
   </details>
   
   ```suggestion
       const agGridTablePlugin = 
isFeatureEnabled(FeatureFlag.ChartPluginsExperimental)
   ```
   <details>
   <summary><b>Steps of Reproduction ✅ </b></summary>
   
   ```mdx
   1. Start Superset with this PR version deployed and leave the backend 
feature flag
   `AG_GRID_TABLE_ENABLED` at its default `False` as defined in 
`superset/config.py:548`.
   
   2. Load the frontend; during bootstrap, `MainPreset` in
   `superset-frontend/src/visualizations/presets/MainPreset.ts:92-108` is 
instantiated and
   its constructor runs.
   
   3. In the constructor, `const agGridTablePlugin = true ? [new
   AgGridTableChartPlugin().configure({ key: VizType.TableAgGrid })] : [];` at 
lines
   `104-106` executes, so `agGridTablePlugin` is always a non-empty array 
regardless of any
   feature flags.
   
   4. The `super({ plugins: [..., ...experimentalPlugins, ...agGridTablePlugin] 
})` call at
   `108-113, 212-213` registers the `AgGridTableChartPlugin` so that the
   `VizType.TableAgGrid` chart type (defined in
   `packages/superset-ui-core/src/chart/types/VizType.ts:58`) is available in 
Explore, even
   though the dedicated flag `FeatureFlag.AgGridTableEnabled = 
'AG_GRID_TABLE_ENABLED'` in
   `packages/superset-ui-core/src/utils/featureFlags.ts:23-74` is disabled, 
breaking the
   intended gating.
   ```
   </details>
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset-frontend/src/visualizations/presets/MainPreset.ts
   **Line:** 104:104
   **Comment:**
        *Logic Error: The ag‑grid table plugin registration is currently 
hardcoded to always be enabled (`true` in the ternary), which ignores feature 
flag configuration and will register the plugin even when the feature flag is 
meant to disable it; this breaks the intended gating behavior and can expose an 
experimental chart in environments where it should be off.
   
   Validate the correctness of the flagged issue. If correct, How can I resolve 
this? If you propose a fix, implement it and please make it concise.
   ```
   </details>
   <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38369&comment_hash=1b2e56d2c8101e7298910c0c33ef9da0b59a0ef750fd709d131945d59f6462a3&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F38369&comment_hash=1b2e56d2c8101e7298910c0c33ef9da0b59a0ef750fd709d131945d59f6462a3&reaction=dislike'>👎</a>



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to