Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3x dev #60

Merged
merged 59 commits into from
Jun 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
9f8c328
Fix tests project version so it matches src package
jordimontana82 Feb 14, 2024
e9b79fb
Merge pull request #54 from DynamicsValue/2x-fix-version
jordimontana82 Feb 14, 2024
f6fab9c
Merge branch '2x-fix-version' into 3x-fix-version
jordimontana82 Feb 14, 2024
94b4fae
Merge pull request #55 from DynamicsValue/3x-fix-version
jordimontana82 Feb 14, 2024
526ce5c
Upgrade package dependencies
jordimontana82 Mar 25, 2024
75c655a
Update README.md to pint users to the fake-rm-easy repo.
jordimontana82 Mar 25, 2024
c3676aa
Added new fake xrm plugin context classes for the new IPluginExecutio…
jordimontana82 Mar 29, 2024
e8a5c7c
Limit new execution contexts to v9 DynamicsValue/fake-xrm-easy#122
jordimontana82 Mar 29, 2024
d5a53f0
Replace ExecutePluginWith* methods with the new PluginExectuionContex…
jordimontana82 Mar 30, 2024
d8e4acf
Implement IPluginExecutionContext4 in plugin execution
jordimontana82 Mar 30, 2024
cab3a52
Limit using to v9
jordimontana82 Mar 30, 2024
45f2cca
Replace all references to the XrmFakedPluginExecutionContext construc…
jordimontana82 Mar 30, 2024
f3157a8
Fix several code smells
jordimontana82 Mar 30, 2024
c92daf2
Adding CreateMultipleRequest tests in pipeline simulation. Simplify G…
jordimontana82 May 2, 2024
cf3e731
Extract Processing of Pipeline Requests to divide execution between b…
jordimontana82 May 2, 2024
d5e52c8
Refactor lots of logic into a PluginStepRegistrationManager DynamicsV…
jordimontana82 May 2, 2024
344d3d8
Refactor lots of stuff into RegisteredPluginStepsRetriever.cs Dynamic…
jordimontana82 May 2, 2024
f15f3d0
Limit BulkOperations to v9
jordimontana82 May 2, 2024
72553dc
Resolves DynamicsValue/fake-xrm-easy#144
jordimontana82 May 3, 2024
d52fe66
Add OrgRequest extension tests for Bulk operations
jordimontana82 May 7, 2024
d3946c6
Simplify ExecutePipelineStage method to remove redundant unnecessary …
jordimontana82 May 8, 2024
4c93d99
Remove old deprecated method of retrieval of plugin steps and rearran…
jordimontana82 May 8, 2024
ade77d7
Extract MiddlewareBuilderPipelineExtension internal and private metho…
jordimontana82 May 8, 2024
570b97d
Remove redundant requestName parameter as it can be retrieved from th…
jordimontana82 May 9, 2024
6a12bf9
Remove unnecessary parameter also from Benchmark project
jordimontana82 May 9, 2024
ff0332c
Refactor and simplify lots of methods. Retrieve filtering attributes …
jordimontana82 May 12, 2024
a7094cc
Add Method to retrieve EntityLogicalName for Org Request for both sin…
jordimontana82 May 12, 2024
fb0372f
Update method signature in benchmark project
jordimontana82 May 12, 2024
393fbcc
Add conditional compilation symbols
jordimontana82 May 12, 2024
0c4a416
Add pragma warning to disable deprecated warnings, add create multipl…
jordimontana82 May 25, 2024
923f516
Lots of changes for DynamicsValue/fake-xrm-easy#122. Remove unnecess…
jordimontana82 May 26, 2024
60e5be6
Implements one side of the merged event pipeline simulation for bulk …
jordimontana82 May 30, 2024
bc2af87
Add conditional precompilation symbols
jordimontana82 May 30, 2024
2636610
Add conditional precompilation for UpsertRequests and older SDKs too
jordimontana82 May 30, 2024
be55263
Implements the other side of the merged pipeline simulation for bulk …
jordimontana82 May 31, 2024
38bf4ff
Refactor pipeline execution and add support for EntityCollection in P…
jordimontana82 Jun 3, 2024
4071ca5
Add merged pipeline tests for UpdateMultiple DynamicsValue/fake-xrm-e…
jordimontana82 Jun 3, 2024
c724840
Implements plugin step registration validation for upsert DynamicsVal…
jordimontana82 Jun 5, 2024
8e5b44b
Adds support for bulk operations in plugin step validator functionali…
jordimontana82 Jun 5, 2024
aa4a62d
Update changelog
jordimontana82 Jun 5, 2024
12c7ab4
Update README
jordimontana82 Jun 5, 2024
e9dbe46
Resolve code smell
jordimontana82 Jun 5, 2024
4553ec1
Fix several code smells DynamicsValue/fake-xrm-easy#122
jordimontana82 Jun 5, 2024
f66a7c9
Fixing more code smells
jordimontana82 Jun 5, 2024
11af3df
Fix a couple of code smells
jordimontana82 Jun 5, 2024
291d0c6
Initial work to support DynamicsValue/fake-xrm-easy#70
jordimontana82 Jun 7, 2024
bc0efc7
Adding event pipeline scope extensions for IOrgService DynamicsValue/…
jordimontana82 Jun 8, 2024
28b6d76
Refactor existing plugin execution code to reuse it for scopes. Intro…
jordimontana82 Jun 9, 2024
6159371
Added event pipeline scope plugin executor tests DynamicsValue/fake-x…
jordimontana82 Jun 9, 2024
ff934b7
Finally implements DynamicsValue/fake-xrm-easy#70
jordimontana82 Jun 9, 2024
1cba19b
Resolves build error for non v9 assemblies
jordimontana82 Jun 9, 2024
56c8a7d
Add further tests for DynamicsValue/fake-xrm-easy#70
jordimontana82 Jun 9, 2024
9e77079
Fixes several code smells
jordimontana82 Jun 9, 2024
299ed3c
Fix code smell
jordimontana82 Jun 9, 2024
079e628
Merge pull request #56 from DynamicsValue/feature/25x-improvements
jordimontana82 Jun 9, 2024
22e4a4a
Trigger another build
jordimontana82 Jun 9, 2024
9718dcc
Merge pull request #57 from DynamicsValue/feature/25x-improvements
jordimontana82 Jun 9, 2024
17d02b2
Merge branch '2x-dev' into feature/35x-improvements
jordimontana82 Jun 15, 2024
f8eca3d
Merge pull request #59 from DynamicsValue/feature/35x-improvements
jordimontana82 Jun 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
## [3.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

## [3.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 @@ -36,8 +36,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.PowerPlatform.Dataverse.Client" Version="1.0.39" />
<PackageReference Include="Microsoft.PowerPlatform.Dataverse.Client.Dynamics" Version="1.0.39" />
<PackageReference Include="Microsoft.PowerPlatform.Dataverse.Client" Version="1.1.22" />
<PackageReference Include="Microsoft.PowerPlatform.Dataverse.Client.Dynamics" Version="1.1.22" />
</ItemGroup>

<ItemGroup>
Expand All @@ -50,48 +50,48 @@
</ItemGroup>

<ItemGroup Condition="'$(Configuration)'=='FAKE_XRM_EASY_2013'">
<PackageReference Include="FakeXrmEasy.Abstractions.v2013" Version="3.4.0-*" />
<PackageReference Include="FakeXrmEasy.Core.v2013" Version="3.4.2-*" />
<PackageReference Include="FakeXrmEasy.Abstractions.v2013" Version="3.5.0-*" />
<PackageReference Include="FakeXrmEasy.Core.v2013" Version="3.5.0-*" />
</ItemGroup>
<ItemGroup Condition="'$(Configuration)'=='FAKE_XRM_EASY_2015'">
<PackageReference Include="FakeXrmEasy.Abstractions.v2015" Version="3.4.0-*" />
<PackageReference Include="FakeXrmEasy.Core.v2015" Version="3.4.2-*" />
<PackageReference Include="FakeXrmEasy.Abstractions.v2015" Version="3.5.0-*" />
<PackageReference Include="FakeXrmEasy.Core.v2015" Version="3.5.0-*" />
</ItemGroup>
<ItemGroup Condition="'$(Configuration)'=='FAKE_XRM_EASY_2016'">
<PackageReference Include="FakeXrmEasy.Abstractions.v2016" Version="3.4.0-*" />
<PackageReference Include="FakeXrmEasy.Core.v2016" Version="3.4.2-*" />
<PackageReference Include="FakeXrmEasy.Abstractions.v2016" Version="3.5.0-*" />
<PackageReference Include="FakeXrmEasy.Core.v2016" Version="3.5.0-*" />
</ItemGroup>
<ItemGroup Condition="'$(Configuration)'=='FAKE_XRM_EASY_365'">
<PackageReference Include="FakeXrmEasy.Abstractions.v365" Version="3.4.0-*" />
<PackageReference Include="FakeXrmEasy.Core.v365" Version="3.4.2-*" />
<PackageReference Include="FakeXrmEasy.Abstractions.v365" Version="3.5.0-*" />
<PackageReference Include="FakeXrmEasy.Core.v365" Version="3.5.0-*" />
</ItemGroup>
<ItemGroup Condition="'$(Configuration)'=='FAKE_XRM_EASY_9'">
<PackageReference Include="FakeXrmEasy.Abstractions.v9" Version="3.4.0-*" />
<PackageReference Include="FakeXrmEasy.Core.v9" Version="3.4.2-*" />
<PackageReference Include="FakeXrmEasy.Abstractions.v9" Version="3.5.0-*" />
<PackageReference Include="FakeXrmEasy.Core.v9" Version="3.5.0-*" />
</ItemGroup>
<ItemGroup Condition="'$(Configuration)'=='Debug'">
<PackageReference Include="FakeXrmEasy.Abstractions.v9" Version="3.4.0-*" />
<PackageReference Include="FakeXrmEasy.Core.v9" Version="3.4.2-*" />
<PackageReference Include="FakeXrmEasy.Abstractions.v9" Version="3.5.0-*" />
<PackageReference Include="FakeXrmEasy.Core.v9" Version="3.5.0-*" />
</ItemGroup>


<ItemGroup Condition="'$(PackTests)' == 'true' And '$(Configuration)'=='FAKE_XRM_EASY_2013'">
<PackageReference Include="FakeXrmEasy.Plugins.v2013" Version="3.4.1-*" />
<PackageReference Include="FakeXrmEasy.Plugins.v2013" Version="3.5.0-*" />
</ItemGroup>
<ItemGroup Condition="'$(PackTests)' == 'true' And '$(Configuration)'=='FAKE_XRM_EASY_2015'">
<PackageReference Include="FakeXrmEasy.Plugins.v2015" Version="3.4.1-*" />
<PackageReference Include="FakeXrmEasy.Plugins.v2015" Version="3.5.0-*" />
</ItemGroup>
<ItemGroup Condition="'$(PackTests)' == 'true' And '$(Configuration)'=='FAKE_XRM_EASY_2016'">
<PackageReference Include="FakeXrmEasy.Plugins.v2016" Version="3.4.1-*" />
<PackageReference Include="FakeXrmEasy.Plugins.v2016" Version="3.5.0-*" />
</ItemGroup>
<ItemGroup Condition="'$(PackTests)' == 'true' And '$(Configuration)'=='FAKE_XRM_EASY_365'">
<PackageReference Include="FakeXrmEasy.Plugins.v365" Version="3.4.1-*" />
<PackageReference Include="FakeXrmEasy.Plugins.v365" Version="3.5.0-*" />
</ItemGroup>
<ItemGroup Condition="'$(PackTests)' == 'true' And '$(Configuration)'=='FAKE_XRM_EASY_9'">
<PackageReference Include="FakeXrmEasy.Plugins.v9" Version="3.4.1-*" />
<PackageReference Include="FakeXrmEasy.Plugins.v9" Version="3.5.0-*" />
</ItemGroup>
<ItemGroup Condition="'$(PackTests)' == 'true' And '$(Configuration)'=='Debug'">
<PackageReference Include="FakeXrmEasy.Plugins.v9" Version="3.4.1-*" />
<PackageReference Include="FakeXrmEasy.Plugins.v9" Version="3.5.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 @@ -42,28 +42,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
Loading