Add verbose logging and log-level selection to DataProviderMigrate CLI

Aperta
#54 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
30/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
csharp, postgresql

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
C#
Stelle
68
Fork
4
Merge medio
50m
PR unite (30g)
2

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Nimblesite/DataProvider

Tutte le issue di Nimblesite/DataProvider

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.