Add verbose logging and log-level selection to DataProviderMigrate CLI

未关闭
#54 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
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 分钟
30 天内合并 PR
2

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Nimblesite/DataProvider 的其他 Issue

查看 Nimblesite/DataProvider 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。