0.9.11-beta: SchemaIntegrityVerifier false positives on Schema/AllTablesInSchema grants + text column ::text default
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
調査の方向性
Start at SchemaIntegrityVerifier and its InspectSchemaGrants entry point, using the documented dotnet DataProviderMigrate command and PostgreSQL queries to reproduce both false positives. Review scripts/migrate_schema.py for the current workaround. Done means Schema and AllTablesInSchema grants are recognised, text defaults compare consistently, and repeated migrations converge without integrity failures.
索引モデルが issue の本文から書いたものです。
説明
Repro
YAML schema with:
grants:
- schema: public
target: Schema
privileges: [USAGE]
roles: [app_user, app_admin]
- schema: public
target: AllTablesInSchema
privileges: [SELECT, INSERT, UPDATE, DELETE]
roles: [app_user, app_admin]
Run dotnet DataProviderMigrate --schema schema.yaml --output "<postgres-dsn>" --provider postgres.
Expected
Migration converges. SchemaIntegrityVerifier reports clean.
Actual
Migration completed successfully
SCHEMA INTEGRITY CHECK FAILED
grant Schema public: missing grant
grant AllTablesInSchema public: missing grant
Exit code 1. Re-running is non-converging — the verifier reports the same missing grants on every run.
Verification that the grants are actually applied
-- Schema USAGE: explicit grant present in nspacl
SELECT nspname, nspacl FROM pg_namespace WHERE nspname='public';
-- public | {... app_user=U/pg_database_owner, app_admin=U/pg_database_owner}
-- has_schema_privilege() returns true
SELECT has_schema_privilege('app_user', 'public', 'USAGE'); -- t
SELECT has_schema_privilege('app_admin', 'public', 'USAGE'); -- t
-- Table grants: every public table shows arwd in relacl for both roles
SELECT relname, relacl
FROM pg_class
WHERE relnamespace='public'::regnamespace AND relkind='r' LIMIT 1;
-- users | {... app_user=arwd/postgres, app_admin=arwd/postgres}
So the migrate step applies the grants correctly. The verifier's InspectSchemaGrants simply doesn't recognise the applied state.
Side issue (also new in 0.9.11): text column defaults
defaultValue: "'generating'" in YAML round-trips to 'generating'::text in information_schema.columns.column_default (Postgres normalises text literals). The verifier reports:
public.sites.status: default expected 'generating' but found 'generating'::text
Workaround: spell the YAML as defaultValue: "'generating'::text". The verifier should ideally strip the ::text cast (or apply the same normalisation to both sides) before comparing.
Environment
- DataProviderMigrate 0.9.11-beta
- Postgres 16 (Supabase docker stack)
- Same YAML migrates cleanly under 0.9.10-beta (the verifier step appears to be new in 0.9.11).
Workaround we're shipping
Until this lands we invoke dotnet DataProviderMigrate via a Python wrapper that swallows exactly the two known false-positive lines after asserting Migration completed successfully is in stdout — see scripts/migrate_schema.py. Happy to delete the wrapper once the verifier is fixed.
- 主要言語
- C#
- スター
- 68
- フォーク
- 4
- 平均マージ
- 50分
- マージ済み PR(30日)
- 2
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Nimblesite/DataProvider のほかの issue
-
難易度 1/5 1〜3時間 初心者へのやさしさ 92/100
Nimblesite/DataProvider#137 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
Nimblesite/DataProvider#72 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
Nimblesite/DataProvider#121 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
Nimblesite/DataProvider#108 ·
メンテナーはふだん 1 日以内に返信
-
A check constraint the schema cannot name can never be retired, and keeps enforcing the old ruleオープン
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
Nimblesite/DataProvider#107 ·
メンテナーはふだん 1 日以内に返信
Nimblesite/DataProvider の issue をすべて見る
似ている issue
-
kronos:develop:queued priority:P0
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
nopSolutions/nopCommerce#8512 ·
メンテナーはふだん 4 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
modelcontextprotocol/csharp-sdk#2061 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信