Skip to content
Draft
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
4 changes: 2 additions & 2 deletions .github/workflows/E2ETest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ name: End to End Test - .NET Isolated/Func V4
on:
workflow_dispatch:
push:
branches: [ main, dev, andystaples/add-gh-action-for-e2e-tests ]
branches: [ main, dev, andystaples/add-gh-action-for-e2e-tests, nytian/v3.1.0, nytian/sc-hotfix-v3.1.0 ]
paths:
- 'src/**'
- 'test/e2e/**'
pull_request:
branches: [ main, dev, andystaples/add-gh-action-for-e2e-tests ]
branches: [ main, dev, andystaples/add-gh-action-for-e2e-tests, nytian/v3.1.0, nytian/sc-hotfix-v3.1.0 ]
paths:
- 'src/**'
- 'test/e2e/**'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeQL.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ name: "CodeQL"

on:
push:
branches: [ "main", "*" ] # TODO: remove development branch after approval
branches: [ "main", "*", "nytian/v3.1.0", "nytian/sc-hotfix-v3.1.0" ] # TODO: remove development branch after approval
pull_request:
branches: [ "main", "*"] # TODO: remove development branch after approval
branches: [ "main", "*", "nytian/v3.1.0", "nytian/sc-hotfix-v3.1.0"] # TODO: remove development branch after approval
schedule:
- cron: '0 0 * * 1' # Weekly Monday run, needed for weekly reports
workflow_call: # allows to be invoked as part of a larger workflow
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/smoketest-dotnet-isolated-v4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ name: Smoke Test - .NET Isolated on Functions V4
on:
workflow_dispatch:
push:
branches: [ main, dev ]
branches: [ main, dev, nytian/sc-hotfix-v3.1.0 ]
paths:
- 'src/**'
- 'test/SmokeTests/OOProcSmokeTests/DotNetIsolated/**'
pull_request:
branches: [ main, dev ]
branches: [ main, dev, nytian/v3.1.0, nytian/sc-hotfix-v3.1.0 ]
paths:
- 'src/**'
- 'test/SmokeTests/OOProcSmokeTests/DotNetIsolated/**'
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/smoketest-java8-v4.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Smoke Test - Java 8 on Functions V4
name: Smoke Test - Java 17 on Functions V4

on:
workflow_dispatch:
Expand All @@ -8,7 +8,7 @@ on:
- 'src/**'
- 'test/SmokeTests/OOProcSmokeTests/durableJava/**'
pull_request:
branches: [ main, dev ]
branches: [ main, dev, nytian/v3.1.0 , nytian/sc-hotfix-v3.1.0]
paths:
- 'src/**'
- 'test/SmokeTests/OOProcSmokeTests/durableJava/**'
Expand All @@ -18,15 +18,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '8'
java-version: '17'
distribution: 'temurin'
- name: Build azure functions sample
uses: gradle/gradle-build-action@bc3340afc5e3cc44f2321809ac090d731c13c514
with:
gradle-version: 6.5
gradle-version: 7.4
arguments: azureFunctionsPackage -p test/SmokeTests/OOProcSmokeTests/durableJava/
continue-on-error: true
- name: Download azure functions java library # TODO: Remove this step once gradle plugin is updated
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/smoketest-mssql-inproc-v4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- 'test/SmokeTests/BackendSmokeTests/MSSQL/**'
- '.github/workflows/smoketest-mssql-inproc-v4.yml'
pull_request:
branches: [ main, dev ]
branches: [ main, dev, nytian/v3.1.0 , nytian/sc-hotfix-v3.1.0]
paths:
- 'src/**'
- 'test/SmokeTests/BackendSmokeTests/MSSQL/**'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/smoketest-netherite-inproc-v4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- 'src/**'
- 'test/SmokeTests/BackendSmokeTests/Netherite/**'
pull_request:
branches: [ main, dev ]
branches: [ main, dev, nytian/v3.1.0 , nytian/sc-hotfix-v3.1.0]
paths:
- 'src/**'
- 'test/SmokeTests/BackendSmokeTests/Netherite/**'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/smoketest-node14-v4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- 'src/**'
- 'test/SmokeTests/OOProcSmokeTests/durableJS/**'
pull_request:
branches: [ main, dev ]
branches: [ main, dev, nytian/v3.1.0 , nytian/sc-hotfix-v3.1.0]
paths:
- 'src/**'
- 'test/SmokeTests/OOProcSmokeTests/durableJS/**'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/smoketest-python37-v4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- 'src/**'
- 'test/SmokeTests/OOProcSmokeTests/durablePy/**'
pull_request:
branches: [ main, dev ]
branches: [ main, dev, nytian/v3.1.0 , nytian/sc-hotfix-v3.1.0]
paths:
- 'src/**'
- 'test/SmokeTests/OOProcSmokeTests/durablePy/**'
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/validate-build-analyzer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ on:
branches:
- main
- dev
- nytian/v3.1.0
paths-ignore: [ '**.md' ]
pull_request:
branches:
- '*'
- nytian/v3.1.0
- nytian/sc-hotfix-v3.1.0
paths-ignore: [ '**.md' ]

env:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/validate-build-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ on:
branches:
- main
- dev
- nytian/v3.1.0
paths-ignore: [ '**.md' ]
pull_request:
branches:
- '*'
- nytian/v3.1.0
- nytian/sc-hotfix-v3.1.0
paths-ignore: [ '**.md' ]

env:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/validate-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ on:
branches:
- main
- dev
- nytian/v3.1.0
paths-ignore: [ '**.md' ]
pull_request:
branches:
- '*'
- nytian/v3.1.0
- nytian/sc-hotfix-v3.1.0
paths-ignore: [ '**.md' ]

env:
Expand Down
10 changes: 0 additions & 10 deletions eng/templates/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,3 @@ jobs:
Contents: '**'
TargetFolder: '$(System.DefaultWorkingDirectory)/azure-functions-durable-extension/'

# We also need to build the Java smoke test, for CodeQL compliance
# We don't need to build the other smoke tests, because they can be analyzed without being compiled,
# as they're interpreted languages.
# This could be a separate pipeline, but the task is so small that it's paired with the .NET code build
# for convenience.
- pwsh: |
cd ./test/SmokeTests/OOProcSmokeTests/durableJava/
gradle build
ls
displayName: 'Build Java OOProc test (for CodeQL compliance)'
15 changes: 15 additions & 0 deletions src/WebJobs.Extensions.DurableTask/IDurabilityProviderFactory.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
using System;
using Microsoft.Azure.WebJobs.Host.Scale;

namespace Microsoft.Azure.WebJobs.Extensions.DurableTask
{
Expand All @@ -25,5 +27,18 @@ public interface IDurabilityProviderFactory
/// <param name="attribute">A durable client attribute with parameters for the durability provider.</param>
/// <returns>A durability provider to be used by a client function.</returns>
DurabilityProvider GetDurabilityProvider(DurableClientAttribute attribute);

/// <summary>
/// Creates or retrieves a cached durability provider to be used in a given function execution.
/// </summary>
/// <param name="attribute">A durable client attribute with parameters for the durability provider.</param>
/// <param name="triggerMetadata">Trigger metadata used to create IOrchestrationService for functions scale scenarios.</param>
/// <returns>A durability provider to be used by a client function.</returns>
DurabilityProvider GetDurabilityProvider(DurableClientAttribute attribute, TriggerMetadata triggerMetadata)
{
// This method is not supported by this provider.
// Only providers that require TriggerMetadata for scale should implement it.
throw new NotImplementedException("This provider does not support GetDurabilityProvider with TriggerMetadata.");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using System.Collections.Generic;
using System.ComponentModel;
using Microsoft.Azure.WebJobs.Host.Scale;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Newtonsoft.Json;
Expand All @@ -15,6 +14,8 @@ namespace Microsoft.Azure.WebJobs.Extensions.DurableTask.Scale
{
internal class DurableTaskTriggersScaleProvider : IScaleMonitorProvider, ITargetScalerProvider
{
private const string AzureManagedProviderName = "azureManaged";

private readonly IScaleMonitor monitor;
private readonly ITargetScaler targetScaler;
private readonly DurableTaskOptions options;
Expand All @@ -40,7 +41,16 @@ public DurableTaskTriggersScaleProvider(
this.GetOptions(triggerMetadata);

IDurabilityProviderFactory durabilityProviderFactory = this.GetDurabilityProviderFactory();
DurabilityProvider defaultDurabilityProvider = durabilityProviderFactory.GetDurabilityProvider();

DurabilityProvider defaultDurabilityProvider;
if (string.Equals(durabilityProviderFactory.Name, AzureManagedProviderName, StringComparison.OrdinalIgnoreCase))
{
defaultDurabilityProvider = durabilityProviderFactory.GetDurabilityProvider(attribute: null, triggerMetadata);
}
else
{
defaultDurabilityProvider = durabilityProviderFactory.GetDurabilityProvider();
}

// Note: `this.options` is populated from the trigger metadata above
string? connectionName = GetConnectionName(durabilityProviderFactory, this.options);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
<RootNamespace>Microsoft.Azure.WebJobs.Extensions.DurableTask</RootNamespace>
<MajorVersion>3</MajorVersion>
<MinorVersion>1</MinorVersion>
<PatchVersion>0</PatchVersion>
<PatchVersion>1</PatchVersion>
<VersionSuffix>schotfix.0</VersionSuffix>
<VersionPrefix>$(MajorVersion).$(MinorVersion).$(PatchVersion)</VersionPrefix>
<FileVersion>$(MajorVersion).$(MinorVersion).$(PatchVersion)</FileVersion>
<AssemblyVersion>$(MajorVersion).0.0.0</AssemblyVersion>
Expand Down
2 changes: 1 addition & 1 deletion src/Worker.Extensions.DurableTask/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
using Microsoft.Azure.Functions.Worker.Extensions.Abstractions;

// TODO: Find a way to generate this dynamically at build-time
[assembly: ExtensionInformation("Microsoft.Azure.WebJobs.Extensions.DurableTask", "3.1.0")]
[assembly: ExtensionInformation("Microsoft.Azure.WebJobs.Extensions.DurableTask", "3.1.0-schotfix.0")]
[assembly: InternalsVisibleTo("Worker.Extensions.DurableTask.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100cd1dabd5a893b40e75dc901fe7293db4a3caf9cd4d3e3ed6178d49cd476969abe74a9e0b7f4a0bb15edca48758155d35a4f05e6e852fff1b319d103b39ba04acbadd278c2753627c95e1f6f6582425374b92f51cca3deb0d2aab9de3ecda7753900a31f70a236f163006beefffe282888f85e3c76d1205ec7dfef7fa472a17b1")]
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
<AssemblyOriginatorKeyFile>..\..\sign.snk</AssemblyOriginatorKeyFile>

<!-- Version information -->
<VersionPrefix>1.3.0</VersionPrefix>
<VersionSuffix></VersionSuffix>
<VersionPrefix>1.3.1</VersionPrefix>
<VersionSuffix>schotfix.0</VersionSuffix>
<AssemblyVersion>$(VersionPrefix).0</AssemblyVersion>
<!-- FileVersionRevision is expected to be set by the CI. -->
<FileVersion Condition="'$(FileVersionRevision)' != ''">$(VersionPrefix).$(FileVersionRevision)</FileVersion>
Expand Down
1 change: 0 additions & 1 deletion test/FunctionsV2/EmulatorDurabilityProviderFactory.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using DurableTask.Core;
using DurableTask.Emulator;

namespace Microsoft.Azure.WebJobs.Extensions.DurableTask
Expand Down
2 changes: 1 addition & 1 deletion test/SmokeTests/OOProcSmokeTests/durableJava/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ COPY . /root
RUN cd /root/test/SmokeTests/OOProcSmokeTests/durableJava && \
dotnet build -o bin

FROM mcr.microsoft.com/azure-functions/java:4-java8
FROM mcr.microsoft.com/azure-functions/java:4-java17
# Copy the bin folder generated at /root/test/SmokeTests/OOProcSmokeTests/durableJava
COPY --from=build-env /root/test/SmokeTests/OOProcSmokeTests/durableJava /home/site/wwwroot

Expand Down
6 changes: 3 additions & 3 deletions test/SmokeTests/OOProcSmokeTests/durableJava/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ dependencies {
runtimeOnly "io.grpc:grpc-netty-shaded:1.38.0"
}

sourceCompatibility = '1.8'
targetCompatibility = '1.8'
sourceCompatibility = '17'
targetCompatibility = '17'

compileJava.options.encoding = 'UTF-8'

Expand All @@ -36,7 +36,7 @@ azurefunctions {
region = 'westus'
runtime {
os = 'Windows'
javaVersion = 'Java 8'
javaVersion = 'Java 17'
}
auth {
type = 'azure_cli'
Expand Down
Loading