fix(data): preserve historical metadata integrity#194
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
💤 Files with no reviewable changes (2)
📝 WalkthroughWalkthrough本次变更收紧组件快照回填规则:major 快照仅补充缺失的英文或中文描述,不再回填 props 或子组件 props;组件解析先浅拷贝缓存对象,并新增相应测试与数据层规范说明。 Changes组件快照解析与回填
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Caller
participant resolveComponent
participant ComponentStore
participant ComponentDoc
participant MajorSnapshot
Caller->>resolveComponent: 请求解析组件
resolveComponent->>ComponentStore: 查找缓存组件
ComponentStore-->>resolveComponent: 返回 storedComp
resolveComponent->>resolveComponent: 创建浅拷贝 comp
resolveComponent->>ComponentDoc: 解析组件文档 API
ComponentDoc-->>resolveComponent: 返回组件描述与 props
resolveComponent->>MajorSnapshot: 描述缺失时读取描述
MajorSnapshot-->>resolveComponent: 返回描述字段
resolveComponent-->>Caller: 返回解析后的组件
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
📦 Package Size Report
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #194 +/- ##
==========================================
- Coverage 99.69% 99.69% -0.01%
==========================================
Files 40 40
Lines 2603 2598 -5
Branches 803 803
==========================================
- Hits 2595 2590 -5
Misses 8 8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Code Review
This pull request refactors the metadata loading and changelog generation logic. Key changes include limiting the metadata cache to 32 entries with an eviction policy, removing major-version API data backfilling (restricting backfills to descriptions), updating semver comparison to correctly handle prerelease identifiers, and removing speculative rename guessing for removed properties. The reviewer feedback highlights three main improvement opportunities: cleaning up dead code (replacement property and printing logic) left over from removing speculative renames, replacing the while loop with an if statement in the cache eviction logic for better readability, and performing a deeper clone of storedComp in resolveComponent to prevent nested arrays and objects from mutating the shared cache.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Summary
Verification
npm run buildnpm run typechecknpm audit --json— 0 vulnerabilities on the base dependency setgit diff --checkThe default parallel full suite was also run; two existing
lint --difftests intermittently exceeded the 5-second test timeout under load. Both exact tests pass in isolation, and no lint files are changed in this PR.Summary by CodeRabbit
功能改进
props或子组件属性。测试