Repository navigation
Conversation
A `--schema` run excluded every change whose object is not in a selected schema, so an event trigger was always left out without a word. Keep an event trigger when its function is in a selected schema, and warn about added or changed objects that belong to no schema and were filtered out. Closes supabase#7903 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
db schema declarative sync -s <schemas>(anddb diff -s) never planned event triggers, and printed nothing about it. The schema-scope policy inpgDeltaNextProfileexcludes every change whose object is not in a selected schema, and an event trigger belongs to no schema.This follows the design suggested in the issue:
{ all: [{ kind: "eventTrigger" }, { edgeTo: { kind: "function", schema: selected } }] }). The Supabase profile's own rules still run after it, so the platformissue_*,pgrst_*andgraphql_watch_*event triggers stay excluded.plan.filteredDeltasand reports it as aschema_scope_excludedwarning, and the CLI prints one line naming those objects with a hint to run without--schema. Removals are not reported, since leaving unselected objects alone is the point of a scoped run. The warning is not a coverage code, so--strict-coveragedoes not block on it.One limitation: a comment on a kept event trigger is still filtered, because the comment fact has no edge to the function. It is now named in the warning rather than dropped silently. Keeping it would need a parent-chain form of
edgeToin pg-delta's policy DSL.A community member offered to take this issue earlier today and had not opened a branch yet; happy to close this in favor of their work if that is preferred.
Linked issue
Closes #7903
open-for-contributionlabel (or I'm a Supabase maintainer).Checklist
fix(cli): …).pnpm check:allpasses; relevant package tests pass for every touched workspace, andpnpm types:checkpasses for each touched TypeScript workspace (or workspace declaring it).The last box is unchecked only because
jactionlintis not installed locally, solint:actions:checkcould not run; this PR touches no workflow files, and the othercheck:alltasks and the CLI unit suite pass.🤖 Generated with Claude Code