Skip to content

feat(test): 新增 GameFrameX 自定义修复回归测试 - #22

Merged
AlianBlank merged 2 commits into
mainfrom
feature/auto-luban-worker-run-86-20261024T0918
Oct 24, 2026
Merged

AlianBlank merged 2 commits into
mainfrom
feature/auto-luban-worker-run-86-20261024T0918

Conversation

@AlianBlank

@AlianBlank AlianBlank commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes GFX-996
Closes #16

Summary by CodeRabbit

  • 改进

    • 表短名称重复时不再中断处理;会记录致命日志,并继续生成相关数据。
    • Rust 生成的 Bean 引用现在使用类型映射名称,或在映射缺失时使用完整类型名称。
  • 测试

    • 新增回归测试,覆盖代码生成、数据解析、本地化工作簿更新、重复表名处理及 Rust 模块路径等场景。

Rust:RustDeclaringTypeNameVisitor.Accept(TBean) 退回了官方 crate::{FullName.Replace} 写法,
导致 bean 引用生成 crate::Battle::Pos 而模块声明为 pub mod battle(大小写不符),
Rust 编译失败;恢复走 RustCommonTemplateExtension.FullName(命名空间小写,与 TEnum 一致)。

DefAssembly:不同模块短表名重复由抛 LubanException 恢复为只记 Fatal 日志不中断生成,
与 fork 74d27f6 语义一致;消息改走 MessageCatalog.Format 保留官方本地化。

Linear: GFX-996
上游同步后 fork 修复缺少断言保护,新增 GameFrameXRegressionTests
共 12 条用例覆盖:cs-dotnet-json 自持 _loadFunc 与 TryGet 取值、
cs-dotnet-bin LoadAsync override 与 LongDataMaps.Clear、
TranslateText 继承修饰符、cs-bin-split 无 SimpleJSON、
0x 十六进制字面量、内联本地化增量写入、短表名重复不中断、
Rust bean 小写模块路径。Luban.Tests 补充引用 Luban.Rust
以注册 rust-bin 目标。

Linear: GFX-996
@linear-code

linear-code Bot commented Oct 24, 2026

Copy link
Copy Markdown

GFX-996

@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6166bc6d-61ad-4d09-9d45-7950417c8cc5
Commits

Reviewing files that changed from the base of the PR and between a8fe362 and d5096ee.

Files ignored due to path filters: 2
  • tests/fixtures/gameframex-inline-l10n/Data/item.csv is excluded by !**/*.csv
  • tests/fixtures/gameframex-regression/Data/hex.csv is excluded by !**/*.csv
Files selected for processing: 20
  • src/Luban.Core/Defs/DefAssembly.cs
  • src/Luban.Rust/TypeVisitors/RustDeclaringTypeNameVisitor.cs
  • src/Luban.Tests/Integration/GameFrameXRegressionTests.cs
  • src/Luban.Tests/Luban.Tests.csproj
  • tests/fixtures/gameframex-duplicate-table/Data/alpha.json
  • tests/fixtures/gameframex-duplicate-table/Data/beta.json
  • tests/fixtures/gameframex-duplicate-table/Defines/alpha.xml
  • tests/fixtures/gameframex-duplicate-table/Defines/beta.xml
  • tests/fixtures/gameframex-duplicate-table/luban.conf
  • tests/fixtures/gameframex-inline-l10n/Defines/schema.xml
  • tests/fixtures/gameframex-inline-l10n/luban.conf
  • tests/fixtures/gameframex-regression/Data/global.json
  • tests/fixtures/gameframex-regression/Data/item.json
  • tests/fixtures/gameframex-regression/Data/notice.json
  • tests/fixtures/gameframex-regression/Data/shape.json
  • tests/fixtures/gameframex-regression/Defines/schema.xml
  • tests/fixtures/gameframex-regression/luban.conf
  • tests/fixtures/gameframex-rust/Data/unit.json
  • tests/fixtures/gameframex-rust/Defines/schema.xml
  • tests/fixtures/gameframex-rust/luban.conf

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

本次变更新增 GameFrameX 集成回归测试及配套 fixture,并调整重复短表名的处理方式和 Rust bean 类型名称生成逻辑。测试覆盖 C# 代码生成、数据解析、本地化更新及 Rust 模块路径。

Changes: GameFrameX 回归与行为调整

Layer / File(s) Summary
生成与数据处理回归覆盖
src/Luban.Tests/Integration/GameFrameXRegressionTests.cs, tests/fixtures/gameframex-regression/*, tests/fixtures/gameframex-inline-l10n/*
新增测试,覆盖 C# JSON/bin 生成、继承声明、bin-split、十六进制解析及内联本地化更新。
重复短表名处理与回归验证
src/Luban.Core/Defs/DefAssembly.cs, src/Luban.Tests/Integration/GameFrameXRegressionTests.cs, tests/fixtures/gameframex-duplicate-table/*
重复短表名时记录 Fatal 日志,并继续执行;测试验证生成成功且两个模块均输出数据文件。完整名称重复仍由既有检查抛出异常。
Rust bean 模块路径与回归验证
src/Luban.Rust/TypeVisitors/RustDeclaringTypeNameVisitor.cs, src/Luban.Tests/Integration/GameFrameXRegressionTests.cs, src/Luban.Tests/Luban.Tests.csproj, tests/fixtures/gameframex-rust/*
非抽象 bean 的类型映射缺失时使用 FullName;新增测试验证生成的 bean 引用使用小写模块路径。

Priority: Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix

Possibly related issues

  • GameFrameX/luban issue 12:本次重复短表名和 Rust 模块路径调整涉及该 issue 提到的 fork 行为保留;本次变更未执行其 v5.1.0 合并目标。

Suggested reviewers: pirunxi, kdletters

Merge Risk: Minimal · up to d5096

No concrete merge-blocking issue is established. Run the integration suite and Release build before merging.

Pre-merge checks: Passed 3 · Failed 1 · Inconclusive 1

Failed Failed checks: 1 warning · 1 inconclusive

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 56.25% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 3 files. (17 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
Linked Issues check Inconclusive 直接关联的开放 issue #16 包含编码和自动化验证要求。当前证据支持部分必测项:GameFrameXRegressionTests 覆盖 JSON、bin、l10n、bin-split、十六进制、内联本地化、重复短表名和 Rust 模块路径;源代码改动也实现了重复短表名日志处理和 Rust 模块路径处理。当前证据不能确认以下要求:git log official/main..HEAD… 需要提供或确认 #16 要求的完整验证记录:其余自定义提交的逐项结果、官方 tests/ 和 CI 结果、真实 GameFrameX 数据的 Golden 差异清单及解释、Release dotnet build 警告对比。还需要提供被排除 CSV 夹具相关测试结果,或其他可审查的独立证据。
Passed Passed checks: 3 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed 标题准确概括了本次变更的主要内容,即新增 GameFrameX 自定义修复的回归测试。标题简洁、明确,并与代码变更和 PR 目标一致。
Out of Scope Changes check Passed 当前变更均与 issue #16 的目标有直接联系。GameFrameXRegressionTests 和新增 fixtures 支持回归验证;Luban.Tests 对 Luban.Rust 的引用支持 Rust 测试注册;DefAssembly 改动对应重复短表名修复;RustDeclaringTypeNameVisitor 改动对应 Rust bean 模块路径修复。未发…
Full details: Out of Scope Changes check

Explanation

当前变更均与 issue #16 的目标有直接联系。GameFrameXRegressionTests 和新增 fixtures 支持回归验证;Luban.Tests 对 Luban.Rust 的引用支持 Rust 测试注册;DefAssembly 改动对应重复短表名修复;RustDeclaringTypeNameVisitor 改动对应 Rust bean 模块路径修复。未发现与该 issue 无关的变更。

Full details: Docstring Coverage

Explanation

Docstring coverage is 56.25% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 3 files. (17 skipped: 17 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Full details: Linked Issues check

Explanation

直接关联的开放 issue #16 包含编码和自动化验证要求。当前证据支持部分必测项:GameFrameXRegressionTests 覆盖 JSON、bin、l10n、bin-split、十六进制、内联本地化、重复短表名和 Rust 模块路径;源代码改动也实现了重复短表名日志处理和 Rust 模块路径处理。当前证据不能确认以下要求:git log official/main..HEAD 中其余自定义提交均已验证;tests/ 官方集成测试和 CI 全绿;基于真实 GameFrameX 定义和数据的完整 Golden 前后对比及差异登记;Release dotnet build 没有新增警告。两个被排除的 CSV 夹具也不能作为本次审查的独立证据。

Resolution

需要提供或确认 #16 要求的完整验证记录:其余自定义提交的逐项结果、官方 tests/ 和 CI 结果、真实 GameFrameX 数据的 Golden 差异清单及解释、Release dotnet build 警告对比。还需要提供被排除 CSV 夹具相关测试结果,或其他可审查的独立证据。

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@AlianBlank
AlianBlank merged commit 483a267 into main Oct 24, 2026
2 checks passed
@AlianBlank
AlianBlank deleted the feature/auto-luban-worker-run-86-20261024T0918 branch October 24, 2026 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

上游同步阶段四:GameFrameX 自定义功能回归验证(含官方集成测试套件)

1 participant