Skip to content

feat(config): accept env() on number, boolean, enum and list fields in the config schema - #7333

Open
Coly010 wants to merge 3 commits into
developfrom
columferry/cli-2857-accept-env-references-on-number-and-boolean-fields-in-the
Open

Coly010 wants to merge 3 commits into
developfrom
columferry/cli-2857-accept-env-references-on-number-and-boolean-fields-in-the

Conversation

@Coly010

@Coly010 Coly010 commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The config loader resolves env(VAR) on any field and then coerces it to the field's type, but the published config.schema.json typed number, integer, boolean, enum and string-list fields strictly. So max_rows = "env(MAX_ROWS)" loads fine but shows as an error in the editor.

Those fields now accept either their usual value or a string matching the loader's env() syntax. A mistyped literal like max_rows = "1000" or pool_mode = "statement" still fails.

  • toPublishedJsonSchemaDocument takes an acceptEnvReferences option, and the CLI config schema turns it on. Each affected field becomes an anyOf of its original type and an env() string, with description, default and examples kept on the outer node so hover docs look the same
  • String lists such as auth.additional_redirect_urls accept an env() string in place of the whole list, since the CLI splits the resolved value on commas. Lists of enums don't, as the loader doesn't split those
  • Fields that are already a union (e.g. storage.file_size_limit) get one extra env() branch rather than a nested one
  • project-config.schema.json doesn't change, since it describes values after env() has been resolved
  • apps/docs/public/cli/config.schema.json is regenerated
  • ajv is added as a dev dependency of @supabase/config so tests can check the published schema against what the loader accepts

Schema shape change

Affected fields no longer carry a top-level type. It moves into the first anyOf branch, next to the env() branch. Any document that validated before still validates, but tools that read the schema's types directly (type generators, for example) will now see a union on those fields.

Linked issue

Closes CLI-2857

…lds in the config schema

The loader resolves env(VAR) on any field and coerces it to the field's
type, but the published CLI config schema typed number, integer, boolean
and enum fields strictly, so env() references there showed as editor
errors. Those fields now accept their usual value or an env() string
matching the loader's syntax. The project-config schema is unchanged,
since it describes resolved values.

Closes CLI-2857
@Coly010
Coly010 requested review from a team and supabase-oss as code owners October 26, 2026 15:32
@Coly010 Coly010 self-assigned this Oct 26, 2026

@github-actions github-actions Bot left a comment

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.

🤖 AI Review

Both independent reviews completed with no findings. My code inspection found no additional actionable issues. All 366 targeted leaves have an env() branch, and removing those branches exactly restores the trusted generated schema. Loader compatibility and unchanged ProjectConfig behavior were verified by inspection. Tests were not run because dependencies are absent.

Findings

No issues found.

Stats

Claude findings: 0 · Codex findings: 0 · Confirmed: 0 · Refuted: 0 · Uncertain: 0


Models: claude-opus-5-5 + gpt-6.1-sol · Trigger: auto · Workflow run

This review runs once per PR. A maintainer can request another with a /ai-review comment.

…nst the loader

String-list fields such as auth.additional_redirect_urls now accept an
env() reference in place of the whole list, matching the loader's
comma-split coercion.

The copied-rule test is replaced by an agreement test that, for every
leaf in the CLI schema, checks the published schema accepts env() exactly
when the loader resolves it. Unused keyword entries are dropped.
@Coly010 Coly010 changed the title feat(config): accept env() references on number, boolean and enum fields in the config schema feat(config): accept env() on number, boolean, enum and list fields in the config schema Oct 26, 2026
@avallete
avallete self-requested a review October 27, 2026 08:20

This branch has not been deployed

No deployments
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.

1 participant