Skip to content

Commit e37b3cb

Browse files
Hotfix in-proc 4.41.300 (#11317)
* Update version to 4.41.300 * Clear release notes * Don't apply bundle version limits if host is in placeholder mode (#11316) --------- Co-authored-by: azure-functions-release[bot] <223311270+azure-functions-release[bot]@users.noreply.github.com>
1 parent cf854ad commit e37b3cb

File tree

4 files changed

+47
-4
lines changed

4 files changed

+47
-4
lines changed

release_notes.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@
33
<!-- Please add your release notes in the following format:
44
- My change description (#PR)
55
-->
6-
- Cap v4.x extension bundle versions on .NET 6 to the range (>4.2.0, <4.22.0) by default (#11289)
7-
6+
- Don't apply bundle version limits if host is in placeholder mode (#11316)

src/Directory.Version.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<VersionPrefix>4.$(MinorVersionPrefix)41.200</VersionPrefix>
3+
<VersionPrefix>4.$(MinorVersionPrefix)41.300</VersionPrefix>
44
<UpdateBuildNumber>true</UpdateBuildNumber>
55
</PropertyGroup>
66
</Project>

src/WebJobs.Script/ExtensionBundle/ExtensionBundleManager.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,11 @@ internal string FindBestVersionMatch(VersionRange versionRange, IEnumerable<stri
281281
}
282282

283283
// Applies bundle version limits for .NET 6, using the default bundle if referencing a v4 major bundle version.
284+
// Does not apply version limit in placeholder mode. This will prevent bundle download in placeholder mode as long as a matching bundle is available.
284285
private VersionRange GetAdjustedVersion(int dotnetVersion, VersionRange versionRange, string bundleId)
285286
{
286-
if (dotnetVersion != 6
287+
if (_environment.IsPlaceholderModeEnabled()
288+
|| dotnetVersion != 6
287289
|| !string.Equals(bundleId, ScriptConstants.DefaultExtensionBundleId, StringComparison.OrdinalIgnoreCase)
288290
|| versionRange.MinVersion.Major != ScriptConstants.ExtensionBundleV4MajorVersion)
289291
{

test/WebJobs.Script.Tests/ExtensionBundle/ExtensionBundleManagerTests.cs

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,48 @@ public void FindBestVersionMatch_V4Range_NoCaps_MixedSet_PicksHighest()
684684
#endif
685685

686686
#if NET6_0
687+
688+
[Fact]
689+
public void FindBestVersionMatch_V4Range_PlaceholderMode_AllowsPreviouslyCappedMin()
690+
{
691+
// Without placeholder mode, only version "4.2.0" would be excluded by the adjusted open interval (4.2.0, 4.22.0),
692+
// resulting in a null match (covered by existing test FindBestVersionMatch_V4Range_AllFiltered_ReturnsNull).
693+
// With placeholder mode enabled, adjustment is skipped and "4.2.0" is valid and should be selected.
694+
var range = VersionRange.Parse("[4.0.0, 5.0.0)");
695+
var versions = new List<string> { "4.2.0" };
696+
697+
var options = GetTestExtensionBundleOptions(BundleId, "[4.*,5.0.0)");
698+
var env = GetTestAppServiceEnvironment();
699+
env.SetEnvironmentVariable(AzureWebsitePlaceholderMode, "1"); // enable placeholder mode
700+
701+
var manager = GetExtensionBundleManager(options, env);
702+
703+
var resolved = manager.FindBestVersionMatch(range, versions, ScriptConstants.DefaultExtensionBundleId, new FunctionsHostingConfigOptions());
704+
705+
Assert.Equal("4.2.0", resolved);
706+
}
707+
708+
[Fact]
709+
public void FindBestVersionMatch_V4Range_PlaceholderMode_AllowsPreviouslyCappedOuterVersions()
710+
{
711+
// Version adjustment on .NET 6 would cap effective range to (4.2.0, 4.22.0) (exclusive on both ends),
712+
// excluding 4.2.0, 4.22.0, and anything above (e.g., 4.23.0). Normal (non-placeholder) selection (with provided list)
713+
// would therefore choose 4.21.9 (if present) or next highest inside interval.
714+
// With placeholder mode enabled, no adjustment occurs and the highest (4.23.0) should be selected.
715+
var range = VersionRange.Parse("[4.0.0, 5.0.0)");
716+
var versions = new List<string> { "4.2.0", "4.3.0", "4.21.9", "4.22.0", "4.23.0" };
717+
718+
var options = GetTestExtensionBundleOptions(BundleId, "[4.*,5.0.0)");
719+
var env = GetTestAppServiceEnvironment();
720+
env.SetEnvironmentVariable(AzureWebsitePlaceholderMode, "1"); // enable placeholder mode
721+
722+
var manager = GetExtensionBundleManager(options, env);
723+
724+
var resolved = manager.FindBestVersionMatch(range, versions, ScriptConstants.DefaultExtensionBundleId, new FunctionsHostingConfigOptions());
725+
726+
Assert.Equal("4.23.0", resolved);
727+
}
728+
687729
[Fact]
688730
public void FindBestVersionMatch_V4Range_MinCapApplied_ExcludesCappedMin()
689731
{

0 commit comments

Comments
 (0)