Skip to content
Closed
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
22 changes: 22 additions & 0 deletions src/WebJobs.Script/Workers/Rpc/RpcWorkerDescription.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ public class RpcWorkerDescription : WorkerDescription
[JsonProperty(PropertyName = "supportedRuntimeVersions")]
public List<string> SupportedRuntimeVersions { get; set; }

/// <summary>
/// Gets the minimum supported versions for this runtime.
/// </summary>
[JsonProperty(PropertyName = "minimumSupportedRuntimeVersion")]
public string MinimumSupportedRuntimeVersion { get; }

/// <summary>
/// Gets or sets the regex used for sanitizing the runtime version string.
/// </summary>
Expand Down Expand Up @@ -202,6 +208,22 @@ internal void FormatWorkerPathIfNeeded(ISystemRuntimeInformation systemRuntimeIn
DefaultRuntimeVersion = GetSanitizedRuntimeVersion(version);
}

if (!string.IsNullOrEmpty(MinimumSupportedRuntimeVersion) && !string.IsNullOrEmpty(DefaultRuntimeVersion))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I /think/ DefaultRuntimeVersion now holds the updated language version that's being used instead of version, but if that's incorrect please lmk!

{
if (Version.TryParse(DefaultRuntimeVersion, out var currentVersion) &&
Version.TryParse(MinimumSupportedRuntimeVersion, out var minVersion))
{
if (currentVersion < minVersion)
{
logger.LogWarning($"The configured runtime version '{DefaultRuntimeVersion}' for language '{Language}' is lower than the minimum supported version '{MinimumSupportedRuntimeVersion}'. Please update to a supported version. Visit aka.ms/supported-language-versions for more information.");
}
}
else
{
logger.LogWarning($"Could not parse runtime version(s): '{DefaultRuntimeVersion}' or '{MinimumSupportedRuntimeVersion}' for language '{Language}'.");
}
}

ValidateDefaultWorkerPathFormatters(systemRuntimeInformation);

DefaultWorkerPath = DefaultWorkerPath.Replace(RpcWorkerConstants.OSPlaceholder, os.ToString())
Expand Down