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


##########
helm/superset/values.yaml:
##########
@@ -78,6 +78,25 @@ serviceAccount:
 # @default -- see `values.yaml`
 bootstrapScript: |
   #!/bin/bash
+  {{- $dbUri := .Values.database.uri | default (printf "%s://" (include 
"superset.db.driver" .)) }}
+  {{- if contains "postgres" $dbUri }}

Review Comment:
   **Suggestion:** `contains "postgres"` scans the entire URI, so a valid 
non-PostgreSQL URI containing โ€œpostgresโ€ in its host, username, password, or 
database name can trigger installation and fail startup.
   
   **Assessment:** ๐ŸŸ  `Major` ยท ๐Ÿ” `Occurrence: Rarely` ยท ๐Ÿท๏ธ `Incorrect condition 
logic`
   
   [![Use CodeAnt 
Skill](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/use-codeant-skill-flat-v2.svg)](https://docs.codeant.ai/cli/resolve-pr-comments-skill)
 [![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=d0dc2dfa73564cbdbb446fc85a512b22&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=d0dc2dfa73564cbdbb446fc85a512b22&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   <details>
   <summary><b>Prompt for AI Agent ๐Ÿค– </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** helm/superset/values.yaml
   **Line:** 81:82
   **Comment:**
        *Incorrect Condition Logic: `contains "postgres"` scans the entire URI, 
so a valid non-PostgreSQL URI containing โ€œpostgresโ€ in its host, username, 
password, or database name can trigger installation and fail startup.
   
   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%2F44896&comment_hash=e0ca5b0736886c06265134d484b644a14f72dffcc7650ac80b8ca6c5dacd6708&reaction=like'>๐Ÿ‘</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F44896&comment_hash=e0ca5b0736886c06265134d484b644a14f72dffcc7650ac80b8ca6c5dacd6708&reaction=dislike'>๐Ÿ‘Ž</a>



##########
helm/superset/values.yaml:
##########
@@ -78,6 +78,25 @@ serviceAccount:
 # @default -- see `values.yaml`
 bootstrapScript: |
   #!/bin/bash
+  {{- $dbUri := .Values.database.uri | default (printf "%s://" (include 
"superset.db.driver" .)) }}
+  {{- if contains "postgres" $dbUri }}
+  # The default metadata database driver is PostgreSQL, but Superset images
+  # released before the batteries-included image ship no database drivers.
+  # Install psycopg2 only when the image lacks it, so this stays a no-op
+  # (and needs no network) on images that already bundle it.
+  have_psycopg2() { python -c 'import psycopg2' 2>/dev/null || python3 -c 
'import psycopg2' 2>/dev/null; }
+  if ! have_psycopg2; then

Review Comment:
   **Suggestion:** The check only verifies `psycopg2`, so a configured driver 
such as `postgresql+psycopg` or `postgresql+pg8000` can pass installation while 
Superset still lacks its required driver.
   
   **Assessment:** ๐ŸŸ  `Major` ยท ๐Ÿ” `Occurrence: Sometimes` ยท ๐Ÿท๏ธ `Api mismatch`
   
   [![Use CodeAnt 
Skill](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/use-codeant-skill-flat-v2.svg)](https://docs.codeant.ai/cli/resolve-pr-comments-skill)
 [![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=01f9ac4f24424c929fe1a7f6e77305f8&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=01f9ac4f24424c929fe1a7f6e77305f8&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   <details>
   <summary><b>Prompt for AI Agent ๐Ÿค– </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** helm/superset/values.yaml
   **Line:** 87:88
   **Comment:**
        *Api Mismatch: The check only verifies `psycopg2`, so a configured 
driver such as `postgresql+psycopg` or `postgresql+pg8000` can pass 
installation while Superset still lacks its required driver.
   
   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%2F44896&comment_hash=31027ff44cc2fc6506659b95b648126d32f2f8deee6706fc0701e145e9fb0e54&reaction=like'>๐Ÿ‘</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F44896&comment_hash=31027ff44cc2fc6506659b95b648126d32f2f8deee6706fc0701e145e9fb0e54&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