Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/plane-enterprise/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Meet Plane. An Enterprise software development tool to manage issue

type: application

version: 3.0.0
version: 3.0.1
appVersion: "3.0.0"

home: https://plane.so/
Expand Down
8 changes: 8 additions & 0 deletions charts/plane-enterprise/questions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -970,6 +970,14 @@ questions:
label: "CORS Allowed Origins"
type: string
default: ""
- variable: env.pi_envs.ai_usage_agent_max_tokens_budget
label: "AI Usage Agent Max Tokens Budget"
type: string
default: ""
- variable: env.pi_envs.ai_usage_enforcement_enabled
label: "AI Usage Enforcement Enabled"
type: boolean
default: true
- variable: env.pi_envs.celery.vector_sync_enabled
label: "Vector Sync Enabled"
type: boolean
Expand Down
2 changes: 2 additions & 0 deletions charts/plane-enterprise/templates/config-secrets/app-env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,5 @@ data:

WEBHOOK_ALLOWED_IPS: {{ .Values.env.webhook_allowed_ips | default "" | quote }}
WEBHOOK_ALLOWED_HOSTS: {{ .Values.env.webhook_allowed_hosts | default "" | quote }}
IS_SELF_MANAGED: "0"
AI_USAGE_AGENT_MAX_TOKENS_BUDGET: {{ .Values.env.pi_envs.ai_usage_agent_max_tokens_budget | default "" | quote }}
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ data:
BR_AWS_REGION: {{ .Values.services.pi.ai_providers.embedding_model.aws_region | default "us-east-1" | quote }}
{{- end }}

IS_SELF_MANAGED: "0"
AI_USAGE_AGENT_MAX_TOKENS_BUDGET: {{ .Values.env.pi_envs.ai_usage_agent_max_tokens_budget | default "" | quote }}
AI_USAGE_ENFORCEMENT_ENABLED: {{ .Values.env.pi_envs.ai_usage_enforcement_enabled | default true | ternary "1" "0" | quote }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

helm template test charts/plane-enterprise \
  --set services.pi.enabled=true \
  --set env.pi_envs.ai_usage_enforcement_enabled=false |
  rg 'AI_USAGE_ENFORCEMENT_ENABLED'
# Expected: AI_USAGE_ENFORCEMENT_ENABLED: "0"

Repository: makeplane/helm-charts

Length of output: 197


🏁 Script executed:

#!/bin/bash
set -eu

printf 'Files matching config-secrets/pi-api-env.yaml:\n'
fd -a 'pi-api-env.yaml' . || true

printf '\nRelevant lines in file:\n'
if [ -f charts/plane-enterprise/templates/config-secrets/pi-api-env.yaml ]; then
  nl -ba charts/plane-enterprise/templates/config-secrets/pi-api-api-env.yaml 2>/dev/null || true
  nl -ba charts/plane-enterprise/templates/config-secrets/pi-api-env.yaml | sed -n '150,170p'
fi

printf '\nSearch for ai_usage_enforcement_enabled in repo:\n'
rg -n "ai_usage_enforcement_enabled|AI_USAGE_ENFORCEMENT_ENABLED" .

Repository: makeplane/helm-charts

Length of output: 781


🌐 Web query:

Helm func default treats false as nil documentation

💡 Result:

The Helm default function, which is provided by the Sprig library, treats the boolean value false as "empty" [1][2]. Consequently, if you use default with a boolean value, it will replace an explicit false with the provided default value [3][4]. According to the official documentation, the definition of "empty" for the default function depends on the data type [1][5]: - Numeric: 0 - String: "" - Lists: [] - Dicts: {} - Boolean: false - Nil (null) Because false is classified as empty, {{ default true .Values.enabled }} will return true even if .Values.enabled is explicitly set to false [3][4]. To work around this behavior when you need to distinguish between a missing value and an explicit false, you can use one of the following approaches [6][4]: 1. Use the hasKey function to check if the value was explicitly provided in the values file [6][4]: {{- if hasKey.Values "enabled" }} enabled: {{.Values.enabled }} {{- else }} enabled: true {{- end }} 2. Use the kindIs function to check the type of the value [6]: {{- if kindIs "bool".Values.enabled }} enabled: {{.Values.enabled }} {{- else }} enabled: true {{- end }} 3. Use the ternary function in combination with hasKey [4]: enabled: {{ hasKey.Values "enabled" | ternary.Values.enabled true }}

Citations:


🏁 Script executed:

#!/bin/bash
set -eu

echo "Relevant rendering line:"
awk 'NR>=150 && NR<=170 { printf "%6d%s\n", NR, $0 }' charts/plane-enterprise/templates/config-secrets/pi-api-env.yaml

echo
echo "Values default:"
awk 'NR>=676 && NR<=684 { printf "%6d%s\n", NR, $0 }' charts/plane-enterprise/values.yaml

Repository: makeplane/helm-charts

Length of output: 2229


🌐 Web query:

Helm sprig default false bool is empty ternary default true ternary

💡 Result:

The ternary function in Helm (provided by the Sprig library) is used to select between two values based on a boolean condition [1][2]. Its syntax is ternary "value_if_true" "value_if_false" condition [3][4]. Regarding your specific scenario where you want to default a boolean to true but correctly handle an explicit false value, the default function is often unsuitable because it treats false as "empty" (falsy) and will incorrectly replace it with your default value [5][6][7]. To handle this, you can use a combination of hasKey and ternary to check if the value was explicitly set [8][7]. Recommended pattern: {{ hasKey.Values "yourKey" | ternary.Values.yourKey true }} In this example: 1. hasKey .Values "yourKey" checks if the key exists in your values (even if it is false) [8][7]. 2. If it exists, ternary returns the actual value (.Values.yourKey, which may be true or false) [7]. 3. If it does not exist, ternary returns the second argument, which is your desired default (true) [7]. This approach avoids the "falsy" trap of the default function, which interprets false as a missing value [6][7].

Citations:


Preserve -f for this boolean flag.

default treats false as empty, so --set env.pi_envs.ai_usage_enforcement_enabled=false renders AI_USAGE_ENFORCEMENT_ENABLED: "1". Use a hasKey + ternary fallback so chart defaults apply only when the value is unset.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@charts/plane-enterprise/templates/config-secrets/pi-api-env.yaml` at line
162, Update the AI_USAGE_ENFORCEMENT_ENABLED template expression to distinguish
an explicitly configured false value from an unset value. Use hasKey to select
the configured env.pi_envs.ai_usage_enforcement_enabled value, and apply the
chart default only when that key is absent, while preserving the existing
ternary conversion and quoting.


CELERY_VECTOR_SYNC_ENABLED: {{ .Values.env.pi_envs.celery.vector_sync_enabled | ternary "1" "0" | quote }}
CELERY_VECTOR_SYNC_INTERVAL: {{ .Values.env.pi_envs.celery.vector_sync_interval | default 3 | quote }}
CELERY_WORKSPACE_PLAN_SYNC_ENABLED: {{ .Values.env.pi_envs.celery.workspace_plan_sync_enabled | ternary "1" "0" | quote }}
Expand Down
3 changes: 3 additions & 0 deletions charts/plane-enterprise/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,9 @@ env:
internal_secret: 'tyfvfqvBJAgpm9bzvf3r4urJer0Ehfdubk'
log_level: 'DEBUG'

ai_usage_agent_max_tokens_budget: ''
ai_usage_enforcement_enabled: true

celery:
vector_sync_enabled: false
vector_sync_interval: 3
Expand Down