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`
[](https://docs.codeant.ai/cli/resolve-pr-comments-skill)
[](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)
[](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`
[](https://docs.codeant.ai/cli/resolve-pr-comments-skill)
[](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)
[](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]