Conversation
Add a new Helm chart for the Formance Studio app following the existing console-v3 pattern. Includes deployment, service, ingress, migration job, PostgreSQL support, OpenAI secret handling, and feature flags.
WalkthroughAdds five new Helm template helpers to Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@charts/studio/templates/_helpers.tpl`:
- Line 26: The cookie encryption key value is rendered unquoted which can break
YAML if it contains special characters; update the template in
charts/studio/templates/_helpers.tpl to quote the
.Values.config.cookie.encryptionKey (use the same pattern used for the OAuth
client secret) by applying the Helm | quote function to
.Values.config.cookie.encryptionKey so the rendered manifest is always valid
YAML.
- Line 38: The template uses len on
.Values.global.platform.studio.oauth.client.existingSecret which will panic if
that key is nil; change the condition to a nil-safe truthiness check (e.g., use
the value directly like "if
.Values.global.platform.studio.oauth.client.existingSecret") to match how
studio.cookie and studio.openai are handled, ensuring the helper does not call
len on a possibly undefined value and preserves the same logical behavior.
🧹 Nitpick comments (1)
charts/studio/templates/_helpers.tpl (1)
70-84: Consider quotingNODE_ENVfor consistency.All other string values in this file use
| quote(feature flags, secrets, etc.).NODE_ENVon line 72 is unquoted. While typical values likeproductionare safe, quoting defensively keeps the pattern consistent.Proposed fix
- name: NODE_ENV - value: {{ .Values.config.environment }} + value: {{ .Values.config.environment | quote }}
| name: {{ .Values.config.cookie.existingSecret }} | ||
| key: {{ .Values.config.cookie.secretKeys.encryptionKey }} | ||
| {{- else }} | ||
| value: {{ .Values.config.cookie.encryptionKey }} |
There was a problem hiding this comment.
Missing | quote on cookie encryption key value.
Line 44 correctly quotes the OAuth client secret, but here the encryptionKey is unquoted. If the value contains YAML-special characters (e.g., #, :, {), the rendered manifest will be malformed.
Proposed fix
- value: {{ .Values.config.cookie.encryptionKey }}
+ value: {{ .Values.config.cookie.encryptionKey | quote }}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| value: {{ .Values.config.cookie.encryptionKey }} | |
| value: {{ .Values.config.cookie.encryptionKey | quote }} |
🤖 Prompt for AI Agents
In `@charts/studio/templates/_helpers.tpl` at line 26, The cookie encryption key
value is rendered unquoted which can break YAML if it contains special
characters; update the template in charts/studio/templates/_helpers.tpl to quote
the .Values.config.cookie.encryptionKey (use the same pattern used for the OAuth
client secret) by applying the Helm | quote function to
.Values.config.cookie.encryptionKey so the rendered manifest is always valid
YAML.
| - name: MEMBERSHIP_CLIENT_ID | ||
| value: "{{ .Values.global.platform.studio.oauth.client.id }}" | ||
| - name: MEMBERSHIP_CLIENT_SECRET | ||
| {{- if gt (len .Values.global.platform.studio.oauth.client.existingSecret) 0 }} |
There was a problem hiding this comment.
len on a potentially nil value will panic during template rendering.
If .Values.global.platform.studio.oauth.client.existingSecret is not defined (nil), len will error out. The studio.cookie (line 20) and studio.openai (line 51) templates safely use a simple truthiness check instead. Align for consistency and nil-safety.
Proposed fix
- {{- if gt (len .Values.global.platform.studio.oauth.client.existingSecret) 0 }}
+ {{- if .Values.global.platform.studio.oauth.client.existingSecret }}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| {{- if gt (len .Values.global.platform.studio.oauth.client.existingSecret) 0 }} | |
| {{- if .Values.global.platform.studio.oauth.client.existingSecret }} |
🤖 Prompt for AI Agents
In `@charts/studio/templates/_helpers.tpl` at line 38, The template uses len on
.Values.global.platform.studio.oauth.client.existingSecret which will panic if
that key is nil; change the condition to a nil-safe truthiness check (e.g., use
the value directly like "if
.Values.global.platform.studio.oauth.client.existingSecret") to match how
studio.cookie and studio.openai are handled, ensuring the helper does not call
len on a possibly undefined value and preserves the same logical behavior.
Summary
postgresql.enabled)Companion PR: https://github.com/formancehq/platform-ui/pull/968