Skip to content

Generate only the types used by service signatures in C# client proxies - #26205

Open
maliming wants to merge 3 commits into
devfrom
maliming/csharp-proxy-types
Open

maliming wants to merge 3 commits into
devfrom
maliming/csharp-proxy-types

Conversation

@maliming

Copy link
Copy Markdown
Member

CSharpServiceProxyGenerator now generates the DTOs and enums reachable from the service signatures instead of every type under the service namespace, so a client without the *.Application.Contracts reference compiles.

System.*, Microsoft.* and Volo.* types come from their packages and are no longer generated, same-named types are referenced by their full names, and regenerating removes the generated files that are no longer needed.

Copilot AI lite review requested due to automatic review settings September 23, 2026 07:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Two critical and two moderate issues remain unresolved.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 2 High severity · 1 Medium severity

Open (3)
What changed in this PR

Updates C# proxy generation to emit only types reachable from service signatures and remove obsolete generated files.

Changes:

  • Adds recursive type discovery and framework-type filtering.
  • Handles generic and ambiguous type references.
  • Expands tests for regeneration, naming, and casing behavior.
File Summary
framework/​test/​Volo.Abp.Cli.Core.Tests/​Volo/​Abp/​Cli/​ServiceProxying/​CSharp/​CSharpServiceProxyGenerator_Tests.cs Tests selective generation and cleanup. Moderate issue (1 vote): casing-only file moves may fail on case-insensitive filesystems.
framework/​src/​Volo.Abp.Cli.Core/​Volo/​Abp/​Cli/​ServiceProxying/​CSharp/​CSharpServiceProxyGenerator.cs Implements selective generation, filtering, qualification, and cleanup. Critical issues (3 votes, 1 vote): incompatible StringComparer API and invalid nested-type name generation. Moderate issue (3 votes): ambiguity detection omits signature types when contracts are excluded.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@maliming
maliming requested a lite review from Copilot September 23, 2026 07:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@codecov

codecov Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.20000% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.29%. Comparing base (c80c6f8) to head (2f1ef6d).
⚠️ Report is 26 commits behind head on dev.

Files with missing lines Patch % Lines
...viceProxying/CSharp/CSharpServiceProxyGenerator.cs 93.20% 12 Missing and 5 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev   #26205      +/-   ##
==========================================
+ Coverage   49.90%   50.29%   +0.38%     
==========================================
  Files        3842     3842              
  Lines      135458   135607     +149     
  Branches    10271    10295      +24     
==========================================
+ Hits        67597    68198     +601     
+ Misses      65823    65346     -477     
- Partials     2038     2063      +25     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

2 participants