Refactor core execution and improve plugin assembly handling#332
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors request execution in XrmMockup365 by extracting the large Core.Execute(...) orchestration logic into a dedicated RequestExecutionPipeline, with Core exposing an ICoreOperations contract to support pipeline-driven execution while keeping Core responsible for infrastructure concerns (DB/security/extensions).
Changes:
- Introduces
RequestExecutionPipeline+ExecutionPipelineContextto orchestrate PreValidation → PreOperation → MainOperation → PostOperation → Extensions. - Adds
ICoreOperationsand updatesCoreto implement it, delegatingExecute(...)to the pipeline and exposing core operations needed by managers. - Updates plugin/workflow triggering to depend on
ICoreOperationsand improves plugin assembly scanning + stabilizes plugin ordering for equalExecutionOrder.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/XrmMockup365/Core.cs | Delegates request orchestration to the new pipeline; exposes operations needed via ICoreOperations. |
| src/XrmMockup365/RequestExecutionPipeline.cs | New pipeline implementation coordinating stages, dispatch, async staging, and extensions. |
| src/XrmMockup365/Internal/ExecutionPipelineContext.cs | New context container for state carried through the pipeline stages. |
| src/XrmMockup365/Internal/ICoreOperations.cs | New internal contract defining the operations the pipeline/managers need from Core. |
| src/XrmMockup365/Plugin/PluginManager.cs | Uses stable ordering for triggers; avoids rescanning assemblies repeatedly; updates signatures to ICoreOperations. |
| src/XrmMockup365/Plugin/PluginTrigger.cs | Updates execution provider creation to use ICoreOperations service factory methods. |
| src/XrmMockup365/Workflow/WorkflowManager.cs | Updates workflow triggering/execution to use ICoreOperations and factory creation via Core operations. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+7
to
+16
| namespace DG.Tools.XrmMockup | ||
| { | ||
| /// <summary> | ||
| /// Infrastructure contract that Core exposes to the pipeline and its managers. | ||
| /// The pipeline orchestrates execution stages; Core provides the underlying services. | ||
| /// PluginManager, WorkflowManager, and PluginTrigger also depend on this interface | ||
| /// so they can be used from the pipeline without a direct Core reference. | ||
| /// </summary> | ||
| internal interface ICoreOperations | ||
| { |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…it to every method call like a lunatic
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.
This pull request refactors the
Coreclass insrc/XrmMockup365/Core.csto delegate request execution to a newRequestExecutionPipeline, and exposes several previously internal methods to support this pipeline. The changes improve separation of concerns, make the codebase more extensible, and enable the pipeline to interact with core operations through a newICoreOperationsinterface.