Skip to content

Fix/analyzer warning reduction batch#297

Merged
GeWuYou merged 5 commits into
mainfrom
fix/analyzer-warning-reduction-batch
Apr 27, 2026
Merged

Fix/analyzer warning reduction batch#297
GeWuYou merged 5 commits into
mainfrom
fix/analyzer-warning-reduction-batch

Conversation

@GeWuYou
Copy link
Copy Markdown
Owner

@GeWuYou GeWuYou commented Apr 27, 2026

Summary by CodeRabbit

发行说明

  • 代码质量改进

    • 重构并拆分测试代码,清理内嵌测试类型以提升可维护性与可读性。
  • 测试

    • 新增优先级与混合优先级、IoC 别名与优先服务、异步查询相关的测试夹具与用例。
    • 增补回归用例,验证在取消情形下配置加载会正确传播取消异常。
  • 性能优化

    • 优化 YAML 配置加载流程:改进文件枚举、读取、引用校验与错误封装逻辑。
  • Chores

    • 更新跟踪文档与计划,反映当前优先级与后续工作项。

GeWuYou added 2 commits April 27, 2026 11:17
- 拆分 PriorityServiceTests 末尾的测试接口与辅助类型到独立文件
- 保留原有命名空间、可见性与优先级测试语义
- 补充新文件的 XML 注释并清理原测试文件的无关 using
- 修复 YamlConfigLoader 的超长方法、依赖比较与热重载同步原语告警

- 拆分 MicrosoftDiContainerTests 与 AbstractAsyncQueryTests 的辅助类型文件以消除 MA0048

- 更新 analyzer warning reduction 跟踪文档并记录 non-incremental 构建基线变化
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 27, 2026

📝 Walkthrough

Walkthrough

将测试辅助类型从大型测试文件拆出为独立源文件(优先级、IoC、异步查询等);新增多组测试接口与实现;重构 GFramework.Game.Config.YamlConfigLoader 的加载/转换/热重载逻辑;添加保留取消语义的 YamlConfigLoader 回归测试并更新分析器追踪文档。

Changes

Cohort / File(s) Summary
优先级测试接口
GFramework.Core.Tests/Architectures/IPriorityTestSystem.cs, GFramework.Core.Tests/Architectures/IPriorityTestModel.cs, GFramework.Core.Tests/Architectures/IPriorityTestUtility.cs, GFramework.Core.Tests/Architectures/IMixedTestSystem.cs
新增 4 个用于优先级排序测试的接口(标记契约,无新增成员)。
优先级系统实现
GFramework.Core.Tests/Architectures/PriorityTestSystemA.cs, .../PriorityTestSystemB.cs, .../PriorityTestSystemC.cs
新增 3 个系统实现,均实现 IPriorityTestSystemIPrioritized,分别返回优先级 10/20/30。
混合优先级系统实现
GFramework.Core.Tests/Architectures/MixedTestSystemWithPriority.cs, .../MixedTestSystemWithoutPriority.cs, .../MixedTestSystemNegativePriority.cs
新增 3 个混合测试系统:有优先级、无优先级、负优先级(-10)。
优先级模型与工具
GFramework.Core.Tests/Architectures/PriorityTestModelA.cs, .../PriorityTestModelB.cs, .../PriorityTestModelC.cs, .../PriorityTestUtilityA.cs, .../PriorityTestUtilityB.cs, .../PriorityTestUtilityC.cs
新增 3 个模型与 3 个工具实现,均实现对应测试接口与 IPrioritized(优先级 10/20/30)。
测试内联类型移除
GFramework.Core.Tests/Architectures/PriorityServiceTests.cs, GFramework.Core.Tests/Ioc/MicrosoftDiContainerTests.cs, GFramework.Core.Tests/Query/AbstractAsyncQueryTests.cs
从若干测试文件删除大量本地定义的接口/类(已迁移为独立文件),分别删减约 131/72/177 行。
IoC 测试接口
GFramework.Core.Tests/Ioc/IService.cs, .../IPrioritizedService.cs, .../IMixedService.cs, .../ISharedAliasService.cs, .../IPrimaryAliasService.cs, .../ISecondaryAliasService.cs
新增 6 个 IoC 测试合约,支持别名与优先级场景(多数为标记或简单属性)。
IoC 测试实现
GFramework.Core.Tests/Ioc/TestService.cs, .../PrioritizedService.cs, .../NonPrioritizedService.cs, .../AliasAwareService.cs
新增 4 个服务实现,包含优先级与 Name 属性或实现多个别名接口。
异步查询测试类型
GFramework.Core.Tests/Query/TestAsyncQueryInputV2.cs, .../TestAsyncQueryResultV2.cs, .../TestAsyncQueryV4.cs, .../TestAsyncStringQueryV4.cs, .../TestAsyncComplexQueryV4.cs, .../TestAsyncQueryWithExceptionV4.cs, .../TestAsyncQueryChildV4.cs
新增 7 个异步查询测试类/模型,覆盖 int/string/复杂/异常/子类场景,基于 AbstractAsyncQuery<TIn,TOut>
YamlConfigLoader 重构
GFramework.Game/Config/YamlConfigLoader.cs
将 LoadAsync 拆分为多个辅助函数(目录校验、可选 schema 加载、有序枚举、异步读取并在失败时包装异常但保留取消、按 schema 收集引用、逐文件反序列化并包装错误、构建结果);用泛型委托替换整数解析链,引入条件化锁(NET9+ 使用 Lock 否则 object),统一依赖比较方法。
YamlConfigLoader 回归测试
GFramework.Game.Tests/Config/YamlConfigLoaderTests.cs
新增回归测试,断言在已取消的 CancellationToken 下 ReadYamlAsync 抛出 OperationCanceledException 并在反射调用中保留为 InnerException;增加私有注册项反射访问帮助方法。
分析器追踪文档更新
ai-plan/public/analyzer-warning-reduction/...
更新追踪与跟踪文档,推进 RP 阶段并记录关注点(取消语义、IntegerTryParseDelegate 可空性、XML 注释缺失等)。

Sequence Diagram(s)

sequenceDiagram
    participant Caller
    participant YamlLoader as YamlConfigLoader
    participant Registration as YamlTableRegistration
    participant FileSystem
    participant SchemaValidator
    participant Deserializer

    Caller->>YamlLoader: LoadAsync(registration, ct)
    YamlLoader->>Registration: ValidateDirectory(path)
    Registration->>FileSystem: EnumerateYamlFiles(dir)
    FileSystem-->>Registration: ordered file list
    loop for each file
      Registration->>FileSystem: ReadYamlAsync(file, ct)
      FileSystem-->>Registration: content or throw (cancelled)
      Registration->>SchemaValidator: CollectReferences(content, schema?)
      SchemaValidator-->>Registration: referenced names
      Registration->>Deserializer: Deserialize<TValue>(content)
      Deserializer-->>Registration: TValue or throw (wrapped)
    end
    Registration->>YamlLoader: BuildLoadResult(items, schemaRefs)
    YamlLoader-->>Caller: return YamlTableLoadResult or throw (OperationCanceledException preserved)
Loading

Estimated code review effort

🎯 3 (中等) | ⏱️ ~20 分钟

可能相关的 PR

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 63.41% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题清晰准确地概括了主要变更内容——分析器警告降低批处理。标题简洁有力,反映了PR的核心目标。
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/analyzer-warning-reduction-batch

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 and usage tips.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 27, 2026

Greptile Summary

This PR reduces analyzer warnings by extracting inline test fixture types (systems, models, utilities, query inputs, IoC stubs) from large test files into dedicated per-type files, and refactors YamlTableRegistration.LoadAsync into focused helper methods (GetValidatedDirectoryPath, LoadSchemaAsync, LoadValuesAsync, ReadYamlAsync, DeserializeValue, BuildLoadResult). A correctness fix is included: OperationCanceledException is now re-thrown before the general catch (Exception) in the three file-processing helpers, preventing cancellation from being silently wrapped in a ConfigLoadException.

Confidence Score: 5/5

Safe to merge — the production logic change is a narrowly scoped cancellation-propagation fix with matching regression tests; all other changes are mechanical extractions.

All P1/P0-level concerns are absent. The only open comment is a P2 suggestion about using public-API tests instead of private reflection, which does not block correctness.

GFramework.Game.Tests/Config/YamlConfigLoaderTests.cs — the three new reflection-based regression tests bind to private method names and could silently stop covering the intended path if those names change.

Important Files Changed

Filename Overview
GFramework.Game/Config/YamlConfigLoader.cs Refactored YamlTableRegistration.LoadAsync into focused helper methods; added OperationCanceledException re-throw guards before the general catch in ReadYamlAsync, DeserializeValue, and BuildLoadResult to prevent cancellation exceptions from being wrapped in ConfigLoadException.
GFramework.Game.Tests/Config/YamlConfigLoaderTests.cs Added three regression tests for cancellation propagation via private-method reflection; tests for ReadYamlAsync, DeserializeValue, and BuildLoadResult correctly verify OperationCanceledException is not swallowed.
GFramework.Core.Tests/Architectures/PriorityServiceTests.cs Test fixtures previously defined inline (systems, models, utilities, interfaces) extracted into dedicated files; logic unchanged.
GFramework.Core.Tests/Query/AbstractAsyncQueryTests.cs Inline query fixture types extracted into dedicated files; logic unchanged.
GFramework.Core.Tests/Ioc/MicrosoftDiContainerTests.cs IoC test fixtures extracted into dedicated files; no logic changes.

Sequence Diagram

sequenceDiagram
    participant Caller
    participant YamlConfigLoader
    participant YamlTableRegistration
    participant FileSystem
    participant SchemaValidator

    Caller->>YamlConfigLoader: LoadAsync(registry, ct)
    loop per registration
        YamlConfigLoader->>YamlTableRegistration: LoadAsync(rootPath, deserializer, ct)
        YamlTableRegistration->>YamlTableRegistration: GetValidatedDirectoryPath(rootPath)
        YamlTableRegistration->>SchemaValidator: LoadSchemaAsync(rootPath, ct)
        SchemaValidator-->>YamlTableRegistration: YamlConfigSchema?
        loop per YAML file
            YamlTableRegistration->>FileSystem: ReadYamlAsync(dir, file, schema, ct)
            note over YamlTableRegistration: re-throws OperationCanceledException before wrapping in ConfigLoadException
            FileSystem-->>YamlTableRegistration: yaml string
            YamlTableRegistration->>YamlTableRegistration: CollectReferenceUsages
            YamlTableRegistration->>YamlTableRegistration: DeserializeValue(ct)
        end
        YamlTableRegistration->>YamlTableRegistration: BuildLoadResult(ct)
        YamlTableRegistration-->>YamlConfigLoader: YamlTableLoadResult
    end
    YamlConfigLoader->>YamlConfigLoader: CrossTableReferenceValidator.Validate
    YamlConfigLoader->>YamlConfigLoader: RegistrationDispatcher.Register (all tables)
    YamlConfigLoader->>Caller: done
Loading
Prompt To Fix All With AI
This is a comment left during a code review.
Path: GFramework.Game.Tests/Config/YamlConfigLoaderTests.cs
Line: 2808-2829

Comment:
**Reflection-based test couples to private implementation details**

The test accesses `ReadYamlAsync` by name via `BindingFlags.NonPublic`. If the method is ever renamed, inlined, or its signature changes, this test will silently fail with a null-method assertion rather than a compilation error, making the regression invisible until the null check fires. The same applies to `DeserializeValue` and `BuildLoadResult` in the tests below.

A more resilient approach is to drive the same scenario through the public `LoadAsync` API with a pre-cancelled token — this exercises the full call path without binding to private names, and a compile error would catch any relevant signature change.

How can I resolve this? If you propose a fix, please make it concise.

Reviews (4): Last reviewed commit: "fix(game): 修复同步加载阶段的取消透传" | Re-trigger Greptile

@github-actions
Copy link
Copy Markdown

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
2156 2156 0 0 0 0 31.8s    ↓5.4s

Test Results

passed 2156 passed

Details

tests 2156 tests
clock 31.8s ↓5.4s
tool nunit
build CI - Build & Test arrow-right build-and-test link #991
pull-request Fix/analyzer warning reduction batch link #297

Insights

Average Tests per Run Total Flaky Tests Total Failed Slowest Test (p95)
2150 0 3 4.7s

Fail Rate

Fail Rate 0.00%
Test 📝 Results 📊 Passed ✅ Failed ❌ Fail Rate (%) 📈
ILogAppender_Flush_Should_Raise_OnFlushCompleted_Only_Once 34 33 1 2.94    ↓0.09
RegisterMigration_During_Cache_Rebuild_Should_Not_Leave_Stale_Type_Cache 41 40 1 2.44    ↓0.06
Run_Should_Assign_Globally_Unique_Reference_Metadata_Member_Names 42 41 1 2.38    ↓0.06

build-and-test: Run #991

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Pending ⏳ Other ❓ Flaky 🍂 Duration ⏱️
2156 2156 0 0 0 0 0 31.8s

🎉 All tests passed!

Slowest Tests

Test 📝 Results 📊 Duration (avg) ⏱️ Duration (p95) ⏱️
SendRequestAsync_Should_ResolveCqrsRuntime_OnlyOnce_When_AccessedConcurrently 42 4.1s 4.7s
Does_Not_Report_When_FieldInjectedModel_Is_Registered 42 2.2s 2.4s
Generates_Scene_Behavior_Boilerplate 42 1.9s 2.0s
CleanupDuringAcquire_Should_NotCauseRaceCondition 42 1.1s 1.1s
Append_ShouldNotBlock 42 1.0s 1.0s
Flush_Should_Raise_OnFlushCompleted_With_Sender_And_Result 35 58ms 1.0s
Context_Caching_Should_Improve_Performance 42 781ms 791ms
PendingCount_ShouldReflectQueuedEntries 42 501ms 501ms
Cleanup_Should_NotRemoveActiveLocks 42 404ms 406ms
Cleanup_Should_RemoveUnusedLocks 42 401ms 402ms

± Comparison with run #988 at 1656a06 | 🍂 No flaky tests detected across all runs. | ⏱️ Measured over 42 runs.

Github Test Reporter by CTRF 💚

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 27, 2026

⚠️MegaLinter analysis: Success with warnings

Descriptor Linter Files Fixed Errors Warnings Elapsed time
⚠️ CSHARP dotnet-format yes 1 no 5.3s
✅ REPOSITORY gitleaks yes no no 7.49s
✅ REPOSITORY trufflehog yes no no 5.8s

Detailed Issues

⚠️ CSHARP / dotnet-format - 1 error
Welcome to .NET 9.0!
---------------------
SDK Version: 9.0.114

----------------
Installed an ASP.NET Core HTTPS development certificate.
To trust the certificate, run 'dotnet dev-certs https --trust'
Learn about HTTPS: https://aka.ms/dotnet-https

----------------
Write your first app: https://aka.ms/dotnet-hello-world
Find out what's new: https://aka.ms/dotnet-whats-new
Explore documentation: https://aka.ms/dotnet-docs
Report issues and find source on GitHub: https://github.com/dotnet/core
Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli
--------------------------------------------------------------------------------------
Unhandled exception: System.Exception: Restore operation failed.
   at Microsoft.CodeAnalysis.Tools.CodeFormatter.OpenMSBuildWorkspaceAsync(String solutionOrProjectPath, WorkspaceType workspaceType, Boolean noRestore, Boolean requiresSemantics, String binaryLogPath, Boolean logWorkspaceWarnings, ILogger logger, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.Tools.CodeFormatter.FormatWorkspaceAsync(FormatOptions formatOptions, ILogger logger, CancellationToken cancellationToken, String binaryLogPath)
   at Microsoft.CodeAnalysis.Tools.FormatCommandCommon.FormatAsync(FormatOptions formatOptions, ILogger`1 logger, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.Tools.Commands.RootFormatCommand.FormatCommandDefaultHandler.InvokeAsync(ParseResult parseResult, CancellationToken cancellationToken)
   at System.CommandLine.Invocation.InvocationPipeline.InvokeAsync(ParseResult parseResult, CancellationToken cancellationToken)

See detailed reports in MegaLinter artifacts
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security
Show us your support by starring ⭐ the repository

@GeWuYou
Copy link
Copy Markdown
Owner Author

GeWuYou commented Apr 27, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 27, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (3)
GFramework.Core.Tests/Query/TestAsyncQueryWithExceptionV4.cs (1)

18-26: 可选:补充 <returns> 文档以保持注释完整性。

OnDoAsync 的重写虽然始终抛出异常,但其声明返回类型仍为 Task<int>。当前注释只有 <exception> 而缺少 <returns>,与项目内其他 *V4 测试类(均含 <returns>)的风格不一致。可考虑补充一行说明该方法不会正常返回,或在抛出前显式标注返回语义,以满足 "All public, protected, and internal types and members MUST include XML documentation comments with ... <returns> ... where applicable" 的规范要求。

♻️ 建议的小幅完善
     /// <summary>
     ///     执行异步查询操作并抛出异常
     /// </summary>
     /// <param name="input">查询输入参数</param>
+    /// <returns>该方法不会正常返回,始终抛出异常。</returns>
     /// <exception cref="InvalidOperationException">总是抛出异常</exception>
     protected override Task<int> OnDoAsync(TestAsyncQueryInputV2 input)

As per coding guidelines: "All public, protected, and internal types and members MUST include XML documentation comments (///) with <summary>, <param>, <returns>, <exception>, and <remarks> where applicable".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@GFramework.Core.Tests/Query/TestAsyncQueryWithExceptionV4.cs` around lines 18
- 26, Add a <returns> XML doc for the protected override Task<int>
OnDoAsync(TestAsyncQueryInputV2 input) in TestAsyncQueryWithExceptionV4 to match
project doc style; update the method's XML comments to include a <returns>
element that states the method returns a Task<int> but will not complete
normally (it always throws an InvalidOperationException), keeping the existing
<exception> entry intact so the XML docs include <summary>, <param>, <returns>,
and <exception> for OnDoAsync.
GFramework.Core.Tests/Ioc/IPrioritizedService.cs (1)

8-11: Name 属性与 IMixedService 重复定义,建议复用。

IPrioritizedServiceIMixedService 都独立声明了 string? Name { get; set; }PrioritizedService 同时实现两个接口时,依赖隐式实现一并满足。这种重复声明属于 DRY 违反,未来若要修改 Name 语义(如改为不可空、加注释约束)需要改两处。

如果两个接口在测试中确实代表不同语义(例如 “带优先级的命名服务” vs “混合服务”),建议让 IPrioritizedService 继承 IMixedService,从而集中维护 Name 契约:

♻️ 建议的重构
-public interface IPrioritizedService : IPrioritized
-{
-    string? Name { get; set; }
-}
+public interface IPrioritizedService : IPrioritized, IMixedService
+{
+}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@GFramework.Core.Tests/Ioc/IPrioritizedService.cs` around lines 8 - 11,
IPrioritizedService currently re-declares string? Name { get; set; } already
present on IMixedService; remove the duplicate by having IPrioritizedService
extend IMixedService instead: change the interface signature to include
IMixedService (e.g., public interface IPrioritizedService : IPrioritized,
IMixedService) and delete the Name property from IPrioritizedService so
PrioritizedService and other implementers get Name via IMixedService; rebuild
and fix any impacted usages or tests that referenced the removed declaration.
GFramework.Game/Config/YamlConfigLoader.cs (1)

701-705: IntegerTryParseDelegate<T> 第一个参数的可空性与 BCL 方法签名不匹配,会触发 CS8622 告警。

delegate 在第 702 行声明第一个参数为非空 string value,但 BCL 的 int.TryParselong.TryParse 等方法签名均为 bool TryParse(string? s, ...)(参数可空)。在第 831-838 行将这些方法组赋给 delegate 时会产生 CS8622 兼容性错误。

建议: 将第 702 行的参数改为 string? value 以匹配 BCL 方法签名。由于 rawValue 在调用点已是非空字符串,不需额外的空检查。

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@GFramework.Game/Config/YamlConfigLoader.cs` around lines 701 - 705,
IntegerTryParseDelegate<T> currently declares its first parameter as
non-nullable string which mismatches BCL TryParse signatures and triggers
CS8622; change the first parameter of the delegate IntegerTryParseDelegate<T>
from string value to string? value so it matches int.TryParse/long.TryParse
signatures and allows assigning those methods to the delegate; no extra null
checks are needed at call sites because rawValue passed into the delegate is
already non-null.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@GFramework.Core.Tests/Ioc/IMixedService.cs`:
- Line 8: The public interface property IMixedService.Name is missing XML
documentation; add a /// <summary> comment above the Name property in the
IMixedService interface describing its purpose (and include <remarks> or other
XML tags if applicable) so it complies with the project documentation guideline
requiring XML comments for public members.

In `@GFramework.Core.Tests/Ioc/IPrioritizedService.cs`:
- Line 10: Add an XML documentation comment for the public interface member Name
on IPrioritizedService: add a /// <summary> describing what the Name property
represents (e.g., the service identifier or display name) and include any
relevant <remarks> if needed; ensure the comment sits immediately above the
string? Name { get; set; } declaration in the IPrioritizedService interface so
the public API complies with the XML doc guideline.

In `@GFramework.Game/Config/YamlConfigLoader.cs`:
- Around line 552-567: ReadYamlAsync currently catches all Exception and wraps
them as ConfigLoadException, which hides OperationCanceledException and breaks
cancellation flow; update ReadYamlAsync so that in the catch you detect
OperationCanceledException (or Exception when it's an OCE) and rethrow it
immediately (preserving cancellation) before creating/wrapping other exceptions;
apply the same pattern to the other risky catch blocks in DeserializeValue and
BuildLoadResult so any OperationCanceledException is not swallowed, while other
exceptions continue to be wrapped with ConfigLoadExceptionFactory as before;
reference the methods ReadYamlAsync, DeserializeValue, BuildLoadResult and
ensure ReloadTableAsync's catch filters can observe genuine OCEs.

---

Nitpick comments:
In `@GFramework.Core.Tests/Ioc/IPrioritizedService.cs`:
- Around line 8-11: IPrioritizedService currently re-declares string? Name {
get; set; } already present on IMixedService; remove the duplicate by having
IPrioritizedService extend IMixedService instead: change the interface signature
to include IMixedService (e.g., public interface IPrioritizedService :
IPrioritized, IMixedService) and delete the Name property from
IPrioritizedService so PrioritizedService and other implementers get Name via
IMixedService; rebuild and fix any impacted usages or tests that referenced the
removed declaration.

In `@GFramework.Core.Tests/Query/TestAsyncQueryWithExceptionV4.cs`:
- Around line 18-26: Add a <returns> XML doc for the protected override
Task<int> OnDoAsync(TestAsyncQueryInputV2 input) in
TestAsyncQueryWithExceptionV4 to match project doc style; update the method's
XML comments to include a <returns> element that states the method returns a
Task<int> but will not complete normally (it always throws an
InvalidOperationException), keeping the existing <exception> entry intact so the
XML docs include <summary>, <param>, <returns>, and <exception> for OnDoAsync.

In `@GFramework.Game/Config/YamlConfigLoader.cs`:
- Around line 701-705: IntegerTryParseDelegate<T> currently declares its first
parameter as non-nullable string which mismatches BCL TryParse signatures and
triggers CS8622; change the first parameter of the delegate
IntegerTryParseDelegate<T> from string value to string? value so it matches
int.TryParse/long.TryParse signatures and allows assigning those methods to the
delegate; no extra null checks are needed at call sites because rawValue passed
into the delegate is already non-null.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a0721b57-d2f3-4b6e-8b2c-9788a4e30958

📥 Commits

Reviewing files that changed from the base of the PR and between 99ccc28 and a9904a3.

📒 Files selected for processing (39)
  • GFramework.Core.Tests/Architectures/IMixedTestSystem.cs
  • GFramework.Core.Tests/Architectures/IPriorityTestModel.cs
  • GFramework.Core.Tests/Architectures/IPriorityTestSystem.cs
  • GFramework.Core.Tests/Architectures/IPriorityTestUtility.cs
  • GFramework.Core.Tests/Architectures/MixedTestSystemNegativePriority.cs
  • GFramework.Core.Tests/Architectures/MixedTestSystemWithPriority.cs
  • GFramework.Core.Tests/Architectures/MixedTestSystemWithoutPriority.cs
  • GFramework.Core.Tests/Architectures/PriorityServiceTests.cs
  • GFramework.Core.Tests/Architectures/PriorityTestModelA.cs
  • GFramework.Core.Tests/Architectures/PriorityTestModelB.cs
  • GFramework.Core.Tests/Architectures/PriorityTestModelC.cs
  • GFramework.Core.Tests/Architectures/PriorityTestSystemA.cs
  • GFramework.Core.Tests/Architectures/PriorityTestSystemB.cs
  • GFramework.Core.Tests/Architectures/PriorityTestSystemC.cs
  • GFramework.Core.Tests/Architectures/PriorityTestUtilityA.cs
  • GFramework.Core.Tests/Architectures/PriorityTestUtilityB.cs
  • GFramework.Core.Tests/Architectures/PriorityTestUtilityC.cs
  • GFramework.Core.Tests/Ioc/AliasAwareService.cs
  • GFramework.Core.Tests/Ioc/IMixedService.cs
  • GFramework.Core.Tests/Ioc/IPrimaryAliasService.cs
  • GFramework.Core.Tests/Ioc/IPrioritizedService.cs
  • GFramework.Core.Tests/Ioc/ISecondaryAliasService.cs
  • GFramework.Core.Tests/Ioc/IService.cs
  • GFramework.Core.Tests/Ioc/ISharedAliasService.cs
  • GFramework.Core.Tests/Ioc/MicrosoftDiContainerTests.cs
  • GFramework.Core.Tests/Ioc/NonPrioritizedService.cs
  • GFramework.Core.Tests/Ioc/PrioritizedService.cs
  • GFramework.Core.Tests/Ioc/TestService.cs
  • GFramework.Core.Tests/Query/AbstractAsyncQueryTests.cs
  • GFramework.Core.Tests/Query/TestAsyncComplexQueryV4.cs
  • GFramework.Core.Tests/Query/TestAsyncQueryChildV4.cs
  • GFramework.Core.Tests/Query/TestAsyncQueryInputV2.cs
  • GFramework.Core.Tests/Query/TestAsyncQueryResultV2.cs
  • GFramework.Core.Tests/Query/TestAsyncQueryV4.cs
  • GFramework.Core.Tests/Query/TestAsyncQueryWithExceptionV4.cs
  • GFramework.Core.Tests/Query/TestAsyncStringQueryV4.cs
  • GFramework.Game/Config/YamlConfigLoader.cs
  • ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
  • ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
💤 Files with no reviewable changes (3)
  • GFramework.Core.Tests/Query/AbstractAsyncQueryTests.cs
  • GFramework.Core.Tests/Ioc/MicrosoftDiContainerTests.cs
  • GFramework.Core.Tests/Architectures/PriorityServiceTests.cs
📜 Review details
🧰 Additional context used
📓 Path-based instructions (3)
**/*.cs

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.cs: Apply [Log] attribute for automatic logging field and logging helper method generation
Apply [Priority] attribute for automatic priority comparison implementation generation
Apply [GenerateEnumExtensions] attribute to generate enumeration extension capabilities
Apply [ContextAware] attribute to automatically implement IContextAware boilerplate logic

**/*.cs: All public, protected, and internal types and members MUST include XML documentation comments (///) with <summary>, <param>, <returns>, <exception>, and <remarks> where applicable
Add inline comments for non-trivial logic, concurrency/threading behavior, performance-sensitive paths, workarounds, edge cases, registration order, lifecycle sequencing, and generated code assumptions
Core framework components such as Architecture, Module, System, Context, Registry, Service Module, and Lifecycle types MUST include high-level explanations of responsibilities, lifecycle, interactions, why the abstraction exists, and when to use it
Generated logic and generator pipelines MUST explain what is generated, why it is generated, semantic assumptions, and diagnostics or fallback behavior
Methods with non-trivial logic MUST document the core idea, key decisions, and edge case handling
Do not rely on implicit imports; declare every required using explicitly in C# files
Write null-safe code that respects nullable annotations instead of suppressing warnings by default
Use the namespace pattern GFramework.{Module}.{Feature} with PascalCase segments in C# files
Follow standard C# naming: types/methods/properties/events/constants in PascalCase, interfaces with I prefix, parameters and locals in camelCase, private fields in _camelCase
Use 4 spaces for indentation in C# files; do not use tabs
Use Allman braces in C# files
Keep using directives at the top of C# files and sort them consistently
Prefer one primary type per C# file unless the surrounding project already uses a different local pattern
Keep...

Files:

  • GFramework.Core.Tests/Architectures/IPriorityTestSystem.cs
  • GFramework.Core.Tests/Ioc/IPrioritizedService.cs
  • GFramework.Core.Tests/Architectures/IPriorityTestUtility.cs
  • GFramework.Core.Tests/Architectures/IPriorityTestModel.cs
  • GFramework.Core.Tests/Ioc/AliasAwareService.cs
  • GFramework.Core.Tests/Ioc/IMixedService.cs
  • GFramework.Core.Tests/Ioc/TestService.cs
  • GFramework.Core.Tests/Architectures/IMixedTestSystem.cs
  • GFramework.Core.Tests/Architectures/PriorityTestUtilityA.cs
  • GFramework.Core.Tests/Query/TestAsyncQueryInputV2.cs
  • GFramework.Core.Tests/Ioc/ISharedAliasService.cs
  • GFramework.Core.Tests/Ioc/IPrimaryAliasService.cs
  • GFramework.Core.Tests/Architectures/PriorityTestUtilityC.cs
  • GFramework.Core.Tests/Ioc/IService.cs
  • GFramework.Core.Tests/Architectures/PriorityTestModelB.cs
  • GFramework.Core.Tests/Architectures/MixedTestSystemWithPriority.cs
  • GFramework.Core.Tests/Architectures/PriorityTestModelA.cs
  • GFramework.Core.Tests/Architectures/MixedTestSystemNegativePriority.cs
  • GFramework.Core.Tests/Architectures/PriorityTestSystemB.cs
  • GFramework.Core.Tests/Ioc/NonPrioritizedService.cs
  • GFramework.Core.Tests/Architectures/PriorityTestModelC.cs
  • GFramework.Core.Tests/Query/TestAsyncQueryResultV2.cs
  • GFramework.Core.Tests/Architectures/PriorityTestSystemA.cs
  • GFramework.Core.Tests/Architectures/MixedTestSystemWithoutPriority.cs
  • GFramework.Core.Tests/Ioc/PrioritizedService.cs
  • GFramework.Core.Tests/Query/TestAsyncComplexQueryV4.cs
  • GFramework.Core.Tests/Query/TestAsyncQueryWithExceptionV4.cs
  • GFramework.Core.Tests/Ioc/ISecondaryAliasService.cs
  • GFramework.Core.Tests/Query/TestAsyncQueryV4.cs
  • GFramework.Core.Tests/Query/TestAsyncQueryChildV4.cs
  • GFramework.Core.Tests/Architectures/PriorityTestSystemC.cs
  • GFramework.Core.Tests/Query/TestAsyncStringQueryV4.cs
  • GFramework.Game/Config/YamlConfigLoader.cs
  • GFramework.Core.Tests/Architectures/PriorityTestUtilityB.cs
ai-plan/public/*/traces/**

📄 CodeRabbit inference engine (AGENTS.md)

Contributors MUST maintain a matching execution trace under ai-plan/public/<topic>/traces/ for complex work, recording the current date, key decisions, validation milestones, and the immediate next step

Files:

  • ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
ai-plan/public/*/todos/**

📄 CodeRabbit inference engine (AGENTS.md)

ai-plan/public/*/todos/**: When working from a tracked implementation plan, contributors MUST update the corresponding tracking document under ai-plan/public/<topic>/todos/ in the same change
Tracking updates MUST reflect completed work, newly discovered issues, validation results, and the next recommended recovery point
Active tracking and trace files are recovery entrypoints, not append-only changelogs; they MUST stay concise enough for boot to locate the current recovery point quickly
Recovery documents MUST record the current phase, the active recovery point identifier, known risks, and the next recommended resume step so another contributor or subagent can continue the work safely
When completed and validated stages begin to accumulate, contributors MUST archive their detailed history out of the active todos/ and traces/ entry files in the same change, keeping only the current recovery point, active facts, active risks, immediate next step, and pointers to archive files
When a task spans multiple commits or is likely to exceed a single agent context window, update both the recovery document and the trace at each meaningful milestone before pausing or handing work off
If subagents are used on a complex task, the main agent MUST capture the delegated scope and any accepted findings in the active recovery document or trace before continuing implementation

Files:

  • ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
🧠 Learnings (10)
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.Tests.cs : Reuse existing architecture test infrastructure when relevant: `ArchitectureTestsBase<T>`, `SyncTestArchitecture`, `AsyncTestArchitecture`

Applied to files:

  • GFramework.Core.Tests/Architectures/IPriorityTestSystem.cs
  • GFramework.Core.Tests/Architectures/IPriorityTestUtility.cs
  • GFramework.Core.Tests/Architectures/IPriorityTestModel.cs
  • GFramework.Core.Tests/Architectures/IMixedTestSystem.cs
  • GFramework.Core.Tests/Architectures/PriorityTestUtilityC.cs
  • GFramework.Core.Tests/Architectures/PriorityTestModelB.cs
  • GFramework.Core.Tests/Architectures/MixedTestSystemWithPriority.cs
  • GFramework.Core.Tests/Architectures/PriorityTestModelA.cs
  • GFramework.Core.Tests/Architectures/PriorityTestSystemB.cs
  • GFramework.Core.Tests/Architectures/PriorityTestModelC.cs
  • GFramework.Core.Tests/Architectures/PriorityTestSystemA.cs
  • GFramework.Core.Tests/Architectures/MixedTestSystemWithoutPriority.cs
  • GFramework.Core.Tests/Architectures/PriorityTestSystemC.cs
📚 Learning: 2026-04-17T11:35:08.762Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-17T11:35:08.762Z
Learning: Applies to **/*.cs : Apply [Priority] attribute for automatic priority comparison implementation generation

Applied to files:

  • GFramework.Core.Tests/Architectures/IPriorityTestSystem.cs
  • GFramework.Core.Tests/Architectures/IPriorityTestUtility.cs
  • GFramework.Core.Tests/Architectures/IPriorityTestModel.cs
  • GFramework.Core.Tests/Ioc/TestService.cs
  • GFramework.Core.Tests/Architectures/PriorityTestUtilityA.cs
  • GFramework.Core.Tests/Architectures/PriorityTestUtilityC.cs
  • GFramework.Core.Tests/Architectures/PriorityTestModelB.cs
  • GFramework.Core.Tests/Architectures/MixedTestSystemWithPriority.cs
  • GFramework.Core.Tests/Architectures/PriorityTestModelA.cs
  • GFramework.Core.Tests/Architectures/MixedTestSystemNegativePriority.cs
  • GFramework.Core.Tests/Architectures/PriorityTestSystemB.cs
  • GFramework.Core.Tests/Architectures/PriorityTestModelC.cs
  • GFramework.Core.Tests/Architectures/PriorityTestSystemA.cs
  • GFramework.Core.Tests/Ioc/PrioritizedService.cs
  • GFramework.Core.Tests/Architectures/PriorityTestSystemC.cs
  • GFramework.Core.Tests/Architectures/PriorityTestUtilityB.cs
📚 Learning: 2026-04-06T12:45:43.921Z
Learnt from: GeWuYou
Repo: GeWuYou/GFramework PR: 190
File: GFramework.Game/Config/GameConfigBootstrap.cs:1-3
Timestamp: 2026-04-06T12:45:43.921Z
Learning: In the GeWuYou/GFramework repository, C# files may omit explicit `using System*` imports because the project-wide `GlobalUsings.cs` (referenced via manual global `using` directives) supplies common namespaces (e.g., `System`, `System.Threading`, `System.Threading.Tasks`). During code review, do not flag missing `using System...` directives in `.cs` files as long as `GlobalUsings.cs` is present/used to provide those namespaces.

Applied to files:

  • GFramework.Core.Tests/Architectures/IPriorityTestSystem.cs
  • GFramework.Core.Tests/Ioc/IPrioritizedService.cs
  • GFramework.Core.Tests/Architectures/IPriorityTestUtility.cs
  • GFramework.Core.Tests/Architectures/IPriorityTestModel.cs
  • GFramework.Core.Tests/Ioc/AliasAwareService.cs
  • GFramework.Core.Tests/Ioc/IMixedService.cs
  • GFramework.Core.Tests/Ioc/TestService.cs
  • GFramework.Core.Tests/Architectures/IMixedTestSystem.cs
  • GFramework.Core.Tests/Architectures/PriorityTestUtilityA.cs
  • GFramework.Core.Tests/Query/TestAsyncQueryInputV2.cs
  • GFramework.Core.Tests/Ioc/ISharedAliasService.cs
  • GFramework.Core.Tests/Ioc/IPrimaryAliasService.cs
  • GFramework.Core.Tests/Architectures/PriorityTestUtilityC.cs
  • GFramework.Core.Tests/Ioc/IService.cs
  • GFramework.Core.Tests/Architectures/PriorityTestModelB.cs
  • GFramework.Core.Tests/Architectures/MixedTestSystemWithPriority.cs
  • GFramework.Core.Tests/Architectures/PriorityTestModelA.cs
  • GFramework.Core.Tests/Architectures/MixedTestSystemNegativePriority.cs
  • GFramework.Core.Tests/Architectures/PriorityTestSystemB.cs
  • GFramework.Core.Tests/Ioc/NonPrioritizedService.cs
  • GFramework.Core.Tests/Architectures/PriorityTestModelC.cs
  • GFramework.Core.Tests/Query/TestAsyncQueryResultV2.cs
  • GFramework.Core.Tests/Architectures/PriorityTestSystemA.cs
  • GFramework.Core.Tests/Architectures/MixedTestSystemWithoutPriority.cs
  • GFramework.Core.Tests/Ioc/PrioritizedService.cs
  • GFramework.Core.Tests/Query/TestAsyncComplexQueryV4.cs
  • GFramework.Core.Tests/Query/TestAsyncQueryWithExceptionV4.cs
  • GFramework.Core.Tests/Ioc/ISecondaryAliasService.cs
  • GFramework.Core.Tests/Query/TestAsyncQueryV4.cs
  • GFramework.Core.Tests/Query/TestAsyncQueryChildV4.cs
  • GFramework.Core.Tests/Architectures/PriorityTestSystemC.cs
  • GFramework.Core.Tests/Query/TestAsyncStringQueryV4.cs
  • GFramework.Game/Config/YamlConfigLoader.cs
  • GFramework.Core.Tests/Architectures/PriorityTestUtilityB.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.cs : Public API changes must be covered by unit or integration tests in C#

Applied to files:

  • GFramework.Core.Tests/Architectures/PriorityTestUtilityC.cs
  • GFramework.Core.Tests/Architectures/PriorityTestModelC.cs
  • GFramework.Core.Tests/Architectures/PriorityTestSystemC.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.Tests.cs : Keep tests focused on observable behavior, not implementation trivia

Applied to files:

  • GFramework.Core.Tests/Architectures/MixedTestSystemWithoutPriority.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: When the goal is to inspect or reduce warnings, establish the warning baseline by running `dotnet clean` and then `dotnet build`, not repeated incremental builds

Applied to files:

  • ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.cs : When a C# method approaches analyzer complexity limits, extract named helper methods by semantic phase (parsing, normalization, validation, diagnostics) instead of silencing the warning

Applied to files:

  • ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
  • ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to ai-plan/public/*/traces/** : Contributors MUST maintain a matching execution trace under `ai-plan/public/<topic>/traces/` for complex work, recording the current date, key decisions, validation milestones, and the immediate next step

Applied to files:

  • ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
📚 Learning: 2026-04-16T13:26:01.780Z
Learnt from: GeWuYou
Repo: GeWuYou/GFramework PR: 235
File: GFramework.SourceGenerators.Tests/Rule/ContextAwareGeneratorSnapshotTests.cs:1-3
Timestamp: 2026-04-16T13:26:01.780Z
Learning: In the GeWuYou/GFramework repository, the test project `GFramework.SourceGenerators.Tests` provides `global using NUnit.Framework;` via its `GlobalUsings.cs`. Do not flag missing `using NUnit.Framework;` directives in test files within this project, as the global using already covers it. The project-wide GlobalUsings.cs pattern is used broadly to supply common namespaces (including NUnit, System.IO, etc.) without per-file imports.

Applied to files:

  • GFramework.Game/Config/YamlConfigLoader.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to ai-plan/public/*/todos/** : Tracking updates MUST reflect completed work, newly discovered issues, validation results, and the next recommended recovery point

Applied to files:

  • ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
🪛 LanguageTool
ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md

[grammar] ~16-~16: Ensure spelling is correct
Context: ...g / 279 个唯一位点 - 当前剩余 warning 热点仍集中在 GFramework.Cqrs.Tests/Mediator/* 的大体量 MA0048、以及 `Yam...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)


[grammar] ~77-~77: Ensure spelling is correct
Context: ...。 3. 继续将 YamlConfigSchemaValidator*GFramework.Cqrs.Tests/Mediator/* 作为独立高风险波次处理。

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🔇 Additional comments (34)
GFramework.Core.Tests/Ioc/ISharedAliasService.cs (1)

1-6: LGTM!

新接口拆分到独立文件以消除 MA0048,命名空间、XML 注释与命名规范均符合要求。

GFramework.Core.Tests/Ioc/ISecondaryAliasService.cs (1)

1-6: LGTM!

ISecondaryAliasService 继承自 ISharedAliasService,作为次级别名契约的空标记接口拆分清晰,符合命名空间与 XML 文档规范。

GFramework.Core.Tests/Ioc/IPrimaryAliasService.cs (1)

1-6: LGTM!

IPrimaryAliasServiceISecondaryAliasService 配对,统一继承 ISharedAliasService,拆分粒度合理。

GFramework.Core.Tests/Ioc/AliasAwareService.cs (1)

1-8: LGTM!

AliasAwareService 使用 sealed 声明并实现两个别名接口,作为别名去重测试的具体类型,结构清晰且符合一文件一类型的约定。

GFramework.Core.Tests/Architectures/IPriorityTestUtility.cs (1)

1-10: LGTM!

IPriorityTestUtilityPriorityServiceTests.cs 抽取为独立文件,符合 MA0048(一文件一类型)的整改目标。命名空间、XML 文档注释、命名规范均符合编码规范。

GFramework.Core.Tests/Architectures/IPriorityTestSystem.cs (1)

1-10: LGTM!

IPriorityTestSystem 作为优先级测试系统的标记契约,扩展自 ISystem,无新增成员,符合用作类型契约的设计意图。文件结构与同批次其它测试契约接口一致。

GFramework.Core.Tests/Architectures/PriorityTestUtilityC.cs (1)

1-14: LGTM!

PriorityTestUtilityC 实现 IPriorityTestUtilityIPrioritizedPriority => 30PriorityServiceTests.Utilities_Should_Be_Sorted_By_Priority 的预期断言(C 在索引 2)一致。XML 文档完整。

GFramework.Core.Tests/Architectures/IPriorityTestModel.cs (1)

1-10: LGTM!

IPriorityTestModel 抽取为独立文件,扩展 IModel,作为优先级模型测试的标记契约,与同批次的 IPriorityTestSystemIPriorityTestUtility 设计模式保持一致。

GFramework.Core.Tests/Architectures/PriorityTestUtilityB.cs (1)

1-14: LGTM!

PriorityTestUtilityB 优先级 20 与测试期望(B 位于索引 1)相符,类型抽取干净,XML 注释齐全。

GFramework.Core.Tests/Architectures/IMixedTestSystem.cs (1)

1-10: LGTM!

IMixedTestSystem 作为混合优先级测试场景的系统契约从 PriorityServiceTests.cs 抽离,命名、命名空间与文档均符合规范。后续 MixedTestSystemWithPriority / MixedTestSystemWithoutPriority / MixedTestSystemNegativePriority 共同实现该契约的设计清晰。

GFramework.Core.Tests/Architectures/PriorityTestUtilityA.cs (1)

1-14: LGTM!

PriorityTestUtilityA 优先级 10(最高),与排序断言 utilities[0] 期望一致。类型职责单一、文档完整。

GFramework.Core.Tests/Architectures/PriorityTestSystemA.cs (1)

1-21: LGTM!

PriorityTestSystemA 继承 AbstractSystem 并实现 IPriorityTestSystemIPrioritizedPriority => 10Systems_Should_Be_Sorted_By_Priority 中 A 位于索引 0 的断言匹配。OnInit 显式留空并附注释说明只覆盖优先级排序行为,意图清晰。

GFramework.Core.Tests/Architectures/PriorityTestModelB.cs (1)

1-22: LGTM!

类型拆分清晰,XML 注释完整,命名空间与命名规范均符合要求,空 OnInit() 仅用于满足 AbstractModel 抽象契约,Priority => 20 与同套件中 A(10)/C(30) 的梯度一致,可满足优先级排序测试需要。

GFramework.Core.Tests/Architectures/MixedTestSystemWithPriority.cs (1)

1-21: LGTM!

MixedTestSystemWithPriority 实现 IMixedTestSystem + IPrioritized 并固定 Priority => 10,与同组 MixedTestSystemNegativePriority(-10) 及 MixedTestSystemWithoutPriority(默认 0) 形成正/负/缺省三种情形,能够覆盖 MicrosoftDiContainer.SortByPriority 的稳定排序行为;XML 注释与空 OnInit() 实现均符合规范。

GFramework.Core.Tests/Architectures/PriorityTestModelA.cs (1)

1-22: LGTM!

类型抽离为独立文件,符合 MA0048 的修复目标;Priority => 10 与 B(20)/C(30) 梯度一致,XML 注释完整,空 OnInit() 满足 AbstractModel 抽象方法契约。

GFramework.Core.Tests/Architectures/PriorityTestSystemC.cs (1)

1-21: LGTM!

PriorityTestSystemCPriorityTestSystemB(20) 形成 20/30 的优先级梯度,XML 注释完整,空 OnInit() 仅用于满足 AbstractSystem.OnInit 抽象契约,文件拆分符合每文件单类型的指南。

GFramework.Core.Tests/Architectures/MixedTestSystemNegativePriority.cs (1)

1-21: LGTM!

负优先级用例 Priority => -10IPrioritized 契约(数值越小优先级越高)语义一致,可有效覆盖 MicrosoftDiContainer.SortByPriority 中负值早于默认 0 的排序分支;XML 注释与空 OnInit() 均符合规范。

GFramework.Core.Tests/Architectures/PriorityTestModelC.cs (1)

1-22: LGTM!

PriorityTestModelC 提供 Priority => 30,补全模型侧 10/20/30 梯度,XML 注释完整,空 OnInit() 满足 AbstractModel 抽象契约。

GFramework.Core.Tests/Architectures/MixedTestSystemWithoutPriority.cs (1)

1-16: LGTM!

未实现 IPrioritized 的混合系统类型,可触发 SortByPriority 中“非 IPrioritized 视为 0”的分支,与 MixedTestSystemWithPriority(10) 及 MixedTestSystemNegativePriority(-10) 一同提供完整排序覆盖;XML 注释与空 OnInit() 均符合规范。

GFramework.Core.Tests/Architectures/PriorityTestSystemB.cs (1)

1-21: LGTM!

类型已成功从 PriorityServiceTests.cs 拆出为独立文件,有助于消除 MA0048;Priority => 20 与同组 C(30) 形成稳定梯度,XML 注释与空 OnInit() 满足规范。

GFramework.Core.Tests/Query/TestAsyncQueryInputV2.cs (1)

1-14: LGTM!

新拆分的测试用查询输入类型实现了 IQueryInput,使用 init 只读属性、sealed 修饰符及完整的 XML 注释,命名空间 GFramework.Core.Tests.Query 与目录结构一致,符合规范。

GFramework.Core.Tests/Query/TestAsyncQueryV4.cs (1)

1-33: LGTM!

TestAsyncQueryV4 正确继承 AbstractAsyncQuery<TestAsyncQueryInputV2, int>,构造函数将 input 转发至基类,OnDoAsync 中先设置 Executed = true 再返回 input.Value * 2,符合基类约定(DoAsync 调用 OnDoAsync(input))。XML 注释与命名规范均符合要求。

GFramework.Core.Tests/Query/TestAsyncQueryChildV4.cs (1)

1-33: LGTM!

实现与 TestAsyncQueryV4 一致,仅在结果上乘以 3 以体现子类语义差异,构造函数转发与 Executed 标记位的使用均符合基类骨架。

GFramework.Core.Tests/Query/TestAsyncStringQueryV4.cs (1)

1-33: LGTM!

字符串结果版异步查询测试类正确继承 AbstractAsyncQuery<TestAsyncQueryInputV2, string>OnDoAsync 设置 Executed 并返回 Task.FromResult($"Value: {input.Value * 2}"),结构与其他 *V4 兄弟类一致。

GFramework.Core.Tests/Query/TestAsyncQueryResultV2.cs (1)

1-17: LGTM!

TestAsyncQueryResultV2 是不可变的复杂查询结果类型,使用 init 只读属性,并配有完整 XML 注释。提取到独立文件后符合每文件单一主类型的偏好。

GFramework.Core.Tests/Query/TestAsyncComplexQueryV4.cs (1)

1-38: LGTM!

TestAsyncComplexQueryV4 继承自 AbstractAsyncQuery<TestAsyncQueryInputV2, TestAsyncQueryResultV2>,构造转发与 OnDoAsync 实现均符合基类约定,构造的 TestAsyncQueryResultV2 同时设置 ValueDoubleValue 两个 init-only 属性,整体清晰且与其它 *V4 类风格一致。

GFramework.Core.Tests/Ioc/NonPrioritizedService.cs (1)

1-12: LGTM!

类型与成员均有 XML 注释,sealed 修饰、命名空间和命名规范均符合规范,作为测试夹具实现简洁清晰。

GFramework.Core.Tests/Ioc/PrioritizedService.cs (1)

1-17: LGTM!

PrioritizedService 通过单一隐式实现同时满足 IPrioritizedServiceIMixedServiceName 契约,并以可写的 Priority 拓展了 IPrioritized 的只读 Priority 契约(用于在测试中按需设置优先级),符合测试夹具的预期用法。注释、密封性、命名空间与命名均合规。

备注:如果采纳了 IPrioritizedService 改为继承 IMixedService 的建议,本文件无需任何改动。

GFramework.Core.Tests/Ioc/IService.cs (1)

1-6: 看起来不错!

标记接口定义正确,XML 文档完整且适当。命名遵循 C# 接口约定(I 前缀),命名空间符合 GFramework.{Module}.{Feature} 模式。

GFramework.Core.Tests/Ioc/TestService.cs (1)

6-11: TestService は基本的なサービススタブであり、[Priority] 属性は不要です。

TestService は IService インターフェイスのみを実装する最小限のテストダブルです。Priority プロパティを持つことは IService 要件ですが、[Priority] 属性は IPrioritized インターフェイスの自動生成用であり、TestService は IPrioritized を実装していません。

優先度ベースのテストが必要な場合は、PrioritizedService(IPrioritizedService を実装)が既に存在します。このクラスは設計通りで、変更は不要です。

			> Likely an incorrect or invalid review comment.
GFramework.Game/Config/YamlConfigLoader.cs (2)

472-488: LoadAsync 按语义阶段拆分得很干净,整体 LGTM。

入口流程被拆为「目录校验 → schema 加载 → 文件枚举/读取 → 引用收集 → 反序列化 → 结果构建」六个清晰阶段,命名也一致地反映了职责,符合"按语义阶段提取命名 helper 而非压制告警"的项目准则。DeserializeValue 中对 null yield 的显式守卫也避免了下游收到默认实例。

Also applies to: 490-544, 569-583, 585-614


890-896: Lock 多目标条件编译与 ContainsDependency 的 ordinal 化处理 LGTM。

  • _gate 使用 #if NET9_0_OR_GREATER 切换到 System.Threading.Lock,并保留 object 兜底,与 GameConfigBootstrap._stateGate 保持一致的 config 子系统约定。注释也清楚地说明了"分析器建议使用专用同步原语"的动机。
  • ContainsDependency 改用 string.Equals(..., StringComparison.Ordinal) 替代隐式 Contains,行为上与 _lastSuccessfulDependencies / _dependenciesByTable 中已经使用的 StringComparer.Ordinal 字典统一,避免了文化敏感比较导致的潜在 MA0002/MA0001 类告警。

Also applies to: 1196-1202

ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md (1)

3-43: Trace 内容齐全,符合 trace 文档准则。

包含当前日期 2026-04-27、活跃恢复点 RP-083、关键决策(主线程修复 + 两波 worker 拆分 + 主动停掉 ArchitectureContextTests 候选)、验证里程碑(项目级 + 仓库根 dotnet clean / dotnet build 的明确 warning/error 数)、活跃风险及下一步建议,均符合 ai-plan/public/*/traces/** 的记录要求。

As per coding guidelines, "Contributors MUST maintain a matching execution trace under ai-plan/public/<topic>/traces/ for complex work, recording the current date, key decisions, validation milestones, and the immediate next step".

ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md (1)

9-50: 跟踪文档更新完整,恢复点信息齐备。

恢复点编号 RP-083、阶段 Phase 83、当前焦点(YamlConfigLoader 单文件清理 + 两个测试拆分 slice)、活跃事实(origin/main@b6a9fef 基线 + 仓库根 397/316 → 353/279)、活跃风险(Cqrs.Tests/Mediator/*YamlConfigSchemaValidator* 高耦合热点)、以及下一步建议(提交本轮 + 优先 7-warning MA0048 切片)均已就位,足以支撑下一位 contributor / subagent 在不丢失上下文的前提下接力。

As per coding guidelines, "Tracking updates MUST reflect completed work, newly discovered issues, validation results, and the next recommended recovery point".

Also applies to: 75-77

Comment thread GFramework.Core.Tests/Ioc/IMixedService.cs
Comment thread GFramework.Core.Tests/Ioc/IPrioritizedService.cs Outdated
Comment thread GFramework.Game/Config/YamlConfigLoader.cs
- 修复 ReadYamlAsync 在取消时错误包装异常的问题,并对齐 IntegerTryParseDelegate 的可空性签名

- 更新 Ioc 与 Query 测试辅助类型的 XML 文档,并让 IPrioritizedService 复用 IMixedService 的 Name 契约

- 补充 YamlConfigLoader 取消语义回归测试并同步 analyzer warning reduction 跟踪
@github-actions
Copy link
Copy Markdown

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
2157    ↑1 2157    ↑1 0 0 0 0 36.5s    ↑4.8s

Test Results

passed 2157 passed ↑1

Details

tests 2157 tests ↑1
clock 36.5s ↑4.8s
tool nunit
build CI - Build & Test arrow-right build-and-test link #992
pull-request Fix/analyzer warning reduction batch link #297

Insights

Average Tests per Run Total Flaky Tests Total Failed Slowest Test (p95)
2150 0 3 4.7s

Fail Rate

Fail Rate 0.00%
Test 📝 Results 📊 Passed ✅ Failed ❌ Fail Rate (%) 📈
ILogAppender_Flush_Should_Raise_OnFlushCompleted_Only_Once 35 34 1 2.86    ↓0.08
RegisterMigration_During_Cache_Rebuild_Should_Not_Leave_Stale_Type_Cache 42 41 1 2.38    ↓0.06
Run_Should_Assign_Globally_Unique_Reference_Metadata_Member_Names 43 42 1 2.33    ↓0.05

build-and-test: Run #992

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Pending ⏳ Other ❓ Flaky 🍂 Duration ⏱️
2157 2157 0 0 0 0 0 36.5s

🎉 All tests passed!

Slowest Tests

Test 📝 Results 📊 Duration (avg) ⏱️ Duration (p95) ⏱️
SendRequestAsync_Should_ResolveCqrsRuntime_OnlyOnce_When_AccessedConcurrently 43 4.1s 4.7s
Does_Not_Report_When_FieldInjectedModel_Is_Registered 43 2.2s 2.4s
Generates_Scene_Behavior_Boilerplate 43 1.9s 2.0s
CleanupDuringAcquire_Should_NotCauseRaceCondition 43 1.1s 1.1s
Append_ShouldNotBlock 43 1.0s 1.0s
Flush_Should_Raise_OnFlushCompleted_With_Sender_And_Result 36 56ms 1.0s
Context_Caching_Should_Improve_Performance 43 781ms 791ms
PendingCount_ShouldReflectQueuedEntries 43 501ms 501ms
Cleanup_Should_NotRemoveActiveLocks 43 404ms 406ms
Cleanup_Should_RemoveUnusedLocks 43 401ms 402ms

± Comparison with run #991 at 88f0c60 | 🍂 No flaky tests detected across all runs. | ⏱️ Measured over 43 runs.

Github Test Reporter by CTRF 💚

@GeWuYou
Copy link
Copy Markdown
Owner Author

GeWuYou commented Apr 27, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 27, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@GeWuYou GeWuYou enabled auto-merge April 27, 2026 07:04
@GeWuYou
Copy link
Copy Markdown
Owner Author

GeWuYou commented Apr 27, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 27, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
GFramework.Game.Tests/Config/YamlConfigLoaderTests.cs (1)

2794-2829: 测试方法标记为 async Task 但没有任何 await,会触发 CS1998 警告。

外层方法体内只有同步调用与一次反射 Invoke;唯一的 await 位于传给 Assert.That 的内部 lambda 中,对外层 async 修饰符并不构成 await。考虑到本 PR 的主线目标就是 analyzer warning reduction,这里反而引入一条新的 CS1998。

建议改用更地道的 Assert.ThrowsAsync<OperationCanceledException> 直接断言异步异常,并把方法签名改回同步 void,既消除 CS1998 又比 Throws.InstanceOf<> + 异步 lambda 的写法更直接。

♻️ 建议的写法
-    [Test]
-    public async Task ReadYamlAsync_Should_Preserve_OperationCanceledException_When_Cancellation_Is_Requested()
+    [Test]
+    public void ReadYamlAsync_Should_Preserve_OperationCanceledException_When_Cancellation_Is_Requested()
     {
         CreateConfigFile(
             "monster/slime.yaml",
             """
             id: 1
             name: Slime
             hp: 10
             """);

         var loader = new YamlConfigLoader(_rootPath)
             .RegisterTable<int, MonsterConfigStub>("monster", "monster", static config => config.Id);
         var registration = GetSingleYamlTableRegistration(loader);
         var readYamlAsyncMethod = registration.GetType()
             .GetMethod("ReadYamlAsync", BindingFlags.Instance | BindingFlags.NonPublic);

         Assert.That(readYamlAsyncMethod, Is.Not.Null);

         using var cancellationTokenSource = new CancellationTokenSource();
         cancellationTokenSource.Cancel();

         // 通过反射直接命中注册项的文件读取路径,稳定回归本次取消语义修复。
         var readTask = (Task<string>)readYamlAsyncMethod!.Invoke(
             registration,
             new object?[]
             {
                 Path.Combine(_rootPath, "monster"),
                 Path.Combine(_rootPath, "monster", "slime.yaml"),
                 null,
                 cancellationTokenSource.Token
             })!;

-        Assert.That(
-            async () => await readTask.ConfigureAwait(false),
-            Throws.InstanceOf<OperationCanceledException>());
+        Assert.ThrowsAsync<OperationCanceledException>(async () => await readTask.ConfigureAwait(false));
     }

As per coding guidelines: "Treat Meziantou.Analyzer feedback as part of the coding standard in C#" 以及"Match existing async patterns and naming conventions with Async suffix for asynchronous methods in C#"(此处由于无真正 await,方法应保持同步签名)。

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@GFramework.Game.Tests/Config/YamlConfigLoaderTests.cs` around lines 2794 -
2829, The test method is async but contains no awaits (CS1998); make it
synchronous by removing the async modifier and changing the signature back to
void for
ReadYamlAsync_Should_Preserve_OperationCanceledException_When_Cancellation_Is_Requested,
and replace the Assert.That(async () => await readTask.ConfigureAwait(false),
Throws.InstanceOf<OperationCanceledException>()) with a direct NUnit async
assertion: Assert.ThrowsAsync<OperationCanceledException>(() => readTask) so the
test asserts the canceled task correctly without an outer async method.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@GFramework.Game.Tests/Config/YamlConfigLoaderTests.cs`:
- Around line 2794-2829: The test method is async but contains no awaits
(CS1998); make it synchronous by removing the async modifier and changing the
signature back to void for
ReadYamlAsync_Should_Preserve_OperationCanceledException_When_Cancellation_Is_Requested,
and replace the Assert.That(async () => await readTask.ConfigureAwait(false),
Throws.InstanceOf<OperationCanceledException>()) with a direct NUnit async
assertion: Assert.ThrowsAsync<OperationCanceledException>(() => readTask) so the
test asserts the canceled task correctly without an outer async method.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 03278898-a875-43c9-b7d3-4e1705709e78

📥 Commits

Reviewing files that changed from the base of the PR and between a9904a3 and 686647c.

📒 Files selected for processing (8)
  • GFramework.Core.Tests/Ioc/IMixedService.cs
  • GFramework.Core.Tests/Ioc/IPrioritizedService.cs
  • GFramework.Core.Tests/Ioc/PrioritizedService.cs
  • GFramework.Core.Tests/Query/TestAsyncQueryWithExceptionV4.cs
  • GFramework.Game.Tests/Config/YamlConfigLoaderTests.cs
  • GFramework.Game/Config/YamlConfigLoader.cs
  • ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
  • ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
✅ Files skipped from review due to trivial changes (1)
  • GFramework.Core.Tests/Ioc/PrioritizedService.cs
🚧 Files skipped from review as they are similar to previous changes (3)
  • GFramework.Core.Tests/Ioc/IMixedService.cs
  • GFramework.Core.Tests/Query/TestAsyncQueryWithExceptionV4.cs
  • GFramework.Game/Config/YamlConfigLoader.cs
📜 Review details
🧰 Additional context used
📓 Path-based instructions (3)
**/*.cs

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.cs: Apply [Log] attribute for automatic logging field and logging helper method generation
Apply [Priority] attribute for automatic priority comparison implementation generation
Apply [GenerateEnumExtensions] attribute to generate enumeration extension capabilities
Apply [ContextAware] attribute to automatically implement IContextAware boilerplate logic

**/*.cs: All public, protected, and internal types and members MUST include XML documentation comments (///) with <summary>, <param>, <returns>, <exception>, and <remarks> where applicable
Add inline comments for non-trivial logic, concurrency/threading behavior, performance-sensitive paths, workarounds, edge cases, registration order, lifecycle sequencing, and generated code assumptions
Core framework components such as Architecture, Module, System, Context, Registry, Service Module, and Lifecycle types MUST include high-level explanations of responsibilities, lifecycle, interactions, why the abstraction exists, and when to use it
Generated logic and generator pipelines MUST explain what is generated, why it is generated, semantic assumptions, and diagnostics or fallback behavior
Methods with non-trivial logic MUST document the core idea, key decisions, and edge case handling
Do not rely on implicit imports; declare every required using explicitly in C# files
Write null-safe code that respects nullable annotations instead of suppressing warnings by default
Use the namespace pattern GFramework.{Module}.{Feature} with PascalCase segments in C# files
Follow standard C# naming: types/methods/properties/events/constants in PascalCase, interfaces with I prefix, parameters and locals in camelCase, private fields in _camelCase
Use 4 spaces for indentation in C# files; do not use tabs
Use Allman braces in C# files
Keep using directives at the top of C# files and sort them consistently
Prefer one primary type per C# file unless the surrounding project already uses a different local pattern
Keep...

Files:

  • GFramework.Core.Tests/Ioc/IPrioritizedService.cs
  • GFramework.Game.Tests/Config/YamlConfigLoaderTests.cs
ai-plan/public/*/traces/**

📄 CodeRabbit inference engine (AGENTS.md)

Contributors MUST maintain a matching execution trace under ai-plan/public/<topic>/traces/ for complex work, recording the current date, key decisions, validation milestones, and the immediate next step

Files:

  • ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md
ai-plan/public/*/todos/**

📄 CodeRabbit inference engine (AGENTS.md)

ai-plan/public/*/todos/**: When working from a tracked implementation plan, contributors MUST update the corresponding tracking document under ai-plan/public/<topic>/todos/ in the same change
Tracking updates MUST reflect completed work, newly discovered issues, validation results, and the next recommended recovery point
Active tracking and trace files are recovery entrypoints, not append-only changelogs; they MUST stay concise enough for boot to locate the current recovery point quickly
Recovery documents MUST record the current phase, the active recovery point identifier, known risks, and the next recommended resume step so another contributor or subagent can continue the work safely
When completed and validated stages begin to accumulate, contributors MUST archive their detailed history out of the active todos/ and traces/ entry files in the same change, keeping only the current recovery point, active facts, active risks, immediate next step, and pointers to archive files
When a task spans multiple commits or is likely to exceed a single agent context window, update both the recovery document and the trace at each meaningful milestone before pausing or handing work off
If subagents are used on a complex task, the main agent MUST capture the delegated scope and any accepted findings in the active recovery document or trace before continuing implementation

Files:

  • ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
🧠 Learnings (7)
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.cs : Public API changes must be covered by unit or integration tests in C#

Applied to files:

  • GFramework.Core.Tests/Ioc/IPrioritizedService.cs
📚 Learning: 2026-04-06T12:45:43.921Z
Learnt from: GeWuYou
Repo: GeWuYou/GFramework PR: 190
File: GFramework.Game/Config/GameConfigBootstrap.cs:1-3
Timestamp: 2026-04-06T12:45:43.921Z
Learning: In the GeWuYou/GFramework repository, C# files may omit explicit `using System*` imports because the project-wide `GlobalUsings.cs` (referenced via manual global `using` directives) supplies common namespaces (e.g., `System`, `System.Threading`, `System.Threading.Tasks`). During code review, do not flag missing `using System...` directives in `.cs` files as long as `GlobalUsings.cs` is present/used to provide those namespaces.

Applied to files:

  • GFramework.Core.Tests/Ioc/IPrioritizedService.cs
  • GFramework.Game.Tests/Config/YamlConfigLoaderTests.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.Tests.cs : Regression fixes should include a test that fails before the fix and passes after it

Applied to files:

  • GFramework.Game.Tests/Config/YamlConfigLoaderTests.cs
📚 Learning: 2026-04-16T13:26:01.780Z
Learnt from: GeWuYou
Repo: GeWuYou/GFramework PR: 235
File: GFramework.SourceGenerators.Tests/Rule/ContextAwareGeneratorSnapshotTests.cs:1-3
Timestamp: 2026-04-16T13:26:01.780Z
Learning: In the GeWuYou/GFramework repository, the test project `GFramework.SourceGenerators.Tests` provides `global using NUnit.Framework;` via its `GlobalUsings.cs`. Do not flag missing `using NUnit.Framework;` directives in test files within this project, as the global using already covers it. The project-wide GlobalUsings.cs pattern is used broadly to supply common namespaces (including NUnit, System.IO, etc.) without per-file imports.

Applied to files:

  • GFramework.Game.Tests/Config/YamlConfigLoaderTests.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to ai-plan/public/*/todos/** : Tracking updates MUST reflect completed work, newly discovered issues, validation results, and the next recommended recovery point

Applied to files:

  • ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: For any multi-step refactor, migration, or cross-module task, contributors MUST create or adopt a dedicated recovery document under `ai-plan/public/<topic>/todos/` before making substantive code changes

Applied to files:

  • ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.cs : Any change to public API, lifecycle semantics, module behavior, or extension points MUST update the related XML docs

Applied to files:

  • ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md
🪛 LanguageTool
ai-plan/public/analyzer-warning-reduction/traces/analyzer-warning-reduction-trace.md

[grammar] ~11-~11: Ensure spelling is correct
Context: ...的原始取消语义,并把 IntegerTryParseDelegate<T> 第一个参数改为 string? - 校验 GFramework.Core.Tests/Ioc/* 与 `Query/...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

ai-plan/public/analyzer-warning-reduction/todos/analyzer-warning-reduction-tracking.md

[grammar] ~70-~70: Ensure spelling is correct
Context: ... #297 review follow-up 与 ai-plan 同步。 2. 下一波优先挑选 ArchitectureContextTests.cs 或 `AsyncQ...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)


[grammar] ~72-~72: Ensure spelling is correct
Context: ...。 3. 继续将 YamlConfigSchemaValidator*GFramework.Cqrs.Tests/Mediator/* 作为独立高风险波次处理。

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🔇 Additional comments (2)
GFramework.Core.Tests/Ioc/IPrioritizedService.cs (1)

1-10: LGTM!接口组合设计清晰。

通过同时继承 IPrioritizedIMixedServiceIPrioritizedService 复用了已具备 XML 文档注释的 PriorityName 契约,避免了成员重复声明,也修复了此前对 Name 缺少 XML 注释的告警。命名空间、命名规范、XML 注释、using 声明均符合规范。

GFramework.Game.Tests/Config/YamlConfigLoaderTests.cs (1)

3419-3433: LGTM。

通过反射定位单一 _registrations 项并校验数量,便于从私有注册管道直击 ReadYamlAsync 路径。System.Collections.IList 用作非泛型解包也合理;如果想避免内联完全限定名,可在文件顶部补一行 using System.Collections;,但这是可选项。

- 修复取消读取回归测试的外层 async Task 签名,消除没有 await 的编译警告
- 优化异步异常断言,继续验证取消流程会保留 OperationCanceledException 语义
@github-actions
Copy link
Copy Markdown

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
2157 2157 0 0 0 0 36.7s    ↑173ms

Test Results

passed 2157 passed

Details

tests 2157 tests
clock 36.7s ↑173ms
tool nunit
build CI - Build & Test arrow-right build-and-test link #993
pull-request Fix/analyzer warning reduction batch link #297

Insights

Average Tests per Run Total Flaky Tests Total Failed Slowest Test (p95)
2150 0 3 4.7s

Fail Rate

Fail Rate 0.00%
Test 📝 Results 📊 Passed ✅ Failed ❌ Fail Rate (%) 📈
ILogAppender_Flush_Should_Raise_OnFlushCompleted_Only_Once 36 35 1 2.78    ↓0.08
RegisterMigration_During_Cache_Rebuild_Should_Not_Leave_Stale_Type_Cache 43 42 1 2.33    ↓0.05
Run_Should_Assign_Globally_Unique_Reference_Metadata_Member_Names 44 43 1 2.27    ↓0.06

build-and-test: Run #993

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Pending ⏳ Other ❓ Flaky 🍂 Duration ⏱️
2157 2157 0 0 0 0 0 36.7s

🎉 All tests passed!

Slowest Tests

Test 📝 Results 📊 Duration (avg) ⏱️ Duration (p95) ⏱️
SendRequestAsync_Should_ResolveCqrsRuntime_OnlyOnce_When_AccessedConcurrently 44 4.1s 4.7s
Does_Not_Report_When_FieldInjectedModel_Is_Registered 44 2.2s 2.4s
Generates_Scene_Behavior_Boilerplate 44 1.9s 2.0s
CleanupDuringAcquire_Should_NotCauseRaceCondition 44 1.1s 1.1s
Append_ShouldNotBlock 44 1.0s 1.0s
Flush_Should_Raise_OnFlushCompleted_With_Sender_And_Result 37 55ms 1.0s
Context_Caching_Should_Improve_Performance 44 781ms 791ms
PendingCount_ShouldReflectQueuedEntries 44 501ms 501ms
Cleanup_Should_NotRemoveActiveLocks 44 404ms 406ms
Cleanup_Should_RemoveUnusedLocks 44 401ms 402ms

± Comparison with run #992 at f63c5c7 | 🍂 No flaky tests detected across all runs. | ⏱️ Measured over 44 runs.

Github Test Reporter by CTRF 💚

- 修复 YAML 同步反序列化与构表阶段的取消处理,避免已取消会话被包装为配置加载失败
- 补充私有同步路径的回归测试,覆盖反序列化与构表阶段的 OperationCanceledException 透传语义
@github-actions
Copy link
Copy Markdown

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
2159    ↑2 2159    ↑2 0 0 0 0 36.7s    ↓1ms

Test Results

passed 2159 passed ↑2

Details

tests 2159 tests ↑2
clock 36.7s ↓1ms
tool nunit
build CI - Build & Test arrow-right build-and-test link #994
pull-request Fix/analyzer warning reduction batch link #297

Insights

Average Tests per Run Total Flaky Tests Total Failed Slowest Test (p95)
2150 0 3 4.7s

Fail Rate

Fail Rate 0.00%
Test 📝 Results 📊 Passed ✅ Failed ❌ Fail Rate (%) 📈
ILogAppender_Flush_Should_Raise_OnFlushCompleted_Only_Once 37 36 1 2.70    ↓0.08
RegisterMigration_During_Cache_Rebuild_Should_Not_Leave_Stale_Type_Cache 44 43 1 2.27    ↓0.06
Run_Should_Assign_Globally_Unique_Reference_Metadata_Member_Names 45 44 1 2.22    ↓0.05

build-and-test: Run #994

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Pending ⏳ Other ❓ Flaky 🍂 Duration ⏱️
2159 2159 0 0 0 0 0 36.7s

🎉 All tests passed!

Slowest Tests

Test 📝 Results 📊 Duration (avg) ⏱️ Duration (p95) ⏱️
SendRequestAsync_Should_ResolveCqrsRuntime_OnlyOnce_When_AccessedConcurrently 45 4.1s 4.7s
Does_Not_Report_When_FieldInjectedModel_Is_Registered 45 2.2s 2.4s
Generates_Scene_Behavior_Boilerplate 45 1.9s 2.0s
CleanupDuringAcquire_Should_NotCauseRaceCondition 45 1.1s 1.1s
Append_ShouldNotBlock 45 1.0s 1.0s
Flush_Should_Raise_OnFlushCompleted_With_Sender_And_Result 38 53ms 1.0s
Context_Caching_Should_Improve_Performance 45 781ms 791ms
PendingCount_ShouldReflectQueuedEntries 45 501ms 501ms
Cleanup_Should_NotRemoveActiveLocks 45 404ms 406ms
Cleanup_Should_RemoveUnusedLocks 45 401ms 402ms

± Comparison with run #993 at 37ae05e | 🍂 No flaky tests detected across all runs. | ⏱️ Measured over 45 runs.

Github Test Reporter by CTRF 💚

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
GFramework.Game.Tests/Config/YamlConfigLoaderTests.cs (2)

3510-3510: 可改用 using 导入 System.Collections.IList,避免在方法体中内联完整命名空间。

文件其余位置未出现 System.Collections.* 的内联限定名,仅本处使用了完整命名空间前缀。可在文件顶部添加 using System.Collections; 以保持风格一致。

♻️ 建议替换为短名引用
-        var registrations = registrationsField!.GetValue(loader) as System.Collections.IList;
+        var registrations = registrationsField!.GetValue(loader) as IList;

并在文件顶部添加 using System.Collections;

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@GFramework.Game.Tests/Config/YamlConfigLoaderTests.cs` at line 3510, Replace
the inline fully-qualified type usage with the short name by adding "using
System.Collections;" to the file header and updating the expression that obtains
the registrations to use IList (i.e. change "System.Collections.IList" to
"IList"); specifically update the line that assigns registrations from
registrationsField.GetValue(loader) to cast to IList and ensure the new using is
present so the short type name resolves.

3502-3516: 建议为 GetSingleYamlTableRegistration 补充 XML 文档注释,与同文件其他私有辅助方法保持一致。

文件中其他私有辅助方法(如 CreateConfigFileCreateSchemaFileWaitForTaskWithinAsyncAssertMonsterHotReloadUpdated)均有 <summary><param> 注释,唯独本助手缺失。虽然 private 成员不在强制 XML 文档要求范围内,但保持文件内一致性更利于后续维护。

♻️ 建议补充文档注释
+    /// <summary>
+    ///     反射读取加载器内部 <c>_registrations</c> 字段并断言只有一项注册,便于取消语义测试稳定命中目标注册项。
+    /// </summary>
+    /// <param name="loader">已注册唯一配置表的加载器。</param>
+    /// <returns>唯一的 YAML 表注册项实例。</returns>
     private static object GetSingleYamlTableRegistration(YamlConfigLoader loader)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@GFramework.Game.Tests/Config/YamlConfigLoaderTests.cs` around lines 3502 -
3516, GetSingleYamlTableRegistration is missing the XML documentation that other
private helpers in the file have; add a <summary> describing that it reflects
into YamlConfigLoader to retrieve the single registration, and a <returns>
describing the returned registration object, and include a <param name="loader">
describing the loader argument so the method matches the file's documentation
style (follow the format used by
CreateConfigFile/CreateSchemaFile/WaitForTaskWithinAsync).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@GFramework.Game.Tests/Config/YamlConfigLoaderTests.cs`:
- Line 3510: Replace the inline fully-qualified type usage with the short name
by adding "using System.Collections;" to the file header and updating the
expression that obtains the registrations to use IList (i.e. change
"System.Collections.IList" to "IList"); specifically update the line that
assigns registrations from registrationsField.GetValue(loader) to cast to IList
and ensure the new using is present so the short type name resolves.
- Around line 3502-3516: GetSingleYamlTableRegistration is missing the XML
documentation that other private helpers in the file have; add a <summary>
describing that it reflects into YamlConfigLoader to retrieve the single
registration, and a <returns> describing the returned registration object, and
include a <param name="loader"> describing the loader argument so the method
matches the file's documentation style (follow the format used by
CreateConfigFile/CreateSchemaFile/WaitForTaskWithinAsync).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d1cc3f67-ecde-4869-8ce6-8635ca734e1f

📥 Commits

Reviewing files that changed from the base of the PR and between 686647c and 1753778.

📒 Files selected for processing (2)
  • GFramework.Game.Tests/Config/YamlConfigLoaderTests.cs
  • GFramework.Game/Config/YamlConfigLoader.cs
📜 Review details
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Analyze (C#)
  • GitHub Check: Code Quality & Security
  • GitHub Check: Build and Test
🧰 Additional context used
📓 Path-based instructions (1)
**/*.cs

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.cs: Apply [Log] attribute for automatic logging field and logging helper method generation
Apply [Priority] attribute for automatic priority comparison implementation generation
Apply [GenerateEnumExtensions] attribute to generate enumeration extension capabilities
Apply [ContextAware] attribute to automatically implement IContextAware boilerplate logic

**/*.cs: All public, protected, and internal types and members MUST include XML documentation comments (///) with <summary>, <param>, <returns>, <exception>, and <remarks> where applicable
Add inline comments for non-trivial logic, concurrency/threading behavior, performance-sensitive paths, workarounds, edge cases, registration order, lifecycle sequencing, and generated code assumptions
Core framework components such as Architecture, Module, System, Context, Registry, Service Module, and Lifecycle types MUST include high-level explanations of responsibilities, lifecycle, interactions, why the abstraction exists, and when to use it
Generated logic and generator pipelines MUST explain what is generated, why it is generated, semantic assumptions, and diagnostics or fallback behavior
Methods with non-trivial logic MUST document the core idea, key decisions, and edge case handling
Do not rely on implicit imports; declare every required using explicitly in C# files
Write null-safe code that respects nullable annotations instead of suppressing warnings by default
Use the namespace pattern GFramework.{Module}.{Feature} with PascalCase segments in C# files
Follow standard C# naming: types/methods/properties/events/constants in PascalCase, interfaces with I prefix, parameters and locals in camelCase, private fields in _camelCase
Use 4 spaces for indentation in C# files; do not use tabs
Use Allman braces in C# files
Keep using directives at the top of C# files and sort them consistently
Prefer one primary type per C# file unless the surrounding project already uses a different local pattern
Keep...

Files:

  • GFramework.Game.Tests/Config/YamlConfigLoaderTests.cs
  • GFramework.Game/Config/YamlConfigLoader.cs
🧠 Learnings (6)
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.Tests.cs : Regression fixes should include a test that fails before the fix and passes after it

Applied to files:

  • GFramework.Game.Tests/Config/YamlConfigLoaderTests.cs
📚 Learning: 2026-04-16T13:26:01.780Z
Learnt from: GeWuYou
Repo: GeWuYou/GFramework PR: 235
File: GFramework.SourceGenerators.Tests/Rule/ContextAwareGeneratorSnapshotTests.cs:1-3
Timestamp: 2026-04-16T13:26:01.780Z
Learning: In the GeWuYou/GFramework repository, the test project `GFramework.SourceGenerators.Tests` provides `global using NUnit.Framework;` via its `GlobalUsings.cs`. Do not flag missing `using NUnit.Framework;` directives in test files within this project, as the global using already covers it. The project-wide GlobalUsings.cs pattern is used broadly to supply common namespaces (including NUnit, System.IO, etc.) without per-file imports.

Applied to files:

  • GFramework.Game.Tests/Config/YamlConfigLoaderTests.cs
  • GFramework.Game/Config/YamlConfigLoader.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.Tests.cs : Preserve snapshot-based verification patterns already used in the repository for source generator tests

Applied to files:

  • GFramework.Game.Tests/Config/YamlConfigLoaderTests.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.Tests.cs : Mirror the source structure in test projects whenever practical

Applied to files:

  • GFramework.Game.Tests/Config/YamlConfigLoaderTests.cs
📚 Learning: 2026-04-26T03:16:48.230Z
Learnt from: CR
Repo: GeWuYou/GFramework PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-26T03:16:48.230Z
Learning: Applies to **/*.Tests.cs : Reuse existing architecture test infrastructure when relevant: `ArchitectureTestsBase<T>`, `SyncTestArchitecture`, `AsyncTestArchitecture`

Applied to files:

  • GFramework.Game.Tests/Config/YamlConfigLoaderTests.cs
📚 Learning: 2026-04-06T12:45:43.921Z
Learnt from: GeWuYou
Repo: GeWuYou/GFramework PR: 190
File: GFramework.Game/Config/GameConfigBootstrap.cs:1-3
Timestamp: 2026-04-06T12:45:43.921Z
Learning: In the GeWuYou/GFramework repository, C# files may omit explicit `using System*` imports because the project-wide `GlobalUsings.cs` (referenced via manual global `using` directives) supplies common namespaces (e.g., `System`, `System.Threading`, `System.Threading.Tasks`). During code review, do not flag missing `using System...` directives in `.cs` files as long as `GlobalUsings.cs` is present/used to provide those namespaces.

Applied to files:

  • GFramework.Game.Tests/Config/YamlConfigLoaderTests.cs
  • GFramework.Game/Config/YamlConfigLoader.cs
🔇 Additional comments (8)
GFramework.Game.Tests/Config/YamlConfigLoaderTests.cs (1)

2790-2912: 新增取消语义回归测试覆盖到位。

三个新增测试通过反射分别覆盖 ReadYamlAsync(异步路径,原始 OCE 直接透传)、DeserializeValueBuildLoadResult(同步路径,OCE 包装为 TargetInvocationException.InnerException)。参数顺序与 YamlConfigLoader 中的实际私有方法签名匹配,对失败前修复后通过的回归场景保护良好,符合 **/*.Tests.cs 学习中"回归修复需要先失败后通过的测试"的要求。

GFramework.Game/Config/YamlConfigLoader.cs (7)

472-488: LoadAsync 拆分为语义阶段助手的重构干净到位。

GetValidatedDirectoryPath / LoadSchemaAsync / LoadValuesAsync / BuildLoadResult 划分流水线,与编码规范中"按语义阶段(解析、规范化、校验、诊断)抽取命名助手以替代抑制复杂度警告"的指导一致;每个阶段都贯通同一个 cancellationToken,与新的取消语义测试形成稳定耦合。

As per coding guidelines: "When a C# method approaches analyzer complexity limits, extract named helper methods by semantic phase (parsing, normalization, validation, diagnostics) instead of silencing the warning"


546-572: ReadYamlAsync 新增 OCE 透传守卫已修复历史问题。

catch (OperationCanceledException) when (cancellationToken.IsCancellationRequested) 出现在通用 catch (Exception) 之前,能保留请求 token 的取消语义;附带的中文注释清晰说明了"避免热重载把会话级取消误报为配置读取失败"的意图,与 ReloadTableAsync(第 1169 行)的 catch (OperationCanceledException) 过滤器配合形成正确控制流。


590-626: DeserializeValue 取消透传修复完整。

第 600 行的 ThrowIfCancellationRequested() 与第 609 行的 OCE 过滤器配合,使同步反序列化阶段在已取消时直接抛出原始 OCE,反射调用时则被包装为 TargetInvocationException.InnerException——新增的 DeserializeValue_Should_Preserve_OperationCanceledException_When_Cancellation_Is_Requested 测试正好覆盖此路径。


628-660: BuildLoadResult 取消透传修复完整。

构表阶段的 OCE 守卫与对应回归测试 BuildLoadResult_Should_Preserve_OperationCanceledException_When_Cancellation_Is_Requested 形成稳定保护,避免提交前取消被错误归类为 TableBuildFailed

@GeWuYou GeWuYou merged commit 7cfdd2c into main Apr 27, 2026
6 checks passed
@GeWuYou GeWuYou deleted the fix/analyzer-warning-reduction-batch branch April 27, 2026 08:59
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.

1 participant