v0.9.11-beta: post-migration integrity check false negatives on Text defaults (::text echo) and pre-existing public-schema grants

オープン
#60 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
csharp, postgresql
領域
databases

調査の方向性

Start by running the reported DataProviderMigrate command against supabase/postgres:15.8.1.060 and inspect the schema integrity check for default comparisons and grant probing. Done means the check accepts PostgreSQL's implicit ::text default casts and recognizes the declared public Schema and AllTablesInSchema grants without false negatives.

索引モデルが issue の本文から書いたものです。

説明

Repro

  • Run DataProviderMigrate migrate --schema migrations/schema.yaml --provider postgres --allow-destructive --output <DSN> --allow-destructive against a fresh Postgres (supabase/postgres:15.8.1.060) with NAP's migrations/schema.yaml.
  • Migration applies successfully ("Migration completed successfully").
  • Then SCHEMA INTEGRITY CHECK FAILED with:
public.tenant_credit_event.note: default expected '' but found ''::text
public.api_keys.label: default expected '' but found ''::text
public.agent_configs.system_prompt: default expected '' but found ''::text
public.agent_configs.agent_type: default expected 'disembodied' but found 'disembodied'::text
public.agent_configs.base_agent: default expected 'pydantic-ai' but found 'pydantic-ai'::text
public.agent_logs.level: default expected 'info' but found 'info'::text
public.tool_calls.status: default expected 'pending' but found 'pending'::text
grant Schema public: missing grant
grant AllTablesInSchema public: missing grant

Analysis

Two distinct regressions vs 0.9.10-beta:

  1. Text default cast normalization. Postgres echoes 'pending' as 'pending'::text in pg_attrdef / information_schema.columns.column_default. The integrity check is comparing the raw YAML literal ('pending') against Postgres's echoed form ('pending'::text) without normalizing the implicit cast. Either side should be normalized before the equality check.

  2. Schema / AllTablesInSchema grants false negative. schema.yaml declares:

    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]
    

    These grants ARE applied to the DB (verified via \dn+ and \dp), but the integrity check reports them missing. The probe likely doesn't pick up AllTablesInSchema grants when they were applied via per-table GRANTs, or doesn't pick up the schema-level USAGE grant.

Impact

NAP CI is blocked. Pinning back to 0.9.10-beta (which has no integrity check on these dimensions) until this is resolved.

Environment

  • DP version: 0.9.11-beta
  • Postgres: supabase/postgres:15.8.1.060
主要言語
C#
スター
68
フォーク
4
平均マージ
50分
マージ済み PR(30日)
2

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Nimblesite/DataProvider のほかの issue

Nimblesite/DataProvider の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。