Skip to content

feat(schema): AS-706 helm values schema#397

Closed
afoley587 wants to merge 21 commits into
release/v2.9.0from
afoley/as-706-helm-values-schema
Closed

feat(schema): AS-706 helm values schema#397
afoley587 wants to merge 21 commits into
release/v2.9.0from
afoley/as-706-helm-values-schema

Conversation

@afoley587

@afoley587 afoley587 commented Jun 13, 2025

Copy link
Copy Markdown
Contributor

Rationale

Warning

This shouldn't be part of the 2.9.0 release. I just wanted to submit for feedback but can create a new branch or wait for a 2.10.0 branch to be cut.

A helm values schema allows us to validate/verify a user's values.yaml file entries before installing. It allows us to then display helpful messages about type mismatches / expected values / etc.

This, hopefully, makes installations easier for customers and allows us to provide a smoother experience.

Changes

  1. Adds a new pre-commit hook for helm-schema

  2. Adds a new makefile target for installing helm plugins

  3. Updates pre-commit workflow to install helm-schema for the new pre-commit hook

  4. Creates the new values.schema.json file with the following settings:

      - id: helm-schema
        args:
          - --chart-search-root=./helm/fiftyone-teams-app
          - --no-dependencies
          - --add-schema-reference
          - --skip-auto-generation=additionalProperties,required
          - --append-newline

Checklist

  • This PR maintains parity between Docker Compose and Helm

Testing

Test 1: Inserting a map where an array is expected

Using this test, we should throw an error because topologySpreadConstraints should be a list

apiSettings:
  topologySpreadConstraints:
      maxSkew: 
        topologyKey: 
        whenUnsatisfiable: 
        labelSelector:
          matchLabels:
            app.kubernetes.io/name: teams-api-foo
            app.kubernetes.io/instance: dev-fiftyone-ai

Running the below shows it does!

 % helm install --dry-run dev-fiftyone-ai ./helm/fiftyone-teams-app --values ../cloud-build-and-deploy/helm-configs/dev-values.yaml --namespace dev-fiftyone-ai
coalesce.go:301: warning: destination for fiftyone-teams-app.apiSettings.topologySpreadConstraints is a table. Ignoring non-table value ([])
Error: INSTALLATION FAILED: values don't meet the specifications of the schema(s) in the following chart(s):
fiftyone-teams-app:
- apiSettings.topologySpreadConstraints: Invalid type. Expected: array, given: object
Test 2: Inserting a string where an int is expected

Using this test, we should throw an error because replicaCount" should be an int`

apiSettings:
  replicaCount: "3"

Running the below shows it does!

 % helm install --dry-run dev-fiftyone-ai ./helm/fiftyone-teams-app --values ../cloud-build-and-deploy/helm-configs/dev-values.yaml --namespace dev-fiftyone-ai
Error: INSTALLATION FAILED: values don't meet the specifications of the schema(s) in the following chart(s):
fiftyone-teams-app:
- apiSettings.replicaCount: Invalid type. Expected: integer, given: string
Test 3: Making sure mixed types are working as expected

Using this test, we should throw an error because podDisruptionBudget.minAvailable" should be an intorstringornumber`

apiSettings:
  podDisruptionBudget:
    enabled: true
    minAvailable: 50%  # and 3 and 0.5

Running the below shows it does!

 % helm install --dry-run dev-fiftyone-ai ./helm/fiftyone-teams-app --values ../cloud-build-and-deploy/helm-configs/dev-values.yaml --namespace dev-fiftyone-ai
Test 4: Making sure additional keys are allowed

Using this test, we should not throw an error

casSettings:
  env:
    CAS_DATABASE_NAME: dev-cas
    CAS_DEFAULT_USER_ROLE: ADMIN
    FIFTYONE_APP_BANNER_COLOR: "orange"
    FIFTYONE_APP_BANNER_TEXT_COLOR: "purple"
    FIFTYONE_APP_BANNER_TEXT: "You are currently viewing the Dev Deployment"
    THIS_IS_SPARTA: yay <---- additional key, not in schema

Running the below shows it does!

 % helm install --dry-run dev-fiftyone-ai ./helm/fiftyone-teams-app --values ../cloud-build-and-deploy/helm-configs/dev-values.yaml --namespace dev-fiftyone-ai

@afoley587 afoley587 requested a review from a team as a code owner June 13, 2025 16:28
@afoley587 afoley587 marked this pull request as draft June 13, 2025 16:29
Comment thread .markdownlint.yaml Outdated
@afoley587 afoley587 changed the title [WIP] feat(schema): AS-706 helm values schema feat(schema): AS-706 helm values schema Jun 16, 2025
@findtopher findtopher deleted the branch release/v2.9.0 June 24, 2025 17:17
@findtopher findtopher closed this Jun 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants