Skip to content

Commit

Permalink
Merge pull request #58 from DynamicsValue/2x-dev
Browse files Browse the repository at this point in the history
Push to main
  • Loading branch information
jordimontana82 authored Jun 10, 2024
2 parents cdaec70 + 9718dcc commit fdc5050
Show file tree
Hide file tree
Showing 94 changed files with 5,810 additions and 1,914 deletions.
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
## [2.5.0]

### Added

- Ability to prevent infinite loops in plugin executions - https://github.com/DynamicsValue/fake-xrm-easy/issues/70
- Event Pipeline Scopes : Introducing new capability to capture the 'scope' or stack of plugin executions. This will enable many features including - https://github.com/DynamicsValue/fake-xrm-easy/issues/70
- Pipeline Simulation: Add support for pre images and post image collections - https://github.com/DynamicsValue/fake-xrm-easy/issues/122
- Pipeline Simulation: Update Plugin Step Validator to include bulk operations - https://github.com/DynamicsValue/fake-xrm-easy/issues/122
- Pipeline Simulation: Add support for merged pipeline of bulk operations (trigger bulk plugins from non-bulk messages and vice-versa) - https://github.com/DynamicsValue/fake-xrm-easy/issues/122
- Pipeline Simulation: Add support specific attribute filtering of bulk operation plugin steps - https://github.com/DynamicsValue/fake-xrm-easy/issues/122
- Pipeline Simulation: Add support for bulk operations in pipeline simulation - https://github.com/DynamicsValue/fake-xrm-easy/issues/122
- Added support for new IPluginExecutionContext2, IPluginExecutionContext3, and IPluginExecutionContext4 interfaces - https://github.com/DynamicsValue/fake-xrm-easy/issues/122

### Changed

- Massively refactored Pipeline Simulation due to bulk operations changes
- Resolves issue where a DeleteRequest was not triggering plugin steps when using late bound entities - https://github.com/DynamicsValue/fake-xrm-easy/issues/144
- ExecutePluginWith* methods now return the new XrmFakedPluginExecutionContext4 class which implements IPluginExecutionContext4 for v9 versions.
- Upgraded dependency "Microsoft.CrmSdk.CoreAssemblies" to 9.0.2.52
- Upgraded dependency "Microsoft.CrmSdk.XrmTooling.CoreAssembly" to 9.1.1.45

## [2.4.1]

### Changed
Expand Down
3 changes: 3 additions & 0 deletions FakeXrmEasy.Plugins.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/UserDictionary/Words/=accountid/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=modifiedby/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=modifiedon/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=postoperation/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=preoperation/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
--------------------------------------------------
This repo contains the source code for the FakeXrmEasy.Plugins package.

**NOTE: We centrally manage and prioritize issues in the DynamicsValue/fake-xrm-easy repo, if you need to raise an issue related to this package
please do so at: https://github.com/DynamicsValue/fake-xrm-easy**

|Build|Quality Gate|Coverage|Security|Maintainability|Reliability|
|-----| ---------- | ------ | ------ | ------------- | --------- |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net462' And '$(Configuration)'=='FAKE_XRM_EASY_9'">
<PackageReference Include="Microsoft.CrmSdk.CoreAssemblies" Version="9.0.2.27" />
<PackageReference Include="Microsoft.CrmSdk.XrmTooling.CoreAssembly" Version="9.0.2.4" />
<PackageReference Include="Microsoft.CrmSdk.CoreAssemblies" Version="9.0.2.52" />
<PackageReference Include="Microsoft.CrmSdk.XrmTooling.CoreAssembly" Version="9.1.1.45" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net462' And '$(Configuration)'=='FAKE_XRM_EASY_365'">
Expand Down Expand Up @@ -90,33 +90,33 @@
</ItemGroup>

<ItemGroup Condition="'$(PackTests)' == 'true' And '$(Configuration)'=='FAKE_XRM_EASY'">
<PackageReference Include="FakeXrmEasy.Abstractions.v2011" Version="[2.4.0-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Core.v2011" Version="[2.4.1-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Plugins.v2011" Version="[2.4.0-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Abstractions.v2011" Version="[2.5.0-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Core.v2011" Version="[2.5.0-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Plugins.v2011" Version="[2.5.0-*,3.0)" />
</ItemGroup>
<ItemGroup Condition="'$(PackTests)' == 'true' And '$(Configuration)'=='FAKE_XRM_EASY_2013'">
<PackageReference Include="FakeXrmEasy.Abstractions.v2013" Version="[2.4.0-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Core.v2013" Version="[2.4.1-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Plugins.v2013" Version="[2.4.0-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Abstractions.v2013" Version="[2.5.0-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Core.v2013" Version="[2.5.0-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Plugins.v2013" Version="[2.5.0-*,3.0)" />
</ItemGroup>
<ItemGroup Condition="'$(PackTests)' == 'true' And '$(Configuration)'=='FAKE_XRM_EASY_2015'">
<PackageReference Include="FakeXrmEasy.Abstractions.v2015" Version="[2.4.0-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Core.v2015" Version="[2.4.1-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Plugins.v2015" Version="[2.4.0-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Abstractions.v2015" Version="[2.5.0-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Core.v2015" Version="[2.5.0-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Plugins.v2015" Version="[2.5.0-*,3.0)" />
</ItemGroup>
<ItemGroup Condition="'$(PackTests)' == 'true' And '$(Configuration)'=='FAKE_XRM_EASY_2016'">
<PackageReference Include="FakeXrmEasy.Abstractions.v2016" Version="[2.4.0-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Core.v2016" Version="[2.4.1-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Plugins.v2016" Version="[2.4.0-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Abstractions.v2016" Version="[2.5.0-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Core.v2016" Version="[2.5.0-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Plugins.v2016" Version="[2.5.0-*,3.0)" />
</ItemGroup>
<ItemGroup Condition="'$(PackTests)' == 'true' And '$(Configuration)'=='FAKE_XRM_EASY_365'">
<PackageReference Include="FakeXrmEasy.Abstractions.v365" Version="[2.4.0-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Core.v365" Version="[2.4.1-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Plugins.v365" Version="[2.4.0-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Abstractions.v365" Version="[2.5.0-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Core.v365" Version="[2.5.0-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Plugins.v365" Version="[2.5.0-*,3.0)" />
</ItemGroup>
<ItemGroup Condition="'$(PackTests)' == 'true' And '$(Configuration)'=='FAKE_XRM_EASY_9'">
<PackageReference Include="FakeXrmEasy.Abstractions.v9" Version="[2.4.0-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Core.v9" Version="[2.4.1-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Plugins.v9" Version="[2.4.0-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Abstractions.v9" Version="[2.5.0-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Core.v9" Version="[2.5.0-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Plugins.v9" Version="[2.5.0-*,3.0)" />
</ItemGroup>
</Project>
22 changes: 16 additions & 6 deletions performance/FakeXrmEasy.Plugins.Performance/PipelineBenchmarks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,28 +41,38 @@ public PipelineBenchmarks()
}
}

/* Significantly slower than GetPluginStepsWithQuery below
[Benchmark]
public void GetPluginStepsWithRetrieveMultiple()
{
_context.GetPluginStepsForOrganizationRequestWithRetrieveMultiple("Create", ProcessingStepStage.Postoperation, ProcessingStepMode.Synchronous, _createRequest);
RegisteredPluginStepsRetriever.GetPluginStepsForOrganizationRequestWithRetrieveMultiple(_context, "Create", ProcessingStepStage.Postoperation, ProcessingStepMode.Synchronous, _createRequest);
}

*/

[Benchmark]
public void GetPluginStepsWithQuery()
{
_context.GetPluginStepsForOrganizationRequest("Create", ProcessingStepStage.Postoperation, ProcessingStepMode.Synchronous, _createRequest);
var parameters = new PipelineStageExecutionParameters()
{
Stage = ProcessingStepStage.Postoperation,
Mode = ProcessingStepMode.Synchronous,
Request = _createRequest
};
RegisteredPluginStepsRetriever.GetPluginStepsForOrganizationRequest(_context, parameters);
}

/*
[Benchmark]
public void GetPluginStepImageWithRetrieveMultiple()
{
_context.GetPluginImageDefinitionsWithRetrieveMultiple(_lastPluginStepId, ProcessingStepImageType.PostImage).ToList();
RegisteredPluginStepsRetriever.GetPluginImageDefinitionsWithRetrieveMultiple(_context, _lastPluginStepId, ProcessingStepImageType.PostImage).ToList();
}

*/

[Benchmark]
public void GetPluginStepImageWithQuery()
{
_context.GetPluginImageDefinitionsWithQuery(_lastPluginStepId, ProcessingStepImageType.PostImage).ToList();
RegisteredPluginStepsRetriever.GetPluginImageDefinitionsWithQuery(_context, _lastPluginStepId, ProcessingStepImageType.PostImage).ToList();
}
}
}
10 changes: 10 additions & 0 deletions src/FakeXrmEasy.Plugins/Audit/PluginStepAuditDetails.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ public class PluginStepAuditDetails
/// Stage that triggered this plugin execution
/// </summary>
public ProcessingStepStage Stage { get; set; }

/// <summary>
/// The mode the in which the plugin step was executed
/// </summary>
public ProcessingStepMode Mode { get; set; }

/// <summary>
/// Message that triggered this execution (i.e. Create, Update, and so on...)
Expand Down Expand Up @@ -59,5 +64,10 @@ public class PluginStepAuditDetails
/// The plugin step definition that triggered the plugin execution
/// </summary>
public IPluginStepDefinition PluginStepDefinition { get; set; }

/// <summary>
/// The plugin execution context that was passed into the plugin when it was executed to check any other necessary properties
/// </summary>
public IPluginExecutionContext PluginContext { get; set; }
}
}
25 changes: 25 additions & 0 deletions src/FakeXrmEasy.Plugins/EntityLogicalNameConstants.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
namespace FakeXrmEasy.Plugins
{
internal static class EntityLogicalNameConstants
{
internal const string AppNotification = "appnotification";
internal const string BackgroundOperation = "backgroundoperation";
internal const string CardStateItem = "cardstateitem";
internal const string ComponentVersionNrdDataSource = "componentversionnrddatasource";
internal const string ElasticFileAttachment = "elasticfileattachment";
internal const string EventExpanderBreadcrumb = "eventexpanderbreadcrumb";
internal const string FlowLog = "flowlog";
internal const string FlowRun = "flowrun";
internal const string MsDynTimelinePin = "msdyn_timelinepin";
internal const string NlsqRegistration = "nlsqregistration";
internal const string None = "none";
internal const string PowerPagesLog = "powerpageslog";
internal const string RecentlyUsed = "recentlyused";
internal const string SearchResultsCache = "searchresultscache";
internal const string SearchTelemetry = "searchtelemetry";
internal const string SharedWorkspaceAccessToken = "sharedworkspaceaccesstoken";
internal const string SharedWorkspaceNr = "sharedworkspacenr";

internal const string Account = "account";
}
}
9 changes: 0 additions & 9 deletions src/FakeXrmEasy.Plugins/EntityLogicalNameContants.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System;
using Microsoft.Xrm.Sdk;

namespace FakeXrmEasy.Plugins.Extensions
{
/// <summary>
/// Exception thrown when a method was invoked on an organization request that is not a bulk operation
/// </summary>
public class GetAssociatedNonBulkRequestNameException: Exception
{
/// <summary>
/// Default constructor
/// </summary>
/// <param name="request"></param>
public GetAssociatedNonBulkRequestNameException(OrganizationRequest request):
base($"GetAssociatedNonBulkRequestName can not be called on a non-bulk organization request '{request.RequestName}'")
{

}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System;

namespace FakeXrmEasy.Plugins.Extensions
{
/// <summary>
/// Exception raised when a bulk request is converted to a non bulk request but the original request wasn't a valid bulk request
/// </summary>
public class InvalidBulkOperationExtensionException: Exception
{
internal InvalidBulkOperationExtensionException() : base("Bulk Operations Organization Request extensions are not supported on non-bulk OrganizationRequests")
{

}
}
}
Loading

0 comments on commit fdc5050

Please sign in to comment.