-
Notifications
You must be signed in to change notification settings - Fork 284
Allow overriding orchestration version when starting orchestrations via APIs in PowerShell, Python, and Node.js #3213
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
Merged
Merged
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
3ff4f0b
Use orchestration and sub-orchestration versions explicitly specified…
AnatoliB 2635efd
Fix SubOrchestrator_VersionPropagation
AnatoliB b405e83
Remove unnecessary tests
AnatoliB 77801ab
Improve formatting
AnatoliB 0b999a8
Update release notes to include orchestration version override featur…
AnatoliB 982fc3b
Fix return value for non-orchestrator functions to use an empty strin…
AnatoliB a6d1271
Merge branch 'dev' into anatolib/override-orch-version
AnatoliB File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
src/WebJobs.Extensions.DurableTask/FunctionNameWithVersion.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| // Copyright (c) .NET Foundation. All rights reserved. | ||
| // Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
|
||
| namespace Microsoft.Azure.WebJobs.Extensions.DurableTask | ||
| { | ||
| /// <summary> | ||
| /// Utility class for handling function names with optional version information. | ||
| /// </summary> | ||
| internal static class FunctionNameWithVersion | ||
| { | ||
| /// <summary> | ||
| /// Delimiter used to separate function name from version in serialized format. | ||
| /// </summary> | ||
| internal const char Delimiter = '\n'; | ||
|
|
||
| /// <summary> | ||
| /// Combines a function name and optional version into a single string. | ||
| /// </summary> | ||
| /// <param name="functionName">The name of the function.</param> | ||
| /// <param name="version">The optional version string. If null, only the function name is returned.</param> | ||
| /// <returns>The combined function name and version string, or just the function name if version is null.</returns> | ||
| internal static string Combine(string functionName, string version) | ||
| { | ||
| return version == null ? functionName : functionName + Delimiter + version; | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Parses a combined function name and version string into separate components. | ||
| /// </summary> | ||
| /// <param name="functionNameAndVersion">The combined function name and version string.</param> | ||
| /// <returns>A tuple containing the function name and version. Version will be null if no delimiter is found.</returns> | ||
| internal static (string functionName, string version) Parse(string functionNameAndVersion) | ||
| { | ||
| int delimiterIndex = functionNameAndVersion.IndexOf(Delimiter); | ||
| if (delimiterIndex < 0) | ||
| { | ||
| // No version specified | ||
| return (functionNameAndVersion, null); | ||
| } | ||
|
|
||
| // Function name and version are separated by delimiter | ||
| var functionName = functionNameAndVersion.Substring(0, delimiterIndex); | ||
| var version = functionNameAndVersion.Substring(delimiterIndex + 1); | ||
| return (functionName, version); | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| // Copyright (c) .NET Foundation. All rights reserved. | ||
| // Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
|
||
| using Xunit; | ||
|
|
||
| namespace Microsoft.Azure.WebJobs.Extensions.DurableTask.Tests | ||
| { | ||
| public class FunctionNameWithVersionTests | ||
| { | ||
| [Theory] | ||
| [InlineData("MyOrchestrator", null)] // Without version | ||
| [InlineData("MyOrchestrator", "v2.5.1")] // With version | ||
| [InlineData("Function", "1.0.0")] // Semantic version with major.minor.patch | ||
| [InlineData("Function", "")] // Empty string version | ||
| [InlineData("Complex_Name-123", "v3.2.1-beta+build")] // Complex names and versions | ||
| [Trait("Category", PlatformSpecificHelpers.TestCategory)] | ||
| public void Combine_And_Parse_PreserveValues(string originalName, string originalVersion) | ||
| { | ||
| string combined = FunctionNameWithVersion.Combine(originalName, originalVersion); | ||
| (string parsedName, string parsedVersion) = FunctionNameWithVersion.Parse(combined); | ||
|
|
||
| Assert.Equal(originalName, parsedName); | ||
| if (originalVersion == null) | ||
| { | ||
| Assert.Null(parsedVersion); | ||
| } | ||
| else | ||
| { | ||
| Assert.Equal(originalVersion, parsedVersion); | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.