Add verbose logging and log-level selection to DataProviderMigrate CLI

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

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

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
30/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
csharp, postgresql

調査の方向性

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.

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

説明

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.

主要言語
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 を短くまとめたダイジェスト。