Skip to content

Refactor core execution and improve plugin assembly handling#332

Merged
mkholt merged 6 commits into
masterfrom
modularize-core-38a
Jun 12, 2026
Merged

Refactor core execution and improve plugin assembly handling#332
mkholt merged 6 commits into
masterfrom
modularize-core-38a

Conversation

@mkholt

@mkholt mkholt commented Jun 12, 2026

Copy link
Copy Markdown
Member

This pull request refactors the Core class in src/XrmMockup365/Core.cs to delegate request execution to a new RequestExecutionPipeline, 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 new ICoreOperations interface.

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.

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 + ExecutionPipelineContext to orchestrate PreValidation → PreOperation → MainOperation → PostOperation → Extensions.
  • Adds ICoreOperations and updates Core to implement it, delegating Execute(...) to the pipeline and exposing core operations needed by managers.
  • Updates plugin/workflow triggering to depend on ICoreOperations and improves plugin assembly scanning + stabilizes plugin ordering for equal ExecutionOrder.

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 thread src/XrmMockup365/RequestExecutionPipeline.cs
Comment thread src/XrmMockup365/Plugin/PluginManager.cs
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>
@mkholt mkholt merged commit f1a06f7 into master Jun 12, 2026
1 of 2 checks passed
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.

3 participants