bito-code-review[bot] commented on code in PR #40507: URL: https://github.com/apache/superset/pull/40507#discussion_r3462890393
########## helm/superset/values.yaml: ########## @@ -796,6 +796,119 @@ supersetWebsockets: # -- Set priorityClassName for supersetWebsockets pods priorityClassName: ~ + +supersetMcp: + # -- Enables the Superset MCP Server, exposed by default via the ingress /mcp subpath + # WARNING: this requires fastMCP to be installed, which can be done by installing `apache-superset[fastmcp]` + enabled: false + replicaCount: 1 + # -- Sets the [pod disruption budget](https://kubernetes.io/docs/tasks/run-application/configure-pdb/) for supersetMcp pods + podDisruptionBudget: + # -- Whether the pod disruption budget should be created + enabled: false + # -- If set, maxUnavailable must not be set - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/\#specifying-a-poddisruptionbudget + minAvailable: 1 + # -- If set, minAvailable must not be set - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/\#specifying-a-poddisruptionbudget + maxUnavailable: 1 + # -- Command + # @default -- a `superset mcp run` command + command: + - "/bin/sh" + - "-c" + - ". {{ .Values.configMountPath }}/superset_bootstrap.sh; superset mcp run --host 0.0.0.0 --port 5008" + # -- If true, forces deployment to reload on each upgrade + forceReload: false + ingress: + path: /mcp + pathType: Prefix + service: + type: ClusterIP + annotations: {} + loadBalancerIP: ~ + port: 5008 + nodePort: + # -- (int) + http: nil + startupProbe: + httpGet: + path: /mcp + port: 5008 + httpHeaders: + - name: Accept + value: text/html + initialDelaySeconds: 15 + timeoutSeconds: 3 + failureThreshold: 60 + periodSeconds: 5 + successThreshold: 1 + livenessProbe: + httpGet: + path: /mcp + port: 5008 + httpHeaders: + - name: Accept + value: text/html + initialDelaySeconds: 15 + timeoutSeconds: 3 + failureThreshold: 3 + periodSeconds: 15 + successThreshold: 1 + readinessProbe: + httpGet: + path: /mcp + port: 5008 + httpHeaders: + - name: Accept + value: text/html + initialDelaySeconds: 15 + timeoutSeconds: 3 + failureThreshold: 3 + periodSeconds: 15 Review Comment: <div> <div id="suggestion"> <div id="issue"><b>BLOCKER: Health probes target MCP protocol endpoint</b></div> <div id="fix"> All three probes (startupProbe at line 833, livenessProbe at line 844, readinessProbe at line 856) target `path: /mcp`. The `/mcp` endpoint serves MCP protocol (JSON-RPC over HTTP), not an HTTP health response. FastMCP requires a custom `/health` route to be registered for operational health checks — the `/mcp` path will return MCP responses that do not constitute an HTTP 200 for standard k8s probe semantics. This means pods will never become ready or stay alive based on these probes. </div> <details> <summary> <b>Code suggestion</b> </summary> <blockquote>Check the AI-generated fix before applying</blockquote> <div id="code"> ``` --- a/helm/superset/values.yaml +++ b/helm/superset/values.yaml @@ -830,35 +830,35 @@ supersetMcp: httpGet: - path: /mcp + path: /health port: 5008 httpHeaders: - name: Accept value: text/html initialDelaySeconds: 15 timeoutSeconds: 3 failureThreshold: 60 periodSeconds: 5 successThreshold: 1 livenessProbe: httpGet: - path: /mcp + path: /health port: 5008 httpHeaders: - name: Accept value: text/html initialDelaySeconds: 15 timeoutSeconds: 3 failureThreshold: 3 periodSeconds: 15 successThreshold: 1 readinessProbe: httpGet: - path: /mcp + path: /health port: 5008 httpHeaders: - name: Accept value: text/html initialDelaySeconds: 15 timeoutSeconds: 3 failureThreshold: 3 periodSeconds: 15 successThreshold: 1 ``` </div> </details> </div> <small><i>Code Review Run #522051</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 }} + {{- if .Values.supersetMcp.deploymentAnnotations }} + annotations: {{- toYaml .Values.supersetMcp.deploymentAnnotations | 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 }} + {{- if .Values.supersetMcp.podAnnotations }} + {{- toYaml .Values.supersetMcp.podAnnotations | nindent 8 }} + {{- end }} Review Comment: <div> <div id="suggestion"> <div id="issue"><b>Missing bootstrap checksum annotation</b></div> <div id="fix"> Missing `checksum/superset_bootstrap.sh` annotation causes the MCP deployment to not restart when `bootstrapScript` changes. Other Superset deployments (deployment.yaml:55, deployment-beat.yaml:47, deployment-worker.yaml:53) include this checksum. Without it, a bootstrap script change (e.g., new env vars or packages) won't trigger pod updates. </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 @@ -50,3 +50,4 @@ annotations: checksum/config: {{ include "superset-config" . | sha256sum }} checksum/secrets: {{ tpl (toJson .Values.extraSecretEnv) . | sha256sum }} + checksum/superset_bootstrap.sh: {{ tpl .Values.bootstrapScript . | sha256sum }} ``` </div> </details> </div> <small><i>Code Review Run #522051</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]
