Files
twenty/packages/twenty-docker/helm/twenty/values.schema.json
T
Charles Bochet e95adcc757 fix(helm): add unit tests, extraEnv schema validation, and minor fixes (#18836)
## Summary

Follow-up to #18157. Cherry-picks the useful parts from #18481 (by
@dnplkndll), adapted to align with the current state of `main`:

- **Helm unit tests** for Redis external authentication (secret-based +
plaintext password, both server and worker)
- **Helm unit tests** for `extraEnv` injection (plain values and
`valueFrom` on both server and worker)
- **JSON schema validation** for `server.extraEnv` and `worker.extraEnv`
in `values.schema.json`
- **Fix** `server_url_test.yaml` to use JSONPath filters
(`@.name=="SERVER_URL"`) instead of brittle `env[0]` index selectors
- **Fix** worker `storageEnv` whitespace (missing `-` in `{{-
$storageEnv | nindent 12 }}`)

Stale tests from #18481 (for `disableDbMigrations`, `server.env`
pass-through, and `run-migrations` init container) were dropped since
those features were removed during the #18157 cleanup.

## Test plan

- [ ] `helm lint` passes
- [ ] `helm template` renders cleanly
- [ ] Unit tests pass with `helm unittest` (requires the plugin)


Made with [Cursor](https://cursor.com)
2026-03-22 21:45:31 +01:00

215 lines
7.3 KiB
JSON

{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Twenty Helm Chart Values",
"type": "object",
"additionalProperties": true,
"properties": {
"image": {
"type": "object",
"properties": {
"repository": { "type": "string" },
"tag": { "type": "string" },
"pullPolicy": { "type": "string", "enum": ["Always", "IfNotPresent", "Never"] }
}
},
"nameOverride": { "type": "string" },
"fullnameOverride": { "type": "string" },
"namespaceOverride": { "type": "string" },
"secrets": {
"type": "object",
"properties": {
"tokens": {
"type": "object",
"properties": {
"create": { "type": "boolean" },
"name": { "type": "string" },
"accessToken": { "type": "string" }
},
"required": ["create", "name"]
}
}
},
"server": {
"type": "object",
"properties": {
"enabled": { "type": "boolean" },
"replicaCount": {
"type": "integer",
"minimum": 1,
"description": "Number of server replicas. When using local storage with ReadWriteOnce (RWO) PersistentVolumeClaims (the default), multiple replicas cannot share the same PVC and pods will fail to schedule if replicaCount > 1. Use replicaCount = 1 for local/RWO storage, or configure a shared storage backend such as S3 before increasing this value."
},
"podSecurityContext": { "type": "object" },
"containerSecurityContext": { "type": "object" },
"env": {
"type": "object",
"properties": {
"SERVER_URL": { "type": "string", "description": "Override for the server URL (e.g., https://crm.example.com). If not set, derived from ingress or service." },
"NODE_PORT": { "type": "integer", "minimum": 1 },
"PG_DATABASE_URL": { "type": "string" },
"REDIS_URL": { "type": "string" },
"SIGN_IN_PREFILLED": { "type": "string" },
"STORAGE_TYPE": { "type": "string" },
"ACCESS_TOKEN_EXPIRES_IN": { "type": "string" },
"LOGIN_TOKEN_EXPIRES_IN": { "type": "string" },
"EMAIL_DRIVER": { "type": "string" },
"EMAIL_SMTP_HOST": { "type": "string" },
"EMAIL_SMTP_PORT": { "type": "integer" },
"EMAIL_SMTP_USER": { "type": "string" },
"EMAIL_SMTP_PASSWORD": { "type": "string" },
"EMAIL_SMTP_NO_TLS": { "type": "boolean" },
"EMAIL_FROM_ADDRESS": { "type": "string" },
"EMAIL_FROM_NAME": { "type": "string" },
"IS_EMAIL_VERIFICATION_REQUIRED": { "type": "boolean" },
"EMAIL_VERIFICATION_TOKEN_EXPIRES_IN": { "type": "string" },
"PASSWORD_RESET_TOKEN_EXPIRES_IN": { "type": "string" }
}
},
"extraEnv": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": { "type": "string" },
"value": { "type": "string" },
"valueFrom": { "type": "object" }
},
"required": ["name"],
"oneOf": [
{ "required": ["value"] },
{ "required": ["valueFrom"] }
]
}
},
"service": {
"type": "object",
"properties": {
"type": { "type": "string", "enum": ["ClusterIP", "NodePort", "LoadBalancer"] },
"port": { "type": "integer", "minimum": 1 },
"sessionAffinity": { "type": "string", "enum": ["None", "ClientIP"] },
"sessionAffinityTimeoutSeconds": { "type": "integer", "minimum": 1 }
}
},
"ingress": {
"type": "object",
"properties": {
"enabled": { "type": "boolean" },
"className": { "type": "string" },
"acme": { "type": "boolean" },
"hosts": {
"type": "array",
"items": {
"type": "object",
"properties": {
"host": { "type": "string" },
"paths": {
"type": "array",
"items": {
"type": "object",
"properties": {
"path": { "type": "string" },
"pathType": { "type": "string", "enum": ["Prefix", "Exact", "ImplementationSpecific"] }
}
}
}
}
}
},
"tls": { "type": "array" }
}
},
"persistence": {
"type": "object",
"properties": {
"enabled": { "type": "boolean" },
"existingClaim": { "type": "string" },
"storageClass": { "type": "string" },
"accessModes": { "type": "array", "items": { "type": "string" } },
"size": { "type": "string" }
}
},
"dockerDataPersistence": {
"type": "object",
"properties": {
"enabled": { "type": "boolean" },
"existingClaim": { "type": "string" },
"storageClass": { "type": "string" },
"accessModes": { "type": "array", "items": { "type": "string" } },
"size": { "type": "string" }
}
}
}
},
"worker": {
"type": "object",
"properties": {
"enabled": { "type": "boolean" },
"replicaCount": { "type": "integer", "minimum": 1 },
"podSecurityContext": { "type": "object" },
"containerSecurityContext": { "type": "object" },
"env": {
"type": "object",
"properties": {
"PG_DATABASE_URL": { "type": "string" },
"REDIS_URL": { "type": "string" },
"STORAGE_TYPE": { "type": "string" },
"DISABLE_DB_MIGRATIONS": { "type": "string" }
}
},
"extraEnv": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": { "type": "string" },
"value": { "type": "string" },
"valueFrom": { "type": "object" }
},
"required": ["name"],
"oneOf": [
{ "required": ["value"] },
{ "required": ["valueFrom"] }
]
}
}
}
},
"storage": {
"type": "object",
"properties": {
"type": { "type": "string", "enum": ["local", "s3"] },
"s3": {
"type": "object",
"properties": {
"bucket": { "type": "string" },
"region": { "type": "string" },
"endpoint": { "type": "string" },
"accessKeyId": { "type": "string" },
"secretAccessKey": { "type": "string" },
"secretName": { "type": "string" },
"accessKeyIdKey": { "type": "string" },
"secretAccessKeyKey": { "type": "string" }
}
}
},
"required": ["type"],
"allOf": [
{
"if": { "properties": { "type": { "const": "s3" } }, "required": ["type"] },
"then": {
"required": ["s3"],
"properties": {
"s3": {
"required": ["bucket", "region", "accessKeyId", "secretAccessKey"]
}
}
}
}
]
}
}
}