Skip to content

Commit 333b57f

Browse files
Francisco-Gaminojviauandystaples
authored
Exclude pwsh7.0 and 7.2 from 4.8xx host (#10888) (#10898)
* Exclude pwsh7.0 and 7.2 from 4.8xx host * Rev PS worker to 4.0.4175 * Update tests for pwsh7.4 default --------- Co-authored-by: Jacob Viau <[email protected]> Co-authored-by: Andy Staples <[email protected]>
1 parent d63ac50 commit 333b57f

File tree

5 files changed

+26
-20
lines changed

5 files changed

+26
-20
lines changed

eng/build/Workers.Powershell.props

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
<Project>
22

3-
<ItemGroup>
3+
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'" >
4+
<!-- End of life workers. Only include them for 4.6xx host. -->
45
<PackageReference Include="Microsoft.Azure.Functions.PowerShellWorker.PS7.0" Version="4.0.3148" />
56
<PackageReference Include="Microsoft.Azure.Functions.PowerShellWorker.PS7.2" Version="4.0.4025" />
6-
<PackageReference Include="Microsoft.Azure.Functions.PowerShellWorker.PS7.4" Version="4.0.4134" />
7+
</ItemGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="Microsoft.Azure.Functions.PowerShellWorker.PS7.4" Version="4.0.4175" />
711
</ItemGroup>
812

913
<Target Name="RemovePowershellWorkerRuntimes" BeforeTargets="AssignTargetPaths" Condition="$(RuntimeIdentifier.StartsWith(win))">

release_notes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
- My change description (#PR)
55
-->
66
- Update Java Worker Version to [2.18.0](https://github.com/Azure/azure-functions-java-worker/releases/tag/2.18.0)
7-
87
- Updated Microsoft.Extensions.DependencyModel to 6.0.2 and 8.0.2 for .NET 6 and .NET 8, respectively. (#10661)
98
- Update the `DefaultHttpProxyService` to better handle client disconnect scenarios (#10688)
109
- Replaced `InvalidOperationException` with `HttpForwardingException` when there is a ForwarderError
1110
- [In-proc] Codeql : Fix to remove exception details from the response (#10751)
1211
- Update PowerShell 7.4 worker to [4.0.4134](https://github.com/Azure/azure-functions-powershell-worker/releases/tag/v4.0.4134)
1312
- Update Python Worker Version to [4.35.0](https://github.com/Azure/azure-functions-python-worker/releases/tag/4.35.0)
14-
- Update domain for CDN URI
13+
- Update domain for CDN URI
14+
- Update PowerShell worker to 4.0.4175 (sets defaultRuntimeVersion to 7.4 in worker.config.json)

test/WebJobs.Script.Tests.Integration/WebHostEndToEnd/SpecializationE2ETests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ public async Task StartAsync_SetsCorrectActiveHost_RefreshesLanguageWorkerOption
533533
// We want it to start first, but finish last, so unstick it in a couple seconds.
534534
Task ignore = Task.Delay(3000).ContinueWith(_ => _pauseAfterStandbyHostBuild.Release());
535535

536-
var expectedPowerShellVersion = "7.2";
536+
var expectedPowerShellVersion = "7.4";
537537
IWebHost host = builder.Build();
538538
var scriptHostService = host.Services.GetService<WebJobsScriptHostService>();
539539
var channelFactory = host.Services.GetService<IRpcWorkerChannelFactory>();

test/WebJobs.Script.Tests/ScriptHostTests.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,8 +453,11 @@ public async Task Initialize_WithLatestSiteExtensionVersion_LogsWarning()
453453
[InlineData("node", "~3", "~8", "node-~8")]
454454
[InlineData("node", "~2", "~8", "node-~8")]
455455
[InlineData("powershell", "~2", "", "powershell")]
456-
[InlineData("powershell", "~2", "~7", "powershell-~7")]
456+
[InlineData("powershell", "~2", "7.4", "powershell-7.4")]
457457
[InlineData("java", "~3", "", "java")]
458+
#if NET6_0
459+
[InlineData("powershell", "~2", "~7", "powershell-~7")] // pwsh 7.0 only available for net6 host.
460+
#endif
458461
public async Task Initialize_WithRuntimeAndWorkerVersion_ReportRuntimeToMetricsTable(
459462
string functionsWorkerRuntime,
460463
string functionsExtensionVersion,

test/WebJobs.Script.Tests/Workers/Rpc/RpcWorkerConfigFactoryTests.cs

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -154,25 +154,24 @@ public void DefaultWorkerConfigs_Overrides_DefaultWorkerRuntimeVersion_AppSettin
154154
var scriptSettingsManager = new ScriptSettingsManager(config);
155155
var testLogger = new TestLogger("test");
156156
_testEnvironment.SetEnvironmentVariable(EnvironmentSettingNames.AzureWebsitePlaceholderMode, "1");
157-
using (var variables = new TestScopedSettings(scriptSettingsManager, testEnvVariables))
158-
{
159-
var configFactory = new RpcWorkerConfigFactory(config, testLogger, _testSysRuntimeInfo, _testEnvironment, new TestMetricsLogger(), _testWorkerProfileManager);
160-
var workerConfigs = configFactory.GetConfigs();
161-
var pythonWorkerConfig = workerConfigs.FirstOrDefault(w => w.Description.Language.Equals("python", StringComparison.OrdinalIgnoreCase));
162-
var powershellWorkerConfig = workerConfigs.FirstOrDefault(w => w.Description.Language.Equals("powershell", StringComparison.OrdinalIgnoreCase));
163-
Assert.Equal(5, workerConfigs.Count);
164-
Assert.NotNull(pythonWorkerConfig);
165-
Assert.NotNull(powershellWorkerConfig);
166-
Assert.Equal("3.8", pythonWorkerConfig.Description.DefaultRuntimeVersion);
167-
Assert.Equal("7.2", powershellWorkerConfig.Description.DefaultRuntimeVersion);
168-
}
157+
158+
using var variables = new TestScopedSettings(scriptSettingsManager, testEnvVariables);
159+
var configFactory = new RpcWorkerConfigFactory(config, testLogger, _testSysRuntimeInfo, _testEnvironment, new TestMetricsLogger(), _testWorkerProfileManager);
160+
var workerConfigs = configFactory.GetConfigs();
161+
var pythonWorkerConfig = workerConfigs.FirstOrDefault(w => w.Description.Language.Equals("python", StringComparison.OrdinalIgnoreCase));
162+
var powershellWorkerConfig = workerConfigs.FirstOrDefault(w => w.Description.Language.Equals("powershell", StringComparison.OrdinalIgnoreCase));
163+
Assert.Equal(5, workerConfigs.Count);
164+
Assert.NotNull(pythonWorkerConfig);
165+
Assert.NotNull(powershellWorkerConfig);
166+
Assert.Equal("3.8", pythonWorkerConfig.Description.DefaultRuntimeVersion);
167+
Assert.Equal("7.4", powershellWorkerConfig.Description.DefaultRuntimeVersion);
169168
}
170169

171170
[Fact]
172171
public void DefaultWorkerConfigs_Overrides_VersionAppSetting()
173172
{
174173
var testEnvironment = new TestEnvironment();
175-
testEnvironment.SetEnvironmentVariable("FUNCTIONS_WORKER_RUNTIME_VERSION", "7.2");
174+
testEnvironment.SetEnvironmentVariable("FUNCTIONS_WORKER_RUNTIME_VERSION", "7.4");
176175
testEnvironment.SetEnvironmentVariable("FUNCTIONS_WORKER_RUNTIME", "powerShell");
177176
var configBuilder = ScriptSettingsManager.CreateDefaultConfigurationBuilder();
178177
var config = configBuilder.Build();
@@ -183,7 +182,7 @@ public void DefaultWorkerConfigs_Overrides_VersionAppSetting()
183182
var powershellWorkerConfig = workerConfigs.FirstOrDefault(w => w.Description.Language.Equals("powershell", StringComparison.OrdinalIgnoreCase));
184183
Assert.Equal(1, workerConfigs.Count);
185184
Assert.NotNull(powershellWorkerConfig);
186-
Assert.Equal("7.2", powershellWorkerConfig.Description.DefaultRuntimeVersion);
185+
Assert.Equal("7.4", powershellWorkerConfig.Description.DefaultRuntimeVersion);
187186
}
188187

189188
[Theory]

0 commit comments

Comments
 (0)