bito-code-review[bot] commented on code in PR #40507:
URL: https://github.com/apache/superset/pull/40507#discussion_r3429387010
##########
helm/superset/templates/deployment-mcp.yaml:
##########
@@ -0,0 +1,169 @@
+{{/*
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+*/}}
+
+{{- if .Values.supersetMcp.enabled -}}
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: {{ template "superset.fullname" . }}-mcp
+ namespace: {{ .Release.Namespace }}
+ labels:
+ app: {{ template "superset.name" . }}-mcp
+ chart: {{ template "superset.chart" . }}
+ release: {{ .Release.Name }}
+ heritage: {{ .Release.Service }}
+ {{- if .Values.extraLabels }}
+ {{- toYaml .Values.extraLabels | nindent 4 }}
+ {{- end }}
+ {{- with .Values.supersetMcp.deploymentAnnotations }}
+ annotations: {{- toYaml . | nindent 4 }}
+ {{- end }}
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Missing deploymentLabels support</b></div>
<div id="fix">
The MCP deployment lacks support for `supersetMcp.deploymentLabels` in
metadata labels. Compare to deployment.yaml (lines 33-35) which includes `{{-
if .Values.supersetNode.deploymentLabels }} {{- toYaml
.Values.supersetNode.deploymentLabels | nindent 4 }} {{- end }}`. This is a
feature gap that prevents operators from adding custom metadata labels to the
deployment resource.
</div>
<details>
<summary>
<b>Code suggestion</b>
</summary>
<blockquote>Check the AI-generated fix before applying</blockquote>
<div id="code">
```
--- helm/superset/templates/deployment-mcp.yaml
+++ helm/superset/templates/deployment-mcp.yaml
@@ -29,6 +29,9 @@
heritage: {{ .Release.Service }}
{{- if .Values.extraLabels }}
{{- toYaml .Values.extraLabels | nindent 4 }}
+ {{- end }}
+ {{- if .Values.supersetMcp.deploymentLabels }}
+ {{- toYaml .Values.supersetMcp.deploymentLabels | nindent 4 }}
{{- end }}
{{- with .Values.supersetMcp.deploymentAnnotations }}
annotations: {{- toYaml . | nindent 4 }}
```
</div>
</details>
</div>
<small><i>Code Review Run #20718c</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
##########
helm/superset/templates/deployment-mcp.yaml:
##########
@@ -0,0 +1,169 @@
+{{/*
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+*/}}
+
+{{- if .Values.supersetMcp.enabled -}}
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: {{ template "superset.fullname" . }}-mcp
+ namespace: {{ .Release.Namespace }}
+ labels:
+ app: {{ template "superset.name" . }}-mcp
+ chart: {{ template "superset.chart" . }}
+ release: {{ .Release.Name }}
+ heritage: {{ .Release.Service }}
+ {{- if .Values.extraLabels }}
+ {{- toYaml .Values.extraLabels | nindent 4 }}
+ {{- end }}
+ {{- with .Values.supersetMcp.deploymentAnnotations }}
+ annotations: {{- toYaml . | nindent 4 }}
+ {{- end }}
+spec:
+ replicas: {{ .Values.supersetMcp.replicaCount }}
+ {{- if .Values.supersetMcp.strategy }}
+ strategy: {{- toYaml .Values.supersetMcp.strategy | nindent 4 }}
+ {{- end }}
+ selector:
+ matchLabels:
+ {{- include "supersetMcp.selectorLabels" . | nindent 6 }}
+ template:
+ metadata:
+ annotations:
+ checksum/config: {{ include "superset-config" . | sha256sum }}
+ checksum/secrets: {{ tpl (toJson .Values.extraSecretEnv) . | sha256sum
}}
+ {{- with .Values.supersetMcp.podAnnotations }}
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- if .Values.supersetMcp.forceReload }}
+ force-reload: {{ randAlphaNum 5 | quote }}
+ {{- end }}
+ labels:
+ app: "{{ template "superset.name" . }}-mcp"
+ release: {{ .Release.Name }}
+ {{- if .Values.extraLabels }}
+ {{- toYaml .Values.extraLabels | nindent 8 }}
+ {{- end }}
+ {{- with .Values.supersetMcp.podLabels }}
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ spec:
+ {{- if or (.Values.serviceAccount.create) (.Values.serviceAccountName) }}
+ serviceAccountName: {{ template "superset.serviceAccountName" . }}
+ {{- end }}
+ securityContext:
+ runAsUser: {{ .Values.runAsUser }}
+ {{- with .Values.supersetMcp.podSecurityContext }}
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- if .Values.supersetMcp.initContainers }}
+ initContainers: {{- tpl (toYaml .Values.supersetMcp.initContainers) . |
nindent 6 }}
+ {{- end }}
+ {{- with .Values.hostAliases }}
+ hostAliases: {{- toYaml . | nindent 6 }}
+ {{- end }}
+ containers:
+ - name: "{{ .Chart.Name }}-mcp"
+ image: "{{ .Values.image.repository }}:{{ .Values.image.tag |
default .Chart.AppVersion }}"
+ imagePullPolicy: {{ .Values.image.pullPolicy }}
+ {{- with .Values.supersetMcp.containerSecurityContext }}
+ securityContext: {{- toYaml . | nindent 12 }}
+ {{- end }}
+ command: {{ tpl (toJson .Values.supersetMcp.command) . }}
+ env:
+ {{- range $key, $value := .Values.extraEnv }}
+ - name: {{ $key | quote}}
+ value: {{ $value | quote }}
+ {{- end }}
+ {{- if .Values.extraEnvRaw }}
+ {{- toYaml .Values.extraEnvRaw | nindent 12 }}
+ {{- end }}
+ envFrom:
+ - secretRef:
+ name: {{ tpl .Values.envFromSecret . | quote }}
+ {{- range .Values.envFromSecrets }}
+ - secretRef:
+ name: {{ tpl . $ | quote }}
+ {{- end }}
+ ports:
+ - name: mcp
+ containerPort: 5008
+ protocol: TCP
+ volumeMounts:
+ - name: superset-config
+ mountPath: {{ .Values.configMountPath | quote }}
+ readOnly: true
+ {{- with .Values.extraVolumeMounts }}
+ {{- tpl (toYaml .) $ | nindent 12 -}}
+ {{- end }}
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Missing extraConfigs volume mount</b></div>
<div id="fix">
The MCP deployment lacks the `extraConfigs` volume mount present in
deployment.yaml (lines 126-129) and deployment-worker.yaml (lines 120-123).
This means MCP pods won't receive extra configuration files mounted at
`extraConfigMountPath`, creating a functional gap between MCP and other
Superset components.
</div>
<details>
<summary>
<b>Code suggestion</b>
</summary>
<blockquote>Check the AI-generated fix before applying</blockquote>
<div id="code">
```
--- helm/superset/templates/deployment-mcp.yaml
+++ helm/superset/templates/deployment-mcp.yaml
@@ -108,6 +108,10 @@
- name: superset-config
mountPath: {{ .Values.configMountPath | quote }}
readOnly: true
+ {{- if .Values.extraConfigs }}
+ - name: superset-extra-config
+ mountPath: {{ .Values.extraConfigMountPath | quote }}
+ {{- end }}
{{- with .Values.extraVolumeMounts }}
{{- tpl (toYaml .) $ | nindent 12 -}}
{{- end }}
```
</div>
</details>
</div>
<small><i>Code Review Run #20718c</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
--
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]