Skip to content

feat(config): add db.migrations.checks severities and exclusions (CLI-2782, CLI-2783) - #7312

Merged
mdonnalley merged 4 commits into
nextfrom
mikedonnalley/cli-2782-1-dbmigrationschecks-config-schema-absent-warn
Oct 27, 2026
Merged

mdonnalley merged 4 commits into
nextfrom
mikedonnalley/cli-2782-1-dbmigrationschecks-config-schema-absent-warn

Conversation

@mdonnalley

Copy link
Copy Markdown

Summary

Adds a [db.migrations.checks] section to config.toml. Each of the nine migration security
rules gets a severity (error, warn or off), and [db.migrations.checks.exclude] lists
"schema.name" objects to skip per rule. Nothing reads the policy yet; the migration apply
path consumes it in a follow-up.

  • Unknown rule names, invalid severities and malformed exclusion entries fail config loading
    with path-scoped messages, including a "did you mean" suggestion for misspelled rules. This
    section is stricter than the rest of the config so an older CLI never ignores a rule a
    teammate set.
  • An absent section leaves every rule unset; the CLI resolver treats unset rules as warn.
  • The section is published in the CLI config JSON Schema. CliConfig gains
    db.migrations.checks; the new constants are exported from @supabase/config/internal only.

Linked issue

Closes CLI-2782
Closes CLI-2783
Part of CLI-2786
Part of CLI-2787

@mdonnalley
mdonnalley requested a review from a team as a code owner October 23, 2026 16:39
Comment thread packages/config/src/db-migration-checks.ts

@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

Verified all four findings from both completed reviews. Confirmed the Go configuration compatibility regression, silent acceptance of non-table exclusions, and a documentation nit. Whitespace acceptance is verified, but whether it violates the intended naming contract remains uncertain. No findings overlap.

Findings

Severity Location Category Sources Claim
🔴 CRITICAL packages/config/src/db.ts:154 compatibility claude Using the newly advertised db.migrations.checks section breaks Go-delegated commands that load project configuration, including db diff --use-pg-schema.
🟡 MINOR packages/config/src/db-migration-checks.ts:125 config-validation codex Non-table objects such as Date instances can be silently accepted as an empty exclusion table.
⚪ NIT packages/config/src/db-migration-checks.ts:50 validation claude The object-name pattern permits whitespace immediately before the separator, potentially allowing typoed exclusions such as public .countries.
⚪ NIT packages/config/src/db-migration-checks.ts:81 docs claude The published description's wording, "Runs against --db-url read this section from config.toml only," is awkward and could be clearer.

Stats

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


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.

Comment thread packages/config/src/db.ts
Comment thread packages/config/src/db-migration-checks.ts
Comment thread packages/config/src/db-migration-checks.ts Outdated
Comment thread packages/config/src/db-migration-checks.ts Outdated
Comment thread .github/workflows/cli-go-ci.yml Outdated
…-2782, CLI-2783)

Adds the [db.migrations.checks] table with per-rule severities and per-rule
exclusion lists. Rule names, severities and exclusion entries are validated with
path-scoped messages, and the section is published in the CLI config JSON Schema.
A CLI policy resolver defaults unset rules to warn.
Exclusion entries reject whitespace next to the schema separator, and the --db-url note
in the section description is reworded.
@mdonnalley
mdonnalley changed the base branch from develop to next October 26, 2026 17:50
@mdonnalley
mdonnalley force-pushed the mikedonnalley/cli-2782-1-dbmigrationschecks-config-schema-absent-warn branch from ef79030 to 46072c9 Compare October 26, 2026 17:51
@mdonnalley
mdonnalley enabled auto-merge October 26, 2026 18:45
@mdonnalley
mdonnalley added this pull request to the merge queue Oct 27, 2026
Merged via the queue into next with commit fdb0e1f Oct 27, 2026
40 checks passed
@mdonnalley
mdonnalley deleted the mikedonnalley/cli-2782-1-dbmigrationschecks-config-schema-absent-warn branch October 27, 2026 07:58
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.

2 participants