Add namespace to MapXxxEndpoints - #327
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (27)
📝 WalkthroughWalkthroughThe generator now reads ChangesRoot Namespace Generation
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
This PR updates the Immediate.Apis source generator so the generated MapXxxEndpoints extension class can be emitted into a configured root namespace (instead of the global namespace), and aligns the generator tests/snapshots accordingly.
Changes:
- Read
build_property.rootnamespacefromAnalyzerConfigOptionsProvider.GlobalOptionsand pass it into theMapEndpointstemplate asNamespace. - Update generator test harness to provide a root namespace via an
AnalyzerConfigOptionsProvider, and track the new incremental step (RootNamespace). - Refresh verified generator snapshots (net8/net9/net10/net11) to include the new generated
namespace Immediate.Apis.Testing;header.
Reviewed changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/SimpleApiTests.MapMethodTagsTest_framework=net9.0#IH.ServiceCollectionExtensions.g.verified.cs | Snapshot updated to include generated namespace header. |
| tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/SimpleApiTests.MapMethodTagsTest_framework=net9.0#IA.MapEndpoints.g.verified.cs | Snapshot updated to include generated namespace header for MapEndpoints output. |
| tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/SimpleApiTests.MapMethodTagsTest_framework=net8.0#IH.ServiceCollectionExtensions.g.verified.cs | Snapshot updated to include generated namespace header. |
| tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/SimpleApiTests.MapMethodTagsTest_framework=net8.0#IA.MapEndpoints.g.verified.cs | Snapshot updated to include generated namespace header for MapEndpoints output. |
| tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/SimpleApiTests.MapMethodTagsTest_framework=net11.0#IH.ServiceCollectionExtensions.g.verified.cs | Snapshot updated to include generated namespace header. |
| tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/SimpleApiTests.MapMethodTagsTest_framework=net11.0#IA.MapEndpoints.g.verified.cs | Snapshot updated to include generated namespace header for MapEndpoints output. |
| tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/SimpleApiTests.MapMethodTagsTest_framework=net10.0#IH.ServiceCollectionExtensions.g.verified.cs | Snapshot updated to include generated namespace header. |
| tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/SimpleApiTests.MapMethodTagsTest_framework=net10.0#IA.MapEndpoints.g.verified.cs | Snapshot updated to include generated namespace header for MapEndpoints output. |
| tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/RouteGroupTests.TaggedRouteGroupTest_framework=net9.0#IH.ServiceCollectionExtensions.g.verified.cs | Snapshot updated to include generated namespace header. |
| tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/RouteGroupTests.TaggedRouteGroupTest_framework=net9.0#IA.MapEndpoints.g.verified.cs | Snapshot updated to include generated namespace header for MapEndpoints output. |
| tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/RouteGroupTests.TaggedRouteGroupTest_framework=net8.0#IH.ServiceCollectionExtensions.g.verified.cs | Snapshot updated to include generated namespace header. |
| tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/RouteGroupTests.TaggedRouteGroupTest_framework=net8.0#IA.MapEndpoints.g.verified.cs | Snapshot updated to include generated namespace header for MapEndpoints output. |
| tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/RouteGroupTests.TaggedRouteGroupTest_framework=net11.0#IH.ServiceCollectionExtensions.g.verified.cs | Snapshot updated to include generated namespace header. |
| tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/RouteGroupTests.TaggedRouteGroupTest_framework=net11.0#IA.MapEndpoints.g.verified.cs | Snapshot updated to include generated namespace header for MapEndpoints output. |
| tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/RouteGroupTests.TaggedRouteGroupTest_framework=net10.0#IH.ServiceCollectionExtensions.g.verified.cs | Snapshot updated to include generated namespace header. |
| tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/RouteGroupTests.TaggedRouteGroupTest_framework=net10.0#IA.MapEndpoints.g.verified.cs | Snapshot updated to include generated namespace header for MapEndpoints output. |
| tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/MapEndpointsTests.ValidAddServicesMethod_framework=net9.0#IH.ServiceCollectionExtensions.g.verified.cs | Snapshot updated to include generated namespace header. |
| tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/MapEndpointsTests.ValidAddServicesMethod_framework=net9.0#IA.MapEndpoints.g.verified.cs | Snapshot updated to include generated namespace header for MapEndpoints output. |
| tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/MapEndpointsTests.ValidAddServicesMethod_framework=net8.0#IH.ServiceCollectionExtensions.g.verified.cs | Snapshot updated to include generated namespace header. |
| tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/MapEndpointsTests.ValidAddServicesMethod_framework=net8.0#IA.MapEndpoints.g.verified.cs | Snapshot updated to include generated namespace header for MapEndpoints output. |
| tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/MapEndpointsTests.ValidAddServicesMethod_framework=net11.0#IH.ServiceCollectionExtensions.g.verified.cs | Snapshot updated to include generated namespace header. |
| tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/MapEndpointsTests.ValidAddServicesMethod_framework=net11.0#IA.MapEndpoints.g.verified.cs | Snapshot updated to include generated namespace header for MapEndpoints output. |
| tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/MapEndpointsTests.ValidAddServicesMethod_framework=net10.0#IH.ServiceCollectionExtensions.g.verified.cs | Snapshot updated to include generated namespace header. |
| tests/Immediate.Apis.Tests/GeneratorTests/Snapshots/MapEndpointsTests.ValidAddServicesMethod_framework=net10.0#IA.MapEndpoints.g.verified.cs | Snapshot updated to include generated namespace header for MapEndpoints output. |
| tests/Immediate.Apis.Tests/GeneratorTests/GeneratorTestHelper.cs | Test harness now provides RootNamespace via analyzer config options and tracks the new step. |
| src/Immediate.Apis.Generators/ImmediateApisGenerator.Render.cs | MapEndpoints rendering now receives a namespace and forwards it into the template model. |
| src/Immediate.Apis.Generators/ImmediateApisGenerator.cs | Generator now reads build_property.rootnamespace and combines it into the MapEndpoints pipeline. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Coverage Report for CI Build 30654525199Coverage increased (+0.02%) to 96.348%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
Summary by CodeRabbit
New Features
Bug Fixes
Tests