feat(mediator): automate gRPC proto export during build - #793
Merged
Conversation
Co-authored-by: AndreaCuneo <5227688+AndreaCuneo@users.noreply.github.com>
Co-authored-by: AndreaCuneo <5227688+AndreaCuneo@users.noreply.github.com>
Co-authored-by: AndreaCuneo <5227688+AndreaCuneo@users.noreply.github.com>
Co-authored-by: AndreaCuneo <5227688+AndreaCuneo@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
AndreaCuneo
July 25, 2026 14:09
View session
AndreaCuneo
marked this pull request as ready for review
July 25, 2026 14:10
AndreaCuneo
approved these changes
Jul 25, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Automates gRPC .proto export at build time for MediatorFramework gRPC consumers by invoking a package-owned runner that loads the built assembly (without running the host entry point), then exports generated service protos plus shared ark/* assets.
Changes:
- Added a new
Ark.Tools.MediatorFramework.Grpc.Exportconsole runner (net8/net10) that performs proto export via assembly load + safe-path validation. - Updated
buildTransitiveMSBuild targets/props to run the exporter afterBuild, addArkExportProtoopt-out, and gateArkAdditionalProtocopying on an export marker. - Removed the runtime
ArkProtoExport.TryHandle(args)entry-point plumbing from the sample, and updated docs/task status.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/mediator-framework/Ark.Tools.MediatorFramework.Grpc/buildTransitive/Ark.Tools.MediatorFramework.Grpc.targets | Switch export to package-owned runner and gate additional proto copy via marker file |
| src/mediator-framework/Ark.Tools.MediatorFramework.Grpc/buildTransitive/Ark.Tools.MediatorFramework.Grpc.props | Default ArkExportProto/ArkExportProtoDir for consumers |
| src/mediator-framework/Ark.Tools.MediatorFramework.Grpc/ArkProtoExport.cs | Removed runtime entry-point export helper |
| src/mediator-framework/Ark.Tools.MediatorFramework.Grpc/Ark.Tools.MediatorFramework.Grpc.csproj | Reference/pack the exporter runner into the NuGet package |
| src/mediator-framework/Ark.Tools.MediatorFramework.Grpc.Export/Program.cs | Implement build-time export runner (load assembly, export generated/shared assets safely) |
| src/mediator-framework/Ark.Tools.MediatorFramework.Grpc.Export/packages.lock.json | Lock dependencies for exporter project (CI locked restore compatibility) |
| src/mediator-framework/Ark.Tools.MediatorFramework.Grpc.Export/Ark.Tools.MediatorFramework.Grpc.Export.csproj | New runner project definition (net8/net10 exe) |
| samples/Ark.MediatorFramework.Sample/src/Ark.MediatorFramework.Sample.WebInterface/Program.cs | Remove ArkProtoExport.TryHandle(args) interception |
| samples/Ark.MediatorFramework.Sample/README.md | Document automatic export, override/opt-out, and additional proto behavior |
| docs/mediator-framework/tasks/README.md | Mark GEN-07 complete |
| docs/mediator-framework/design.md | Update design docs to reflect build-time runner export model |
| Ark.Tools.slnx | Add exporter project to solution |
Comments suppressed due to low confidence (1)
src/mediator-framework/Ark.Tools.MediatorFramework.Grpc/Ark.Tools.MediatorFramework.Grpc.csproj:70
- Same as the net10 runner artifacts above: add
Exists(...)guards for the net8 runner files sodotnet packdoesn’t fail if only one TFM was built (or outputs are cleaned).
<None Include="$(MSBuildThisFileDirectory)..\Ark.Tools.MediatorFramework.Grpc.Export\bin\$(Configuration)\net8.0\Ark.Tools.MediatorFramework.Grpc.Export.dll"
Pack="true" PackagePath="tools/net8.0" Visible="false" />
<None Include="$(MSBuildThisFileDirectory)..\Ark.Tools.MediatorFramework.Grpc.Export\bin\$(Configuration)\net8.0\Ark.Tools.MediatorFramework.Grpc.Export.runtimeconfig.json"
Pack="true" PackagePath="tools/net8.0" Visible="false" />
<None Include="$(MSBuildThisFileDirectory)..\Ark.Tools.MediatorFramework.Grpc.Export\bin\$(Configuration)\net8.0\Ark.Tools.MediatorFramework.Grpc.Export.deps.json"
Pack="true" PackagePath="tools/net8.0" Visible="false" />
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: AndreaCuneo <5227688+AndreaCuneo@users.noreply.github.com>
AndreaCuneo
approved these changes
Jul 25, 2026
AndreaCuneo
approved these changes
Jul 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proto export previously launched the hosting application and required
ArkProtoExport.TryHandle(args)entry-point plumbing. This could trigger startup side effects and produced output for projects without generated gRPC services.Build-time exporter
ark/*assets.MSBuild integration
Build.ArkExportProtoDir,ArkExportProto=false, and@(ArkAdditionalProto).