Skip to content

Commit

Permalink
Regenerate models using newer nswag (#180)
Browse files Browse the repository at this point in the history
* Regenerate models using newer nswag

* Disallow null workflow version

* Add missing "version" into exception message

* Update test to adjust to new null handling
  • Loading branch information
ognjenkatic authored Mar 6, 2024
1 parent 206595b commit d94f120
Show file tree
Hide file tree
Showing 34 changed files with 416 additions and 748 deletions.
2 changes: 1 addition & 1 deletion src/ConductorSharp.Client/ConductorSharp.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Authors>Codaxy</Authors>
<Company>Codaxy</Company>
<PackageId>ConductorSharp.Client</PackageId>
<Version>3.0.0-beta</Version>
<Version>3.0.1-beta</Version>
<Description>Client library for Netflix Conductor, with some additional quality of life features.</Description>
<RepositoryUrl>https://github.com/codaxy/conductor-sharp</RepositoryUrl>
<PackageTags>netflix;conductor</PackageTags>
Expand Down
798 changes: 403 additions & 395 deletions src/ConductorSharp.Client/Generated/Models.cs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/ConductorSharp.Engine/ConductorSharp.Engine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Authors>Codaxy</Authors>
<Company>Codaxy</Company>
<PackageId>ConductorSharp.Engine</PackageId>
<Version>3.0.0-beta</Version>
<Version>3.0.1-beta</Version>
<Description>Client library for Netflix Conductor, with some additional quality of life features.</Description>
<RepositoryUrl>https://github.com/codaxy/conductor-sharp</RepositoryUrl>
<PackageTags>netflix;conductor</PackageTags>
Expand Down
8 changes: 6 additions & 2 deletions src/ConductorSharp.Engine/Service/DeploymentService.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Threading.Tasks;
using System;
using System.Threading.Tasks;
using ConductorSharp.Client.Service;
using ConductorSharp.Engine.Interface;
using ConductorSharp.Engine.Model;
Expand Down Expand Up @@ -50,7 +51,10 @@ public async Task Remove(Deployment deployment)
var oldDefinition = await _metadataService.GetWorkflowAsync(definition.Name, definition.Version);

if (oldDefinition?.Name != null)
await _metadataService.DeleteWorkflowAsync(definition.Name, definition.Version);
await _metadataService.DeleteWorkflowAsync(
definition.Name,
definition.Version ?? throw new InvalidOperationException($"Workflow {definition.Name} version cannot be null")
);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/ConductorSharp.Patterns/ConductorSharp.Patterns.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
<Authors>Codaxy</Authors>
<Company>Codaxy</Company>
<Version>3.0.0-beta</Version>
<Version>3.0.1-beta</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/ConductorSharp.Toolkit/ConductorSharp.Toolkit.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<Nullable>disable</Nullable>
<PackAsTool>true</PackAsTool>
<ToolCommandName>dotnet-conductorsharp</ToolCommandName>
<Version>3.0.0-beta</Version>
<Version>3.0.1-beta</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
3 changes: 2 additions & 1 deletion src/ConductorSharp.Toolkit/Service/ScaffoldingService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ public async Task Scaffold()
var modelGenerator = new TaskModelGenerator(_config.BaseNamespace + ".Workflows", name, TaskModelGenerator.ModelType.Workflow)
{
OriginalName = workflowDefinition.Name,
Version = workflowDefinition.Version
Version =
workflowDefinition.Version ?? throw new InvalidOperationException($"Workflow {workflowDefinition.Name} version cannot be null")
};

foreach (var inputParam in workflowDefinition.InputParameters)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public void BuilderReturnsCorrectDefinitionStringAddition()
}

[Fact]
public void BuilderReturnsCorrectDefinitionCSharpLambdaWorfklow()
public void BuilderReturnsCorrectDefinitionCSharpLambdaWorkflow()
{
var definition = GetDefinitionFromWorkflow<CSharpLambdaWorkflow>();
var expectedDefinition = EmbeddedFileHelper.GetLinesFromEmbeddedFile("~/Samples/Workflows/CSharpLambdaWorkflow.json");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"ownerApp": "undefined",
"createTime": 0,
"updateTime": 0,
"createdBy": "UNDEFINED",
"updatedBy": "UNDEFINED",
"name": "CUSTOMER_get",
Expand Down
13 changes: 0 additions & 13 deletions test/ConductorSharp.Engine.Tests/Samples/Workflows/Arrays.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
"createTime": 0,
"updateTime": 0,
"name": "arrays",
"version": 1,
"tasks": [
Expand Down Expand Up @@ -39,11 +37,7 @@
]
},
"type": "SIMPLE",
"startDelay": 0,
"optional": false,
"rateLimited": false,
"asyncComplete": false,
"retryCount": 0,
"workflowTaskType": "SIMPLE"
},
{
Expand All @@ -55,11 +49,7 @@
"objects": []
},
"type": "SIMPLE",
"startDelay": 0,
"optional": false,
"rateLimited": false,
"asyncComplete": false,
"retryCount": 0,
"workflowTaskType": "SIMPLE"
}
],
Expand All @@ -68,8 +58,5 @@
],
"outputParameters": {},
"schemaVersion": 2,
"restartable": false,
"workflowStatusListenerEnabled": false,
"timeoutPolicy": "TIME_OUT_WF",
"timeoutSeconds": 0
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
"createTime": 0,
"updateTime": 0,
"name": "c_sharp_lambda_workflow",
"version": 1,
"tasks": [
Expand All @@ -14,11 +12,7 @@
}
},
"type": "SIMPLE",
"startDelay": 0,
"optional": false,
"rateLimited": false,
"asyncComplete": false,
"retryCount": 0,
"workflowTaskType": "SIMPLE"
},
{
Expand All @@ -41,11 +35,7 @@
}
},
"type": "SIMPLE",
"startDelay": 0,
"optional": false,
"rateLimited": false,
"asyncComplete": false,
"retryCount": 0,
"workflowTaskType": "SIMPLE"
}
],
Expand All @@ -60,20 +50,11 @@
}
},
"type": "SIMPLE",
"startDelay": 0,
"optional": false,
"rateLimited": false,
"asyncComplete": false,
"retryCount": 0,
"workflowTaskType": "SIMPLE"
}
]
},
"startDelay": 0,
"optional": false,
"rateLimited": false,
"asyncComplete": false,
"retryCount": 0,
"workflowTaskType": "DECISION"
}
],
Expand All @@ -83,9 +64,6 @@
],
"outputParameters": {},
"schemaVersion": 2,
"restartable": false,
"workflowStatusListenerEnabled": false,
"ownerEmail": "[email protected]",
"timeoutPolicy": "TIME_OUT_WF",
"timeoutSeconds": 0
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
"createTime": 0,
"updateTime": 0,
"name": "cast_workflow",
"version": 1,
"tasks": [
Expand All @@ -11,11 +9,7 @@
"customer_id": 1
},
"type": "SIMPLE",
"startDelay": 0,
"optional": false,
"rateLimited": false,
"asyncComplete": false,
"retryCount": 0,
"workflowTaskType": "SIMPLE"
},
{
Expand All @@ -26,19 +20,12 @@
"address": "${get_customer.output.address}"
},
"type": "SIMPLE",
"startDelay": 0,
"optional": false,
"rateLimited": false,
"asyncComplete": false,
"retryCount": 0,
"workflowTaskType": "SIMPLE"
}
],
"inputParameters": [],
"outputParameters": {},
"schemaVersion": 2,
"restartable": false,
"workflowStatusListenerEnabled": false,
"timeoutPolicy": "TIME_OUT_WF",
"timeoutSeconds": 0
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
"createTime": 0,
"updateTime": 0,
"name": "NOTIFICATION_conditionally_send_to_customer",
"version": 1,
"tasks": [
Expand All @@ -21,24 +19,15 @@
"id": "${workflow.input.customer_id}"
},
"type": "SUB_WORKFLOW",
"startDelay": 0,
"subWorkflowParam": {
"name": "NOTIFICATION_send_to_customer",
"version": 3
},
"optional": false,
"rateLimited": false,
"asyncComplete": false,
"retryCount": 0,
"workflowTaskType": "SUB_WORKFLOW"
}
]
},
"startDelay": 0,
"optional": false,
"rateLimited": false,
"asyncComplete": false,
"retryCount": 0,
"workflowTaskType": "DECISION"
}
],
Expand All @@ -48,8 +37,5 @@
],
"outputParameters": {},
"schemaVersion": 2,
"restartable": false,
"workflowStatusListenerEnabled": false,
"timeoutPolicy": "TIME_OUT_WF",
"timeoutSeconds": 0
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
"createTime": 0,
"updateTime": 0,
"name": "TEST_decision_in_decision",
"version": 1,
"tasks": [
Expand Down Expand Up @@ -31,33 +29,19 @@
"id": "${workflow.input.customer_id}"
},
"type": "SUB_WORKFLOW",
"startDelay": 0,
"subWorkflowParam": {
"name": "NOTIFICATION_send_to_customer",
"version": 3
},
"optional": false,
"rateLimited": false,
"asyncComplete": false,
"retryCount": 0,
"workflowTaskType": "SUB_WORKFLOW"
}
]
},
"startDelay": 0,
"optional": false,
"rateLimited": false,
"asyncComplete": false,
"retryCount": 0,
"workflowTaskType": "DECISION"
}
]
},
"startDelay": 0,
"optional": false,
"rateLimited": false,
"asyncComplete": false,
"retryCount": 0,
"workflowTaskType": "DECISION"
}
],
Expand All @@ -67,8 +51,5 @@
],
"outputParameters": {},
"schemaVersion": 2,
"restartable": false,
"workflowStatusListenerEnabled": false,
"timeoutPolicy": "TIME_OUT_WF",
"timeoutSeconds": 0
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
"createTime": 0,
"updateTime": 0,
"name": "decision_task",
"version": 1,
"tasks": [
Expand All @@ -21,11 +19,7 @@
"customer_id": 1
},
"type": "SIMPLE",
"startDelay": 0,
"optional": false,
"rateLimited": false,
"asyncComplete": false,
"retryCount": 0,
"workflowTaskType": "SIMPLE"
}
]
Expand All @@ -38,27 +32,14 @@
"terminationStatus": "FAILED"
},
"type": "TERMINATE",
"startDelay": 0,
"optional": false,
"rateLimited": false,
"asyncComplete": false,
"retryCount": 0,
"workflowTaskType": "TERMINATE"
}
],
"startDelay": 0,
"optional": false,
"rateLimited": false,
"asyncComplete": false,
"retryCount": 0,
"workflowTaskType": "DECISION"
}
],
"inputParameters": [],
"outputParameters": {},
"schemaVersion": 2,
"restartable": false,
"workflowStatusListenerEnabled": false,
"timeoutPolicy": "TIME_OUT_WF",
"timeoutSeconds": 0
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
"createTime": 0,
"updateTime": 0,
"name": "TEST_dynamic_task",
"version": 1,
"tasks": [
Expand All @@ -14,11 +12,6 @@
},
"type": "DYNAMIC",
"dynamicTaskNameParam": "task_to_execute",
"startDelay": 0,
"optional": false,
"rateLimited": false,
"asyncComplete": false,
"retryCount": 0,
"workflowTaskType": "DYNAMIC"
}
],
Expand All @@ -30,8 +23,5 @@
],
"outputParameters": {},
"schemaVersion": 2,
"restartable": false,
"workflowStatusListenerEnabled": false,
"timeoutPolicy": "TIME_OUT_WF",
"timeoutSeconds": 0
}
Loading

0 comments on commit d94f120

Please sign in to comment.