Skip to content

Commit

Permalink
chore: Major clean up (#53)
Browse files Browse the repository at this point in the history
* rename comand to command

* Comment update

* Update MonitorNoInputExampleUsingClientScenario.cs

* Update MonitorNoInputExampleUsingApiScenario.cs

* Update MonitorExampleUsingApiScenario.cs

* namespace refactor

* namespace refactor

* Clean up

* updates urls

* schedul endpoints

* nuget version update

* abs nuget version

* rename project name

* ProcessManagerExample -> ProcessManager.Example

* orch nuget version dumb
  • Loading branch information
RasmusGraabaek authored Dec 19, 2024
1 parent 92fa7d4 commit b4be064
Show file tree
Hide file tree
Showing 59 changed files with 205 additions and 196 deletions.
4 changes: 4 additions & 0 deletions docs/ProcessManager.Client/ReleaseNotes/ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# ProcessManager.Client Release Notes

## Version 0.14.6

- Internal refactoring.

## Version 0.14.5

- Internal refactoring.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# ProcessManager.Orchestrations.Abstractions Release Notes

## Version 0.2.7

- Internal refactoring.

## Version 0.2.6

- Internal refactoring.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<PropertyGroup>
<PackageId>Energinet.DataHub.ProcessManager.Abstractions</PackageId>
<PackageVersion>0.14.5$(VersionSuffix)</PackageVersion>
<PackageVersion>0.14.6$(VersionSuffix)</PackageVersion>
<Title>DH3 Process Manager Abstractions library</Title>
<Company>Energinet-DataHub</Company>
<Authors>Energinet-DataHub</Authors>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@

using Energinet.DataHub.Core.FunctionApp.TestCommon.Azurite;
using Energinet.DataHub.Core.FunctionApp.TestCommon.Configuration;
using Energinet.DataHub.Example.Orchestrations.Tests.Fixtures;
using Energinet.DataHub.ProcessManager.Core.Tests.Fixtures;
using Energinet.DataHub.ProcessManager.Example.Orchestrations.Tests.Fixtures;
using Energinet.DataHub.ProcessManager.Tests.Fixtures;
using Xunit.Abstractions;

namespace Energinet.DataHub.ProcessManager.Client.Tests.Fixtures;

/// <summary>
/// Support testing the Process Manager Clients by coordinating the startup
/// of the dependent applications Example.Orchestrations and ProcessManager (Api).
/// of the dependent applications ProcessManager.Example.Orchestrations and ProcessManager (Api).
/// </summary>
public class ProcessManagerClientFixture : IAsyncLifetime
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@

using Energinet.DataHub.Core.FunctionApp.TestCommon.FunctionAppHost;
using Energinet.DataHub.Core.TestCommon;
using Energinet.DataHub.Example.Orchestrations.Abstractions.Processes.BRS_X01.Example.V1;
using Energinet.DataHub.Example.Orchestrations.Abstractions.Processes.BRS_X01.Example.V1.Model;
using Energinet.DataHub.ProcessManager.Abstractions.Api.Model;
using Energinet.DataHub.ProcessManager.Abstractions.Api.Model.OrchestrationInstance;
using Energinet.DataHub.ProcessManager.Client.Extensions.DependencyInjection;
using Energinet.DataHub.ProcessManager.Client.Extensions.Options;
using Energinet.DataHub.ProcessManager.Client.Tests.Fixtures;
using Energinet.DataHub.ProcessManager.Client.Tests.Fixtures.Extensions;
using Energinet.DataHub.ProcessManager.Example.Orchestrations.Abstractions.Processes.BRS_X01.InputExample.V1;
using Energinet.DataHub.ProcessManager.Example.Orchestrations.Abstractions.Processes.BRS_X01.InputExample.V1.Model;
using FluentAssertions;
using Microsoft.Extensions.DependencyInjection;
using Xunit.Abstractions;

namespace Energinet.DataHub.ProcessManager.Client.Tests.Integration.BRS_X01.V1;
namespace Energinet.DataHub.ProcessManager.Client.Tests.Integration.BRS_X01.InputExample.V1;

/// <summary>
/// Test case where we verify the Process Manager clients can be used to start an
Expand Down Expand Up @@ -88,7 +88,7 @@ public async Task ExampleOrchestration_WhenStarted_CanMonitorLifecycle()
ShouldSkipSkippableStep: false);
var orchestrationInstanceId = await processManagerClient
.StartNewOrchestrationInstanceAsync(
new StartExampleCommandV1(
new StartInputExampleCommandV1(
userIdentity,
input),
CancellationToken.None);
Expand Down Expand Up @@ -118,7 +118,7 @@ public async Task ExampleOrchestration_WhenStarted_CanMonitorLifecycle()
.SearchOrchestrationInstancesByNameAsync<InputV1>(
new SearchOrchestrationInstancesByNameQuery(
userIdentity,
name: new Brs_X01_Example_V1().Name,
name: new Brs_X01_InputExample_V1().Name,
version: null,
lifecycleState: OrchestrationInstanceLifecycleStates.Terminated,
terminationState: OrchestrationInstanceTerminationStates.Succeeded,
Expand All @@ -129,7 +129,7 @@ public async Task ExampleOrchestration_WhenStarted_CanMonitorLifecycle()
orchestrationInstancesGeneralSearch.Should().Contain(x => x.Id == orchestrationInstanceId);

// Step 4: Custom search
var customQuery = new ExampleQuery(userIdentity)
var customQuery = new InputExampleQuery(userIdentity)
{
SkippedStepTwo = input.ShouldSkipSkippableStep,
};
Expand All @@ -156,7 +156,7 @@ public async Task ExampleOrchestration_WhenScheduledToRunInThePast_CanMonitorLif
// Step 1: Schedule new example orchestration instance
var orchestrationInstanceId = await processManagerClient
.ScheduleNewOrchestrationInstanceAsync(
new ScheduleExampleCommandV1(
new ScheduleInputExampleCommandV1(
userIdentity,
runAt: DateTimeOffset.Parse("2024-11-01T06:19:10.0209567+01:00"),
inputParameter: new InputV1(
Expand Down Expand Up @@ -200,7 +200,7 @@ public async Task ExampleOrchestrationScheduledToRunInTheFuture_WhenCanceled_Can
// Step 1: Schedule new example orchestration instance
var orchestrationInstanceId = await processManagerClient
.ScheduleNewOrchestrationInstanceAsync(
new ScheduleExampleCommandV1(
new ScheduleInputExampleCommandV1(
userIdentity,
runAt: DateTimeOffset.Parse("2050-01-01T12:00:00.0000000+01:00"),
inputParameter: new InputV1(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
// limitations under the License.

using Energinet.DataHub.Core.TestCommon;
using Energinet.DataHub.Example.Orchestrations.Abstractions.Processes.BRS_X01.NoInputExample.V1.Model;
using Energinet.DataHub.ProcessManager.Abstractions.Api.Model;
using Energinet.DataHub.ProcessManager.Abstractions.Api.Model.OrchestrationInstance;
using Energinet.DataHub.ProcessManager.Client.Extensions.DependencyInjection;
using Energinet.DataHub.ProcessManager.Client.Extensions.Options;
using Energinet.DataHub.ProcessManager.Client.Tests.Fixtures;
using Energinet.DataHub.ProcessManager.Client.Tests.Fixtures.Extensions;
using Energinet.DataHub.ProcessManager.Example.Orchestrations.Abstractions.Processes.BRS_X01.NoInputExample.V1.Model;
using FluentAssertions;
using Microsoft.Extensions.DependencyInjection;
using Xunit.Abstractions;
Expand Down Expand Up @@ -84,7 +84,7 @@ public async Task NoInputExampleOrchestration_WhenStarted_CanMonitorLifecycle()
// Step 1: Start new orchestration instance
var orchestrationInstanceId = await processManagerClient
.StartNewOrchestrationInstanceAsync(
new StartNoInputExampleComandV1(
new StartNoInputExampleCommandV1(
userIdentity),
CancellationToken.None);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
</PropertyGroup>

<ItemGroup>
<Compile Include="..\Example.Orchestrations.Tests\Fixtures\ExampleOrchestrationsAppManager.cs" Link="Fixtures\ExampleOrchestrationsAppManager.cs" />
<Compile Include="..\ProcessManager.Core.Tests\Fixtures\ProcessManagerDatabaseManager.cs" Link="Fixtures\ProcessManagerDatabaseManager.cs" />
<Compile Include="..\ProcessManager.Example.Orchestrations.Tests\Fixtures\ExampleOrchestrationsAppManager.cs">
<Link>Fixtures\ExampleOrchestrationsAppManager.cs</Link>
</Compile>
<Compile Include="..\ProcessManager.Orchestrations.Tests\Fixtures\OrchestrationsAppManager.cs">
<Link>Fixtures\OrchestrationsAppManager.cs</Link>
</Compile>
Expand All @@ -33,7 +35,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Example.Orchestrations\Example.Orchestrations.csproj" />
<ProjectReference Include="..\ProcessManager.Example.Orchestrations\ProcessManager.Example.Orchestrations.csproj" />
<ProjectReference Include="..\ProcessManager.Client\ProcessManager.Client.csproj" />
<ProjectReference Include="..\ProcessManager.DatabaseMigration\ProcessManager.DatabaseMigration.csproj" />
<ProjectReference Include="..\ProcessManager.Orchestrations\ProcessManager.Orchestrations.csproj" />
Expand Down
2 changes: 1 addition & 1 deletion source/ProcessManager.Client/ProcessManager.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<PropertyGroup>
<PackageId>Energinet.DataHub.ProcessManager.Client</PackageId>
<PackageVersion>0.14.5$(VersionSuffix)</PackageVersion>
<PackageVersion>0.14.6$(VersionSuffix)</PackageVersion>
<Title>DH3 Process Manager Client library</Title>
<Company>Energinet-DataHub</Company>
<Authors>Energinet-DataHub</Authors>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<AssemblyName>Energinet.DataHub.Example.Orchestrations.Abstractions</AssemblyName>
<RootNamespace>Energinet.DataHub.Example.Orchestrations.Abstractions</RootNamespace>
<AssemblyName>Energinet.DataHub.ProcessManager.Example.Orchestrations.Abstractions</AssemblyName>
<RootNamespace>Energinet.DataHub.ProcessManager.Example.Orchestrations.Abstractions</RootNamespace>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,30 @@
// See the License for the specific language governing permissions and
// limitations under the License.

using Energinet.DataHub.Example.Orchestrations.Abstractions.Processes.BRS_X01.Example.V1.Model;
using Energinet.DataHub.ProcessManager.Abstractions.Api.Model;
using Energinet.DataHub.ProcessManager.Abstractions.Api.Model.OrchestrationInstance;
using Energinet.DataHub.ProcessManager.Example.Orchestrations.Abstractions.Processes.BRS_X01.InputExample.V1.Model;

namespace Energinet.DataHub.Example.Orchestrations.Abstractions.Processes.BRS_X01.Example.V1;
namespace Energinet.DataHub.ProcessManager.Example.Orchestrations.Abstractions.Processes.BRS_X01.InputExample.V1;

/// <summary>
/// Query for searching for BRS-X01.
/// Must be JSON serializable.
/// </summary>
public record ExampleQuery
: SearchOrchestrationInstancesByCustomQuery<ExampleQueryResult>
public record InputExampleQuery
: SearchOrchestrationInstancesByCustomQuery<InputExampleQueryResult>
{
/// <summary>
/// Construct query.
/// </summary>
/// <param name="operatingIdentity">Identity of the user executing the query.</param>
/// <param name="skippedStepTwo"> search criteria to check if step two was skipped</param>
public ExampleQuery(
public InputExampleQuery(
UserIdentityDto operatingIdentity,
bool skippedStepTwo = default)
: base(
operatingIdentity,
new Brs_X01_Example_V1().Name)
new Brs_X01_InputExample_V1().Name)
{
SkippedStepTwo = skippedStepTwo;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.

using Energinet.DataHub.Example.Orchestrations.Abstractions.Processes.BRS_X01.Example.V1.Model;
using Energinet.DataHub.ProcessManager.Abstractions.Api.Model;
using Energinet.DataHub.ProcessManager.Example.Orchestrations.Abstractions.Processes.BRS_X01.InputExample.V1.Model;

namespace Energinet.DataHub.Example.Orchestrations.Abstractions.Processes.BRS_X01.Example.V1;
namespace Energinet.DataHub.ProcessManager.Example.Orchestrations.Abstractions.Processes.BRS_X01.InputExample.V1;

/// <summary>
/// Query result from searching BRS-X01.
/// Must be JSON serializable.
/// </summary>
public record ExampleQueryResult(OrchestrationInstanceTypedDto<InputV1> OrchestrationInstance);
public record InputExampleQueryResult(OrchestrationInstanceTypedDto<InputV1> OrchestrationInstance);
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

using Energinet.DataHub.ProcessManager.Abstractions.Api.Model.OrchestrationDescription;

namespace Energinet.DataHub.Example.Orchestrations.Abstractions.Processes.BRS_X01.Example.V1.Model;
namespace Energinet.DataHub.ProcessManager.Example.Orchestrations.Abstractions.Processes.BRS_X01.InputExample.V1.Model;

public record Brs_X01_Example_V1()
: OrchestrationDescriptionUniqueNameDto("Brs_X01_Example", 1);
public record Brs_X01_InputExample_V1()
: OrchestrationDescriptionUniqueNameDto("Brs_X01_InputExample", 1);
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

using Energinet.DataHub.ProcessManager.Abstractions.Api.Model;

namespace Energinet.DataHub.Example.Orchestrations.Abstractions.Processes.BRS_X01.Example.V1.Model;
namespace Energinet.DataHub.ProcessManager.Example.Orchestrations.Abstractions.Processes.BRS_X01.InputExample.V1.Model;

/// <summary>
/// An immutable input to start the orchestration instance for BRS_X01 V1.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
using Energinet.DataHub.ProcessManager.Abstractions.Api.Model;
using Energinet.DataHub.ProcessManager.Abstractions.Api.Model.OrchestrationInstance;

namespace Energinet.DataHub.Example.Orchestrations.Abstractions.Processes.BRS_X01.Example.V1.Model;
namespace Energinet.DataHub.ProcessManager.Example.Orchestrations.Abstractions.Processes.BRS_X01.InputExample.V1.Model;

/// <summary>
/// Command for scheduling the BRS_X01.
/// Must be JSON serializable.
/// </summary>
public record ScheduleExampleCommandV1
public record ScheduleInputExampleCommandV1
: ScheduleOrchestrationInstanceCommand<InputV1>
{
/// <summary>
Expand All @@ -30,13 +30,13 @@ public record ScheduleExampleCommandV1
/// <param name="operatingIdentity">Identity of the user executing the command.</param>
/// <param name="inputParameter"> Contains the Durable Functions orchestration input parameter value.</param>
/// <param name="runAt">The time when the orchestration instance should be executed by the Scheduler.</param>
public ScheduleExampleCommandV1(
public ScheduleInputExampleCommandV1(
UserIdentityDto operatingIdentity,
InputV1 inputParameter,
DateTimeOffset runAt)
: base(
operatingIdentity,
orchestrationDescriptionUniqueName: new Brs_X01_Example_V1(),
orchestrationDescriptionUniqueName: new Brs_X01_InputExample_V1(),
inputParameter,
runAt)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,26 @@
using Energinet.DataHub.ProcessManager.Abstractions.Api.Model;
using Energinet.DataHub.ProcessManager.Abstractions.Api.Model.OrchestrationInstance;

namespace Energinet.DataHub.Example.Orchestrations.Abstractions.Processes.BRS_X01.Example.V1.Model;
namespace Energinet.DataHub.ProcessManager.Example.Orchestrations.Abstractions.Processes.BRS_X01.InputExample.V1.Model;

/// <summary>
/// Command for starting the BRS_X01.
/// Must be JSON serializable.
/// </summary>
public record StartExampleCommandV1
public record StartInputExampleCommandV1
: StartOrchestrationInstanceCommand<UserIdentityDto, InputV1>
{
/// <summary>
/// Construct command.
/// </summary>
/// <param name="operatingIdentity">Identity of the user executing the command.</param>
/// <param name="inputParameter"> contains the Durable Functions orchestration input parameter value.</param>
public StartExampleCommandV1(
public StartInputExampleCommandV1(
UserIdentityDto operatingIdentity,
InputV1 inputParameter)
: base(
operatingIdentity,
orchestrationDescriptionUniqueName: new Brs_X01_Example_V1(),
orchestrationDescriptionUniqueName: new Brs_X01_InputExample_V1(),
inputParameter)
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

using Energinet.DataHub.ProcessManager.Abstractions.Api.Model.OrchestrationDescription;

namespace Energinet.DataHub.Example.Orchestrations.Abstractions.Processes.BRS_X01.NoInputExample.V1.Model;
namespace Energinet.DataHub.ProcessManager.Example.Orchestrations.Abstractions.Processes.BRS_X01.NoInputExample.V1.Model;

public record Brs_X01_NoInputExample_V1()
: OrchestrationDescriptionUniqueNameDto("Brs_X01_NoInputExample_V1", 1);
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@
using Energinet.DataHub.ProcessManager.Abstractions.Api.Model;
using Energinet.DataHub.ProcessManager.Abstractions.Api.Model.OrchestrationInstance;

namespace Energinet.DataHub.Example.Orchestrations.Abstractions.Processes.BRS_X01.NoInputExample.V1.Model;
namespace Energinet.DataHub.ProcessManager.Example.Orchestrations.Abstractions.Processes.BRS_X01.NoInputExample.V1.Model;

/// <summary>
/// Command for starting a BRS-X01 no-input example.
/// Must be JSON serializable.
/// </summary>
public sealed record StartNoInputExampleComandV1
public sealed record StartNoInputExampleCommandV1
: StartOrchestrationInstanceCommand<UserIdentityDto>
{
/// <summary>
/// Construct command.
/// </summary>
/// <param name="operatingIdentity">Identity of the user executing the command.</param>
public StartNoInputExampleComandV1(
public StartNoInputExampleCommandV1(
UserIdentityDto operatingIdentity)
: base(
operatingIdentity,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

namespace Energinet.DataHub.Example.Orchestrations.Tests.Fixtures;
namespace Energinet.DataHub.ProcessManager.Example.Orchestrations.Tests.Fixtures;

/// <summary>
/// A xUnit collection fixture for ensuring tests don't run in parallel.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
using Energinet.DataHub.ProcessManager.Tests.Fixtures;
using Xunit.Abstractions;

namespace Energinet.DataHub.Example.Orchestrations.Tests.Fixtures;
namespace Energinet.DataHub.ProcessManager.Example.Orchestrations.Tests.Fixtures;

/// <summary>
/// Support testing the interactions with Example.Orchestrations and
/// Support testing the interactions with ProcessManager.Example.Orchestrations and
/// Process Manager Api, by coordinating the startup of the dependent applications
/// Example.Orchestrations and ProcessManager (Api).
/// ProcessManager.Example.Orchestrations and ProcessManager (Api).
/// </summary>
public class ExampleOrchestrationsAppFixture : IAsyncLifetime
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
using Energinet.DataHub.ProcessManager.Core.Tests.Fixtures;
using Xunit.Abstractions;

namespace Energinet.DataHub.Example.Orchestrations.Tests.Fixtures;
namespace Energinet.DataHub.ProcessManager.Example.Orchestrations.Tests.Fixtures;

/// <summary>
/// Support testing Example Orchestrations app and specifying configuration using inheritance.
Expand Down Expand Up @@ -101,7 +101,7 @@ public async Task StartAsync()
await DatabaseManager.CreateDatabaseAsync();

// Prepare host settings
var appHostSettings = CreateAppHostSettings("Example.Orchestrations");
var appHostSettings = CreateAppHostSettings("ProcessManager.Example.Orchestrations");

// Create and start host
AppHostManager = new FunctionAppHostManager(appHostSettings, TestLogger);
Expand Down
Loading

0 comments on commit b4be064

Please sign in to comment.