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

Upgrade Durable V3.x to use .NET 6 Framework only #2864

Merged
merged 20 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
35 changes: 0 additions & 35 deletions WebJobs.Extensions.DurableTask.sln
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{78BCF152-C
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebJobs.Extensions.DurableTask.Tests.V2", "test\FunctionsV2\WebJobs.Extensions.DurableTask.Tests.V2.csproj", "{F2A5DABB-36D4-4152-AF49-2570149899E1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebJobs.Extensions.DurableTask.Tests.V1", "test\FunctionsV1\WebJobs.Extensions.DurableTask.Tests.V1.csproj", "{F99CA746-553C-43B4-943B-59A5D190459A}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{9850DECF-CBA2-43E7-B5E2-55053DD308E9}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
Expand All @@ -24,17 +22,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
.stylecop\stylecop.json = .stylecop\stylecop.json
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VSSampleV1", "test\SmokeTests\SmokeTestsV1\VSSampleV1.csproj", "{78141F66-4DDD-4ABB-9DE3-D0B426FE8110}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SmokeTests", "SmokeTests", "{A8CF6993-258A-484A-AF6D-6CC88D36AF93}"
ProjectSection(SolutionItems) = preProject
test\SmokeTests\e2e-test.ps1 = test\SmokeTests\e2e-test.ps1
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VSSampleV2", "test\SmokeTests\SmokeTestsV2\VSSampleV2.csproj", "{E997024B-633E-4252-880B-E2A726E1B4A4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VSSampleV3", "test\SmokeTests\SmokeTestsV3\VSSampleV3.csproj", "{F1611EF4-457B-47CB-94E9-B611EE488984}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "JavaScript", "JavaScript", "{7B2EDAEC-CFD0-404A-8E52-133FFF595C2F}"
ProjectSection(SolutionItems) = preProject
test\SmokeTests\OOProcSmokeTests\durableJS\Dockerfile = test\SmokeTests\OOProcSmokeTests\durableJS\Dockerfile
Expand Down Expand Up @@ -88,8 +80,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "pipelines", "pipelines", "{
.github\workflows\smoketest-python37-v4.yml = .github\workflows\smoketest-python37-v4.yml
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DFPerfScenariosV1", "test\DFPerfScenariosV1\DFPerfScenariosV1.csproj", "{65F904AA-0F6F-48CB-BE19-593B7D68152A}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PerfTests", "PerfTests", "{7387E723-E153-4B7A-B105-8C67BFBD48CF}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DFPerfScenariosV4", "test\DFPerfScenarios\DFPerfScenariosV4.csproj", "{FC8AD123-F949-4D21-B817-E5A4BBF7F69B}"
Expand All @@ -110,22 +100,6 @@ Global
{F2A5DABB-36D4-4152-AF49-2570149899E1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F2A5DABB-36D4-4152-AF49-2570149899E1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F2A5DABB-36D4-4152-AF49-2570149899E1}.Release|Any CPU.Build.0 = Release|Any CPU
{F99CA746-553C-43B4-943B-59A5D190459A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F99CA746-553C-43B4-943B-59A5D190459A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F99CA746-553C-43B4-943B-59A5D190459A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F99CA746-553C-43B4-943B-59A5D190459A}.Release|Any CPU.Build.0 = Release|Any CPU
{78141F66-4DDD-4ABB-9DE3-D0B426FE8110}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{78141F66-4DDD-4ABB-9DE3-D0B426FE8110}.Debug|Any CPU.Build.0 = Debug|Any CPU
{78141F66-4DDD-4ABB-9DE3-D0B426FE8110}.Release|Any CPU.ActiveCfg = Release|Any CPU
{78141F66-4DDD-4ABB-9DE3-D0B426FE8110}.Release|Any CPU.Build.0 = Release|Any CPU
{E997024B-633E-4252-880B-E2A726E1B4A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E997024B-633E-4252-880B-E2A726E1B4A4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E997024B-633E-4252-880B-E2A726E1B4A4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E997024B-633E-4252-880B-E2A726E1B4A4}.Release|Any CPU.Build.0 = Release|Any CPU
{F1611EF4-457B-47CB-94E9-B611EE488984}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F1611EF4-457B-47CB-94E9-B611EE488984}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F1611EF4-457B-47CB-94E9-B611EE488984}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F1611EF4-457B-47CB-94E9-B611EE488984}.Release|Any CPU.Build.0 = Release|Any CPU
{9BA6093A-F71A-49F9-A159-B98ACBE41636}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9BA6093A-F71A-49F9-A159-B98ACBE41636}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9BA6093A-F71A-49F9-A159-B98ACBE41636}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -172,10 +146,6 @@ Global
{5F5FAF27-D6B8-4A60-ACF2-F63D13F89CA2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5F5FAF27-D6B8-4A60-ACF2-F63D13F89CA2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5F5FAF27-D6B8-4A60-ACF2-F63D13F89CA2}.Release|Any CPU.Build.0 = Release|Any CPU
{65F904AA-0F6F-48CB-BE19-593B7D68152A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{65F904AA-0F6F-48CB-BE19-593B7D68152A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{65F904AA-0F6F-48CB-BE19-593B7D68152A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{65F904AA-0F6F-48CB-BE19-593B7D68152A}.Release|Any CPU.Build.0 = Release|Any CPU
{FC8AD123-F949-4D21-B817-E5A4BBF7F69B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FC8AD123-F949-4D21-B817-E5A4BBF7F69B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FC8AD123-F949-4D21-B817-E5A4BBF7F69B}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -191,11 +161,7 @@ Global
GlobalSection(NestedProjects) = preSolution
{51790AFE-5B8E-4795-9EA3-D2B15D04B5AC} = {7EC858EE-3481-4A82-AED4-CB00C34F42D0}
{F2A5DABB-36D4-4152-AF49-2570149899E1} = {78BCF152-C22C-408F-9FB1-0F8C99B154B5}
{F99CA746-553C-43B4-943B-59A5D190459A} = {78BCF152-C22C-408F-9FB1-0F8C99B154B5}
{78141F66-4DDD-4ABB-9DE3-D0B426FE8110} = {A8CF6993-258A-484A-AF6D-6CC88D36AF93}
{A8CF6993-258A-484A-AF6D-6CC88D36AF93} = {78BCF152-C22C-408F-9FB1-0F8C99B154B5}
{E997024B-633E-4252-880B-E2A726E1B4A4} = {A8CF6993-258A-484A-AF6D-6CC88D36AF93}
{F1611EF4-457B-47CB-94E9-B611EE488984} = {A8CF6993-258A-484A-AF6D-6CC88D36AF93}
{7B2EDAEC-CFD0-404A-8E52-133FFF595C2F} = {A8CF6993-258A-484A-AF6D-6CC88D36AF93}
{9BA6093A-F71A-49F9-A159-B98ACBE41636} = {7B2EDAEC-CFD0-404A-8E52-133FFF595C2F}
{FA53EBC4-8265-4063-B9F8-0D5EA0366B90} = {A8CF6993-258A-484A-AF6D-6CC88D36AF93}
Expand All @@ -214,7 +180,6 @@ Global
{9B0F4A0A-1B18-4E98-850A-14A2F76F673D} = {A8CF6993-258A-484A-AF6D-6CC88D36AF93}
{FF6CD07A-A4BF-43C5-B14E-213328DEB835} = {9B0F4A0A-1B18-4E98-850A-14A2F76F673D}
{5F5FAF27-D6B8-4A60-ACF2-F63D13F89CA2} = {7EC858EE-3481-4A82-AED4-CB00C34F42D0}
{65F904AA-0F6F-48CB-BE19-593B7D68152A} = {7387E723-E153-4B7A-B105-8C67BFBD48CF}
{7387E723-E153-4B7A-B105-8C67BFBD48CF} = {78BCF152-C22C-408F-9FB1-0F8C99B154B5}
{FC8AD123-F949-4D21-B817-E5A4BBF7F69B} = {7387E723-E153-4B7A-B105-8C67BFBD48CF}
{76DEC17C-BF6A-498A-8E8A-7D6CB2E03284} = {78BCF152-C22C-408F-9FB1-0F8C99B154B5}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@
using DurableTask.Core;
using DurableTask.Core.Entities;
using Microsoft.Azure.WebJobs.Extensions.DurableTask.Storage;
using Microsoft.Azure.WebJobs.Host.Scale;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Serialization;
#if !FUNCTIONS_V1
using Microsoft.Azure.WebJobs.Host.Scale;
#endif
using AzureStorage = DurableTask.AzureStorage;
using DTCore = DurableTask.Core;

Expand Down Expand Up @@ -223,8 +221,6 @@ internal static OrchestrationInstanceStatusQueryCondition ConvertWebjobsDurableC
};
}

#if !FUNCTIONS_V1

internal DurableTaskMetricsProvider GetMetricsProvider(
string functionName,
string hubName,
Expand Down Expand Up @@ -254,8 +250,6 @@ public override bool TryGetScaleMonitor(
return true;
}

#endif
#if FUNCTIONS_V3_OR_GREATER
public override bool TryGetTargetScaler(
string functionId,
string functionName,
Expand All @@ -269,6 +263,5 @@ public override bool TryGetTargetScaler(
targetScaler = new DurableTaskTargetScaler(functionId, metricsProvider, this, this.logger);
return true;
}
#endif
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,7 @@ public Task<ITriggerData> BindAsync(object value, ValueBindingContext context)
if (destinationType == typeof(IDurableEntityContext))
{
convertedValue = entityContext;
#if !FUNCTIONS_V1
((IDurableEntityContext)value).FunctionBindingContext = context.FunctionContext;
#endif
}
else if (destinationType == typeof(string))
{
Expand All @@ -128,7 +126,6 @@ public Task<ITriggerData> BindAsync(object value, ValueBindingContext context)
var triggerData = new TriggerData(inputValueProvider, bindingData);
return Task.FromResult<ITriggerData>(triggerData);
}
#if FUNCTIONS_V3_OR_GREATER
else if (value is RemoteEntityContext remoteContext)
{
// Generate a byte array which is the serialized protobuf payload
Expand All @@ -142,7 +139,6 @@ public Task<ITriggerData> BindAsync(object value, ValueBindingContext context)
var triggerData = new TriggerData(contextValueProvider, EmptyBindingData);
return Task.FromResult<ITriggerData>(triggerData);
}
#endif
else
{
throw new ArgumentException($"Don't know how to bind to {value?.GetType().Name ?? "null"}.", nameof(value));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ public Task<ITriggerData> BindAsync(object? value, ValueBindingContext context)
var triggerData = new TriggerData(contextValueProvider, bindingData);
return Task.FromResult<ITriggerData>(triggerData);
}
#if FUNCTIONS_V3_OR_GREATER
else if (value is RemoteOrchestratorContext remoteContext)
{
// Generate a byte array which is the serialized protobuf payload
Expand All @@ -180,7 +179,6 @@ public Task<ITriggerData> BindAsync(object? value, ValueBindingContext context)
var triggerData = new TriggerData(contextValueProvider, EmptyBindingData);
return Task.FromResult<ITriggerData>(triggerData);
}
#endif
else
{
throw new ArgumentException($"Don't know how to bind to {value?.GetType().Name ?? "null"}.", nameof(value));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,7 @@ bool IDurableEntityContext.HasState

internal int OutboxPosition => this.outbox.Count;

#if !FUNCTIONS_V1
public FunctionBindingContext FunctionBindingContext { get; set; }
#endif

public void CaptureInternalError(Exception e, TaskEntityShim shim)
{
Expand Down Expand Up @@ -524,11 +522,7 @@ async Task IDurableEntityContext.DispatchAsync<T>(params object[] constructorPar
args = Array.Empty<object>();
}

#if !FUNCTIONS_V1
T Constructor() => (T)context.FunctionBindingContext.CreateObjectInstance(typeof(T), constructorParameters);
#else
T Constructor() => (T)Activator.CreateInstance(typeof(T), constructorParameters);
#endif

var state = ((Extensions.DurableTask.DurableEntityContext)context).GetStateWithInjectedDependencies(Constructor);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,10 @@ public interface IDurableEntityContext
/// </remarks>
string OperationName { get; }

#if !FUNCTIONS_V1
/// <summary>
/// Contains function invocation context to assist with dependency injection at Entity construction time.
/// </summary>
FunctionBindingContext FunctionBindingContext { get; set; }
#endif

/// <summary>
/// Whether this entity has a state.
Expand Down
8 changes: 1 addition & 7 deletions src/WebJobs.Extensions.DurableTask/DurabilityProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@
using DurableTask.Core.Entities;
using DurableTask.Core.History;
using DurableTask.Core.Query;
using Microsoft.Azure.WebJobs.Host.Scale;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
#if !FUNCTIONS_V1
using Microsoft.Azure.WebJobs.Host.Scale;
#endif

namespace Microsoft.Azure.WebJobs.Extensions.DurableTask
{
Expand Down Expand Up @@ -562,7 +560,6 @@ internal virtual bool ConnectionNameMatches(DurabilityProvider durabilityProvide
return this.ConnectionName.Equals(durabilityProvider.ConnectionName);
}

#if !FUNCTIONS_V1
/// <summary>
/// Tries to obtain a scale monitor for autoscaling.
/// </summary>
Expand All @@ -582,9 +579,7 @@ public virtual bool TryGetScaleMonitor(
scaleMonitor = null;
return false;
}
#endif

#if FUNCTIONS_V3_OR_GREATER
/// <summary>
/// Tries to obtain a scaler for target based scaling.
/// </summary>
Expand All @@ -604,6 +599,5 @@ public virtual bool TryGetTargetScaler(
targetScaler = null;
return false;
}
#endif
}
}
Loading
Loading