Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 14, 2025

Adds test coverage for the validation logic that determines when the implicit "public" schema must be declared in the schemas config array.

Changes

  • Add test case verifying validation passes when all models/enums have explicit @@schema attributes and schemas array excludes "public"
  • Complements existing test that validates "public" is required when models/enums lack explicit schema attributes

Example

// This should NOT require "public" in schemas array
datasource db {
    provider = 'postgresql'
    schemas = ['mySchema']  // "public" not needed
}

enum Role {
    ADMIN
    USER
    @@schema('mySchema')  // explicit schema
}

model Foo {
    id Int @id
    role Role
    @@schema('mySchema')  // explicit schema
}

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI self-assigned this Dec 14, 2025
@coderabbitai
Copy link

coderabbitai bot commented Dec 14, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

@ymc9
Copy link
Member

ymc9 commented Dec 14, 2025

@copilot are you still working on it?

@ymc9 ymc9 marked this pull request as ready for review December 14, 2025 06:44
@ymc9
Copy link
Member

ymc9 commented Dec 14, 2025

@copilot is your change ready to merge?

Copy link
Contributor Author

Copilot AI commented Dec 14, 2025

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • checkpoint.prisma.io
    • Triggering command: /usr/local/bin/node /usr/local/bin/node /home/REDACTED/work/zenstack-v3/zenstack-v3/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/prisma/build/child {"product":"prisma","version":"6.19.0","cli_install_type":"local","information":"","local_timestamp":"2025-12-14T06:43:21Z","project_hash":"fae40a46","cli_path":"/tmp/tmp-5700-OIV8rqkFMKVp/node_modules/prisma/build/index.js","cli_path_hash":"064c4371","en node ypes�� (dns block)
    • Triggering command: /usr/local/bin/node /usr/local/bin/node /home/REDACTED/work/zenstack-v3/zenstack-v3/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/prisma/build/child {"product":"prisma","version":"6.19.0","cli_install_type":"local","information":"","local_timestamp":"2025-12-14T06:43:25Z","project_hash":"24656cf8","cli_path":"/tmp/tmp-5700-OLGFPg017IeF/node_modules/prisma/build/index.js","cli_path_hash":"5e7870af","en sh _mod�� tsup-node (dns block)
    • Triggering command: /usr/local/bin/node /usr/local/bin/node /home/REDACTED/work/zenstack-v3/zenstack-v3/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/prisma/build/child {"product":"prisma","version":"6.19.0","cli_install_type":"local","information":"","local_timestamp":"2025-12-14T06:43:27Z","project_hash":"90e8e369","cli_path":"/tmp/tmp-5700-aOTgu3Z5zqq6/node_modules/prisma/build/index.js","cli_path_hash":"150aa045","en node k/ze�� typecheck build tools/pnpm/10.23.0/bin/node (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Update schemas config to require public schema declaration test: verify "public" schema not required when all models have explicit @@schema Dec 14, 2025
Copilot AI requested a review from ymc9 December 14, 2025 06:47
Copy link
Contributor Author

Copilot AI commented Dec 14, 2025

@copilot is your change ready to merge?

Yes, the changes are ready to merge. The test case has been added and validated (commit 57b7d6c). Code review and security checks passed with no issues.

@copilot are you still working on it?

The work is complete. I've added the requested test case in commit 57b7d6c that verifies validation passes when all models and enums have explicit @@schema attributes and the schemas array excludes "public".

@ymc9 ymc9 merged commit 5667acd into fix/pg-multi-schema-implicit-public Dec 14, 2025
2 of 3 checks passed
@ymc9 ymc9 deleted the copilot/sub-pr-492 branch December 14, 2025 06:48
ymc9 added a commit that referenced this pull request Dec 14, 2025
…n "schemas" config (#492)

* fix(zmodel): require implicitly used "public" schema to be declared in "schemas" config

* Update packages/language/src/validators/datasource-validator.ts

Co-authored-by: Copilot <[email protected]>

* test: verify "public" schema not required when all models have explicit @@Schema (#496)

* Initial plan

* Add test for explicit schema usage without public

Co-authored-by: ymc9 <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: ymc9 <[email protected]>

---------

Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
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