Add verbose logging and log-level selection to DataProviderMigrate CLI

Abierto
#54 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
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
30/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
csharp, postgresql

Línea de trabajo

Start by locating the DataProviderMigrate migrate command, its help output, and the existing logging setup. Trace where schema loading, inspection, diffing, filtering, and application occur. Done means explicit log-level controls expose the requested diagnostics while connection strings and credentials remain redacted.

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

Descripción

Problem

When DataProviderMigrate reports an unexpected result, there is currently no CLI-supported way to see what it inspected, diffed, filtered, or applied.

The current help output exposes these migrate options only:

--schema
--output
--provider
--allow-destructive
--phase

There is no --verbose, --log-level, --debug, or equivalent option.

Setting common .NET logging environment variables such as Logging__LogLevel__Default=Trace did not produce additional diagnostics. The CLI still printed only the normal summary.

Required behavior

Add explicit logging controls to the migration CLI, for example:

DataProviderMigrate migrate \
  --schema migrations/schema.yaml \
  --output "$PG_URL" \
  --provider postgres \
  --log-level trace

or:

--verbose
--quiet

Logging should expose

At debug/trace level, the CLI should print enough information to diagnose schema drift and diff bugs without attaching a debugger:

  • which schema file was loaded and parsed
  • all tables discovered in YAML
  • live database objects inspected per table
  • desired vs actual object summaries
  • generated diff operations before phase/destructive filtering
  • operations removed by --phase
  • operations removed because --allow-destructive is absent
  • SQL or operation descriptions that will be applied, with secrets redacted
  • post-apply verification results once that verification exists

Security requirement

Connection strings and credentials must be redacted in logs by default. It is fine to show host/database/user, but passwords and tokens must never be printed in full.

Why this matters

During a production migration incident, the tool reported Schema is up to date even though a declared unique constraint was missing from PostgreSQL. Without verbose logging, there was no way to tell whether the YAML parser ignored the uniqueConstraints block, the inspector missed live constraints, the diff skipped unique constraints, or operation application failed.

Operators need first-class CLI diagnostics to understand what the migrator is doing.

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.