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


##########
helm/superset/templates/_helpers.tpl:
##########
@@ -685,6 +685,13 @@ TALISMAN_CONFIG = {
 {{- define "superset.initScript" -}}
 #!/bin/sh
 set -eu
+{{- if .Values.init.istio.terminateSidecarOnExit }}

Review Comment:
   **Suggestion:** The conditional directly dereferences a nested values path, 
which can break template rendering when `init.istio` is omitted or set to null 
in override values. In that case Helm can error before install/upgrade instead 
of simply treating the option as disabled. Read this flag via `dig` (with a 
false default) or guard the parent map before accessing 
`terminateSidecarOnExit`. [possible bug]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   ❌ Helm install or upgrade fails on misconfigured init.istio.
   ⚠️ Superset init-db job script never rendered when error occurs.
   ```
   </details>
   <details>
   <summary><b>Steps of Reproduction ✅ </b></summary>
   
   ```mdx
   1. Create a Helm override values file (for example myvalues.yaml) that nulls 
the init
   Istio block, such as:
   
      - in myvalues.yaml set either `init: null` or `init:` with `istio: null`, 
overriding
      the defaults from `helm/superset/values.yaml:8-24` and
      `helm/superset/values.yaml:1019-1022` where init and init.istio are 
defined.
   
   2. Run `helm template` or `helm install` using the Superset chart at 
`helm/superset` with
   `-f myvalues.yaml`, so Helm renders all templates including
   `helm/superset/templates/secret-superset-config.yaml:10-15`.
   
   3. During rendering of `secret-superset-config.yaml`, Helm evaluates 
`superset_init.sh: |`
   which includes `{{- include "superset.initScript" . | nindent 4 }}`; that in 
turn expands
   the helper `superset.initScript` defined at
   `helm/superset/templates/_helpers.tpl:685-694`.
   
   4. The helper executes the conditional `{{- if 
.Values.init.istio.terminateSidecarOnExit
   }}` at `helm/superset/templates/_helpers.tpl:688`, and because 
`.Values.init.istio` is
   null or not a map under the override, Helm raises a template error about 
accessing
   `terminateSidecarOnExit` on a nil value, causing the install/upgrade to fail 
instead of
   simply treating the flag as false.
   ```
   </details>
   
   [![Fix in 
Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=d14e1e27378d4fbf8bed1efc2f2a54bc&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 [![Fix in VSCode 
Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=d14e1e27378d4fbf8bed1efc2f2a54bc&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   
   *(Use Cmd/Ctrl + Click for best experience)*
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** helm/superset/templates/_helpers.tpl
   **Line:** 688:688
   **Comment:**
        *Possible Bug: The conditional directly dereferences a nested values 
path, which can break template rendering when `init.istio` is omitted or set to 
null in override values. In that case Helm can error before install/upgrade 
instead of simply treating the option as disabled. Read this flag via `dig` 
(with a false default) or guard the parent map before accessing 
`terminateSidecarOnExit`.
   
   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.
   Once fix is implemented, also check other comments on the same PR, and ask 
user if the user wants to fix the rest of the comments as well. if said yes, 
then fetch all the comments validate the correctness and implement a minimal fix
   ```
   </details>
   <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41396&comment_hash=ccac27365481b7a82d545c33510811c5dc6a06131284811c872442b5cf0d0078&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41396&comment_hash=ccac27365481b7a82d545c33510811c5dc6a06131284811c872442b5cf0d0078&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