refactor: data sync 三分支汇总格式统一 (SyncStats)#6429
Merged
Merged
Conversation
4 tasks
Owner
Author
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. Verified(#6054:抽取 SyncStats 三态计数器 + 统一汇总格式,day/tick/adjustfactor 三分支共用):
GinkGO/src/ginkgo/client/data_cli.py Lines 757 to 802 in 975c41e
观察附注(非 PR 缺陷,预存功能缺口):tick 分支无 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
抽取 SyncStats 三态计数器(success/skipped/errors)+ 统一汇总格式,
day/tick/adjustfactor 三分支共用,消除格式漂移。
- day 分支已有 skipped_count,tick/adjustfactor 仅二态 → 统一三态
- adjustfactor records_added=0 的 no-data 情况原仅 warn 不计数,
现计 skipped(对齐 day 分支语义)
- summary 格式统一: {Type} sync completed. Success: N, Skipped: S, Errors: M
Co-Authored-By: Claude <noreply@anthropic.com>
975c41e to
5b57d2b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
推进 #6054(data sync 三分支汇总格式不统一 refactor)。
问题
data_cli.sync的 day/tick/adjustfactor 三分支各自维护success_count/error_count(day 另有skipped_count),汇总字符串独立拼接,导致:Skipped计数时,tick/adjustfactor 未同步(仍二态)records_added=0(no-data)分支只 warn 不计数,day 同情况计 skipped修复
抽取 SyncStats 三态计数器(
success/skipped/errors)+ 统一summary()格式,三分支共用:record_success()/record_skipped()/record_error()累加summary(type_name)统一输出:{Type} sync completed. Success: N, Skipped: S, Errors: M未来加第 4 态只改 SyncStats 一处,杜绝漂移。
变更
src/ginkgo/client/data_cli.py:新增SyncStats类 + day/tick/adjustfactor 三分支接线tests/unit/client/test_data_cli_syncstats.py:3 测试覆盖三态计数 + 格式Test plan
三层冒烟(对齐
.github/workflows/ci.yml#6015)全绿:Closes #6054
🤖 Generated with Claude Code