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

Abierto
#60 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
csharp, postgresql
Área
databases

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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
Lenguaje dominante
C#
Estrellas
68
Forks
4
Merge medio
50 min
PR fusionados (30 d)
2

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Nimblesite/DataProvider

Todos los issues de Nimblesite/DataProvider

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.