Skip to content

Conversation

@mkholt
Copy link
Member

@mkholt mkholt commented Nov 26, 2025

This pull request introduces significant improvements to documentation, developer experience, and configuration for the XrmPluginCore project. The most notable changes are the addition and thorough documentation of the new XrmPluginCore.SourceGenerator library, which provides compile-time type safety for plugin images, and enhanced instructions for dependency injection patterns. There are also updates to project configuration files to improve code style enforcement and expand allowed CLI commands.

Source Generator and Type-Safe Images:

  • Added documentation and usage examples for the new XrmPluginCore.SourceGenerator library, which generates type-safe wrapper classes for PreImage and PostImage parameters, enabling compile-time enforcement and IntelliSense support for plugin handlers. [1] [2] [3] [4]
  • Explained API design, benefits, generated code structure, and error diagnostics for image registration methods (WithPreImage, WithPostImage, AddImage). [1] [2]

Dependency Injection Patterns:

  • Expanded documentation to describe three DI registration patterns: direct override, base class inheritance, and extension method composition, with code samples and usage guidance.

Project Configuration and Permissions:

  • Updated .claude/settings.local.json to allow additional CLI commands (dotnet restore, dotnet clean, dotnet msbuild, dotnet pack, dotnet list, and common shell commands) and set outputStyle to "default".
  • Modified .editorconfig to enforce final newlines at the end of files and added a dedicated .editorconfig for the source generator test project to suppress specific warnings. [1] [2]

Documentation and Compatibility:

  • Updated README.md and CLAUDE.md to reflect new features, supported .NET versions, and improved explanations for plugin creation, DI, and image handling. Added badges for .NET Framework 4.6.2 and .NET 8 support. [1] [2]
  • Added notes on ILRepack/ILMerge usage for plugin deployment and clarified Microsoft support status.

Service Injection:

  • Documented support for IManagedIdentityService for Azure resource access using Managed Identity.

@mkholt mkholt requested a review from Copilot November 26, 2025 07:55
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a source generator library (XrmPluginCore.SourceGenerator) that provides compile-time type safety for plugin images (PreImage/PostImage) through automated wrapper class generation. The feature enables developers to access image attributes with IntelliSense support and compile-time validation of handler method signatures.

Key changes:

  • New source generator library with incremental generation support
  • Method reference-based registration API (service => service.HandleUpdate) with compile-time signature validation
  • Convenience methods WithPreImage/WithPostImage for type-safe image registration
  • Runtime action wrapper discovery via naming convention
  • Comprehensive test coverage (~30 tests) using hybrid compiled execution and snapshot testing

Reviewed changes

Copilot reviewed 43 out of 43 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
XrmPluginCore.csproj Packages source generator as analyzer for NuGet distribution
Plugin.cs Adds action wrapper discovery, signature validation, and registration metadata
PluginStepConfigBuilder.cs Adds WithPreImage/WithPostImage convenience methods
PluginStepRegistration.cs Adds metadata properties for wrapper generation and discovery
IEntityImageWrapper.cs, IActionWrapper.cs New interfaces for generated wrappers
XrmPluginCore.SourceGenerator/* Complete source generator implementation with parsers, validators, and code generators
XrmPluginCore.SourceGenerator.Tests/* Comprehensive test suite with ~30 tests covering parsing, generation, compilation, and diagnostics
XrmPluginCore.Tests/* Integration tests for type-safe plugin execution
README.md, CLAUDE.md Updated documentation with type-safe images usage and patterns
.editorconfig Enforces final newlines for consistency

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI commented Nov 26, 2025

@mkholt I've opened a new pull request, #3, to work on those changes. Once the pull request is ready, I'll request review from you.

mkholt and others added 14 commits November 26, 2025 09:04
…aversal (#3)

* REFACTOR: Materialize inheritance chain results for better caching

Co-authored-by: mkholt <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: mkholt <[email protected]>
…ods without clashing with the Action overload
…ot benefit from generation so use the standard action instead.
… better location information, and automated code-fixes
@mkholt mkholt merged commit 82e6e75 into main Nov 27, 2025
1 check passed
@mkholt mkholt deleted the feature/typesafe-images branch November 27, 2025 09:57
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