Skip to content

Commit cf854ad

Browse files
v-selvarajbhazure-functions-release[bot]jviausoninaren
authored
In-proc HF 4.41.200 (#11294)
* Update version to 4.41.200 * Clear release notes * Fix in-proc trigger for release branches (#11282) * Setting min and max cap for dotnet 6 inproc host (4.2.0, 4.22.0) (#11293) * Setting min and max cap for dotnet 6 inproc host (4.2.0, 4.22.0) (#11289) --------- Co-authored-by: azure-functions-release[bot] <223311270+azure-functions-release[bot]@users.noreply.github.com> Co-authored-by: Jacob Viau <[email protected]> Co-authored-by: Naren Soni <[email protected]>
1 parent 4da360a commit cf854ad

File tree

9 files changed

+366
-90
lines changed

9 files changed

+366
-90
lines changed

eng/ci/integration-tests.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ pr:
55
include:
66
- dev
77
- in-proc
8-
- release/4.*
9-
- release/in-proc
8+
- release/*
109

1110
resources:
1211
repositories:

eng/ci/public-build.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,14 @@ trigger:
66
include:
77
- dev
88
- in-proc
9-
- release/4.*
10-
- release/in-proc
9+
- release/*
1110

1211
pr:
1312
branches:
1413
include:
1514
- dev
1615
- in-proc
17-
- release/4.*
18-
- release/in-proc
16+
- release/*
1917

2018
resources:
2119
repositories:

release_notes.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,5 @@
33
<!-- Please add your release notes in the following format:
44
- My change description (#PR)
55
-->
6-
- Update Java Worker Version to [2.19.1](https://github.com/Azure/azure-functions-java-worker/releases/tag/2.19.1)
7-
- Support `LOGIC_APPS_POWERSHELL_VERSION` when resolving powershell's `worker.config.json` for logic-app apps only. (#11105)
8-
- Update Python Worker Version to [4.38.0](https://github.com/Azure/azure-functions-python-worker/releases/tag/4.38.0)
9-
- Add JitTrace files for v4.40 (#11118)
6+
- Cap v4.x extension bundle versions on .NET 6 to the range (>4.2.0, <4.22.0) by default (#11289)
7+

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.100</VersionPrefix>
3+
<VersionPrefix>4.$(MinorVersionPrefix)41.200</VersionPrefix>
44
<UpdateBuildNumber>true</UpdateBuildNumber>
55
</PropertyGroup>
66
</Project>

src/WebJobs.Script/Config/FunctionsHostingConfigOptions.cs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -163,28 +163,6 @@ internal bool IsTestDataSuppressionEnabled
163163
}
164164
}
165165

166-
/// <summary>
167-
/// Gets the highest version of extension bundle v3 supported.
168-
/// </summary>
169-
internal string MaximumBundleV3Version
170-
{
171-
get
172-
{
173-
return GetFeature(ScriptConstants.MaximumBundleV3Version);
174-
}
175-
}
176-
177-
/// <summary>
178-
/// Gets the highest version of extension bundle v4 supported.
179-
/// </summary>
180-
internal string MaximumBundleV4Version
181-
{
182-
get
183-
{
184-
return GetFeature(ScriptConstants.MaximumBundleV4Version);
185-
}
186-
}
187-
188166
/// <summary>
189167
/// Gets a value indicating whether the host should revert the worker shutdown behavior in the WebHostWorkerChannelManager.
190168
/// </summary>

src/WebJobs.Script/ExtensionBundle/ExtensionBundleManager.cs

Lines changed: 44 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -252,45 +252,67 @@ private async Task<string> GetLatestMatchingBundleVersionAsync(HttpClient httpCl
252252

253253
internal string FindBestVersionMatch(VersionRange versionRange, IEnumerable<string> versions, string bundleId, FunctionsHostingConfigOptions configOption)
254254
{
255+
int dotnetVersion = typeof(string).Assembly.GetName().Version.Major;
256+
257+
// Limit the version range for v4.x bundles on .NET 6 to be between 4.2.0 and 4.22.0
258+
// Return original version range if not .NET 6 or not v4.x bundle
259+
var effectiveVersionRange = GetAdjustedVersion(dotnetVersion, versionRange, bundleId);
260+
261+
// Check if there is a max version configured in hosting config for the current dotnet version and bundle major version
262+
if (TryGetMaxBundleVersionFromHostingConfig(bundleId, versionRange.MinVersion.Major, dotnetVersion, configOption, out NuGetVersion maxBundleVersion))
263+
{
264+
effectiveVersionRange = new VersionRange(effectiveVersionRange.MinVersion, effectiveVersionRange.IsMinInclusive, maxBundleVersion, true);
265+
}
266+
255267
var bundleVersions = versions.Select(p =>
256268
{
257269
var dirName = Path.GetFileName(p);
258270
NuGetVersion.TryParse(dirName, out NuGetVersion version);
259271
if (version != null)
260272
{
261-
version = versionRange.Satisfies(version) ? version : null;
273+
version = effectiveVersionRange.Satisfies(version) ? version : null;
262274
}
263275
return version;
264276
}).Where(v => v != null).OrderByDescending(version => version.Version).ToList();
265277

266278
var matchingVersion = ResolvePlatformReleaseChannelVersion(bundleVersions);
267279

268-
if (bundleId != ScriptConstants.DefaultExtensionBundleId)
269-
{
270-
return matchingVersion?.ToString();
271-
}
280+
return matchingVersion?.ToString();
281+
}
272282

273-
// Check to see if there is a max bundle version set via hosting configuration, if yes then use that instead of the one
274-
// available on VM or local machine. Only use MaximumBundleV3Version or MaximumBundleV4Version if the version configured
275-
// by the customer resolved to version higher than the version set via hosting config.
276-
if (!string.IsNullOrEmpty(configOption.MaximumBundleV3Version)
277-
&& matchingVersion?.Major == ScriptConstants.ExtensionBundleV3MajorVersion)
283+
// Applies bundle version limits for .NET 6, using the default bundle if referencing a v4 major bundle version.
284+
private VersionRange GetAdjustedVersion(int dotnetVersion, VersionRange versionRange, string bundleId)
285+
{
286+
if (dotnetVersion != 6
287+
|| !string.Equals(bundleId, ScriptConstants.DefaultExtensionBundleId, StringComparison.OrdinalIgnoreCase)
288+
|| versionRange.MinVersion.Major != ScriptConstants.ExtensionBundleV4MajorVersion)
278289
{
279-
var maximumBundleV3Version = NuGetVersion.Parse(configOption.MaximumBundleV3Version);
280-
matchingVersion = matchingVersion > maximumBundleV3Version ? maximumBundleV3Version : matchingVersion;
281-
return matchingVersion?.ToString();
290+
return versionRange;
282291
}
283292

284-
if (!string.IsNullOrEmpty(configOption.MaximumBundleV4Version)
285-
&& matchingVersion?.Major == ScriptConstants.ExtensionBundleV4MajorVersion)
286-
{
287-
var maximumBundleV4Version = NuGetVersion.Parse(configOption.MaximumBundleV4Version);
288-
matchingVersion = matchingVersion > maximumBundleV4Version
289-
? maximumBundleV4Version
290-
: matchingVersion;
291-
}
293+
var effectiveMinVersion = new NuGetVersion(ScriptConstants.Net6MinimumV4BundleVersion);
294+
var effectiveMaxVersion = new NuGetVersion(ScriptConstants.Net6MaximumV4BundleVersion);
292295

293-
return matchingVersion?.ToString();
296+
var minVersion = versionRange.MinVersion < effectiveMinVersion ? effectiveMinVersion : versionRange.MinVersion;
297+
var maxVersion = versionRange.MaxVersion > effectiveMaxVersion ? effectiveMaxVersion : versionRange.MaxVersion;
298+
299+
// Use the original inclusion values if it is within the min or max range.
300+
bool isMinInclusive = versionRange.MinVersion > effectiveMinVersion && versionRange.IsMinInclusive;
301+
bool isMaxInclusive = versionRange.MaxVersion < effectiveMaxVersion && versionRange.IsMaxInclusive;
302+
303+
versionRange = new VersionRange(minVersion, isMinInclusive, maxVersion, isMaxInclusive);
304+
return versionRange;
305+
}
306+
307+
private bool TryGetMaxBundleVersionFromHostingConfig(string bundleId, int bundleVersion, int dotnetVersion, FunctionsHostingConfigOptions configOption, out NuGetVersion maxVersion)
308+
{
309+
maxVersion = null;
310+
string hostingConfig = $"Net{dotnetVersion}MaximumBundleV{bundleVersion}Version";
311+
string hostingConfigValue = configOption.GetFeature(hostingConfig);
312+
313+
return string.Equals(bundleId, ScriptConstants.DefaultExtensionBundleId, StringComparison.OrdinalIgnoreCase)
314+
&& !string.IsNullOrEmpty(hostingConfigValue)
315+
&& NuGetVersion.TryParse(hostingConfigValue, out maxVersion);
294316
}
295317

296318
private NuGetVersion ResolvePlatformReleaseChannelVersion(IList<NuGetVersion> orderedByDescBundles) => _platformReleaseChannel.ToUpper() switch

src/WebJobs.Script/ScriptConstants.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,8 @@ public static class ScriptConstants
249249
public static readonly string LiveLogsSessionAIKey = "#AzFuncLiveLogsSessionId";
250250

251251
public static readonly string FunctionsHostingConfigSectionName = "FunctionsHostingConfig";
252-
public static readonly string MaximumBundleV3Version = "FunctionRuntimeV4MaxBundleV3Version";
253-
public static readonly string MaximumBundleV4Version = "FunctionRuntimeV4MaxBundleV4Version";
252+
public static readonly string Net6MinimumV4BundleVersion = "4.2.0";
253+
public static readonly string Net6MaximumV4BundleVersion = "4.22.0";
254254

255255
// HTTP Proxying constants
256256
public static readonly string HttpProxyingEnabled = "HttpProxyingEnabled";

test/WebJobs.Script.Tests/Configuration/FunctionsHostingConfigOptionsTest.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,6 @@ public void Property_Validation()
111111
(nameof(FunctionsHostingConfigOptions.EnableOrderedInvocationMessages), string.Empty, true), // default
112112

113113
(nameof(FunctionsHostingConfigOptions.FunctionsWorkerDynamicConcurrencyEnabled), "FUNCTIONS_WORKER_DYNAMIC_CONCURRENCY_ENABLED=1", true),
114-
(nameof(FunctionsHostingConfigOptions.MaximumBundleV3Version), "FunctionRuntimeV4MaxBundleV3Version=teststring", "teststring"),
115-
(nameof(FunctionsHostingConfigOptions.MaximumBundleV4Version), "FunctionRuntimeV4MaxBundleV4Version=teststring", "teststring"),
116114
(nameof(FunctionsHostingConfigOptions.RevertWorkerShutdownBehavior), "REVERT_WORKER_SHUTDOWN_BEHAVIOR=1", true),
117115

118116
// Supports True/False/1/0

0 commit comments

Comments
 (0)