-
Notifications
You must be signed in to change notification settings - Fork 462
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
Upgrade tooling for 9.0x #5483
Upgrade tooling for 9.0x #5483
Conversation
@@ -103,7 +103,7 @@ static async Task<List<string[]>> GetAndValidateCellTexts(ILocator tableLoc) | |||
r => Assert.True(DateTime.TryParse(r, out _)), | |||
r => Assert.True(int.TryParse(r, out var actualTempC) && actualTempC >= -20 && actualTempC <= 55), | |||
r => Assert.True(int.TryParse(r, out var actualTempF) && actualTempF >= -5 && actualTempF <= 133), | |||
r => Assert.Contains(r, ["Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"])); | |||
r => Assert.Contains(r, new HashSet<string>(){"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"})); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, I would have expected this to work with the new collection literals.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC it was not being able to resolve the overload between HashSet<>
and SortedSet<>
.
@@ -9,7 +9,7 @@ | |||
<add key="built-local" value="%BUILT_NUGETS_PATH%" /> | |||
<add key="dotnet-public" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json" /> | |||
<add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" /> | |||
<add key="dotnet8" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json" /> | |||
<add key="dotnet9" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we don't need dotnet8 feed anymore? I think we still push our packages there so we have to update our default channels in darc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But we shouldn't be fetching any of our packages from these feeds (except BUILT_NUGETS_PATH
) for tests. Or am I missing something?
@@ -19,6 +19,9 @@ | |||
|
|||
<ItemGroup> | |||
<PackageReference Include="Microsoft.NET.Runtime.WorkloadTesting.Internal" /> | |||
|
|||
<AdditionalSharedFrameworkToInstallArguments Include="-Runtime dotnet -Version 8.0.8 -Channel 8.0" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to reuse the dotnet installed by the original build.cmd/sh call so we don't have to add this? I want to avoid needing to update a number in several places (runtime framework in this case 8.0.8) as those change each month.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is specifically for workload testing. It will be much cleaner to use the existing support for this. But we could try to use the restored .dotnet
also, but also need to account for .dotnet
not being installed when the system dotnet
is sufficient.
tests/helix/send-to-helix-inner.proj
Outdated
@@ -8,13 +8,15 @@ | |||
|
|||
<IncludeDotNetCli>true</IncludeDotNetCli> | |||
<DotNetCliPackageType>sdk</DotNetCliPackageType> | |||
<DotNetCliVersion>8.0.401</DotNetCliVersion> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How will this work for template tests for 9.0 templates? won't they require a 9.0 SDK?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still going through a first pass to get tests passing :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will require us to bundle the sdk ourselves, because arcade doesn't seem to support additional runtimes.
To confirm that this works I think this PR should include a couple of tests where the test project targets net9.0 (best in workload tests).
Directory.Build.props
Outdated
@@ -3,6 +3,7 @@ | |||
<Import Project="$(RepositoryEngineeringDir)/apicompat/PublicApiAnalyzer.props" /> | |||
|
|||
<PropertyGroup> | |||
<NetCurrent>net8.0</NetCurrent> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this property used anywhere else in arcade or is it solely used by consuming repos? my concern is that changing this in order to avoid having to modify individual projects might unintentionally affect how the infrastructure work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I can drop this in the cleanup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like efcore calls this DefaultNetCoreTargetFramework
.
src/Tools/ConfigurationSchemaGenerator/ConfigurationSchemaGenerator.csproj
Outdated
Show resolved
Hide resolved
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Updating 'Microsoft.SourceBuild.Intermediate.source-build-reference-packages': '8.0.0-alpha.1.23516.4' => '9.0.0-alpha.1.24453.2' (from build '20240903.2' of 'https://github.com/dotnet/source-build-reference-packages') Updating 'Microsoft.SourceBuild.Intermediate.arcade': '8.0.0-beta.24426.2' => '9.0.0-beta.24453.1' (from build '20240903.1' of 'https://github.com/dotnet/arcade') Updating 'Microsoft.DotNet.Arcade.Sdk': '8.0.0-beta.24426.2' => '9.0.0-beta.24453.1' (from build '20240903.1' of 'https://github.com/dotnet/arcade') Updating 'Microsoft.DotNet.Build.Tasks.Installers': '8.0.0-beta.24426.2' => '9.0.0-beta.24453.1' (from build '20240903.1' of 'https://github.com/dotnet/arcade') Updating 'Microsoft.DotNet.Build.Tasks.Workloads': '8.0.0-beta.24426.2' => '9.0.0-beta.24453.1' (from build '20240903.1' of 'https://github.com/dotnet/arcade') Updating 'Microsoft.DotNet.Helix.Sdk': '8.0.0-beta.24426.2' => '9.0.0-beta.24453.1' (from build '20240903.1' of 'https://github.com/dotnet/arcade') Updating 'Microsoft.DotNet.RemoteExecutor': '8.0.0-beta.24426.2' => '9.0.0-beta.24453.1' (from build '20240903.1' of 'https://github.com/dotnet/arcade') Updating 'Microsoft.DotNet.SharedFramework.Sdk': '8.0.0-beta.24426.2' => '9.0.0-beta.24453.1' (from build '20240903.1' of 'https://github.com/dotnet/arcade') Updating 'Microsoft.DotNet.XUnitExtensions': '8.0.0-beta.24426.2' => '9.0.0-beta.24453.1' (from build '20240903.1' of 'https://github.com/dotnet/arcade')
`Do not use Assert.Equal() to check for collection size. Use Assert.Single instead.xUnit2013`
`Do not use Assert.Empty() to check if a value does not exist in a collection. Use Assert.DoesNotContain() instead.xUnit2029`
`error xUnit1030: Test methods should not call ConfigureAwait(false), as it may bypass parallelization limits. Omit ConfigureAwait, or use ConfigureAwait(true) to avoid CA2007. (https://xunit.net/xunit.analyzers/rules/xUnit1030)`
Warning of the form: `error xUnit1012: Null should not be used for type parameter 'secondaryApiKey' of type 'string'. Use a non-null value, or convert the parameter to a nullable type. (https://xunit.net/xunit.analyzers/rules/xUnit1012)`
`error CS0121: The call is ambiguous between the following methods or properties: 'Assert.Contains<T>(T, HashSet<T>)' and 'Assert.Contains<T>(T, SortedSet<T>)'`
TODO before merge:
|
<!-- Intermediate is necessary for source build. --> | ||
<Dependency Name="Microsoft.SourceBuild.Intermediate.xliff-tasks" Version="1.0.0-beta.23475.1" CoherentParentDependency="Microsoft.DotNet.Arcade.Sdk"> | ||
<Uri>https://github.com/dotnet/xliff-tasks</Uri> | ||
<Sha>73f0850939d96131c28cf6ea6ee5aacb4da0083a</Sha> | ||
<SourceBuild RepoName="xliff-tasks" ManagedOnly="true" /> | ||
</Dependency> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the first commit - does dropping this seem correct? The assembly has moved to dotnet/arcade
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that is fine, and I think you can also drop the dependency over from lines 152-155 above for that matter (not sure why we had both), but shouldn't we have now a new dependency coming from arcade for it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll need to add a dependency like dotnet/runtime
has:
<Dependency Name="Microsoft.DotNet.XliffTasks" Version="9.0.0-beta.24423.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>91599268652b51969b8d8088d4f2f2ba7b3ebb19</Sha>
</Dependency>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added that here.
Read commit by commit to review this. The first commit is the biggest and is the update of the dependencies, mostly from arcade. |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
# Conflicts: # tests/Aspire.Elastic.Clients.Elasticsearch.Tests/Aspire.Elastic.Clients.Elasticsearch.Tests.csproj
…(38,45): error CA2007: Consider calling ConfigureAwait on the awaited task
@@ -12,6 +12,12 @@ | |||
This should get updated each time packages are shipped. | |||
--> | |||
<BaselineVersionForPackageValidation>8.0.1</BaselineVersionForPackageValidation> | |||
<DefaultTargetFramework>net8.0</DefaultTargetFramework> | |||
<!-- dotnet 8.0 versions for running tests --> | |||
<DotNetRuntimeVersionForTesting>8.0.8</DotNetRuntimeVersionForTesting> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering how we can keep this one up-to-date. One option would be if we use the Microsoft.NetCore.App.Ref
package and dependency flow for the version as we know that one will push the update to us. Anyway, no need to fix it now but we should consider how to update this (and the sdk below)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dotnet/runtime
is using Microsoft.DotNet.ApiCompat.Task
for that. Either should work well.
@@ -103,7 +103,7 @@ static async Task<List<string[]>> GetAndValidateCellTexts(ILocator tableLoc) | |||
r => Assert.True(DateTime.TryParse(r, out _)), | |||
r => Assert.True(int.TryParse(r, out var actualTempC) && actualTempC >= -20 && actualTempC <= 55), | |||
r => Assert.True(int.TryParse(r, out var actualTempF) && actualTempF >= -5 && actualTempF <= 133), | |||
r => Assert.Contains(r, ["Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"])); | |||
r => Assert.Contains(r, new HashSet<string>{"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"})); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still curious why this didn't work with the collection initializer, but oh well, no need to change it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
error CS0121: The call is ambiguous between the following methods or properties: 'Assert.Contains<T>(T, HashSet<T>)' and 'Assert.Contains<T>(T, SortedSet<T>)'
@@ -13,8 +13,7 @@ | |||
<!-- Disable playwright tests on helix/linux. Issue: https://github.com/dotnet/aspire/issues/4623 --> | |||
<DisablePlaywrightTests Condition="'$(OS)' != 'Windows_NT'">true</DisablePlaywrightTests> | |||
|
|||
<GlobalJsonContent>$([System.IO.File]::ReadAllText('$(RepoRoot)global.json'))</GlobalJsonContent> | |||
<DotNetCliVersion>$([System.Text.RegularExpressions.Regex]::Match($(GlobalJsonContent), '(%3F<="dotnet": ").*(%3F=")'))</DotNetCliVersion> | |||
<DotNetCliVersion>$(DotNetSdkVersionForTesting)</DotNetCliVersion> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll want to make sure now that we update that property so that it at least equals the one in global.json. I wonder if we can add a target somewhere in our build that detects if we've fallen behind and if so to fail the build...
No need to add that in this change though, don't block this PR for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once we get the version from a dotnet/sdk
dependency, it should always(?) be newer than global.json
.
@@ -1,16 +1,30 @@ | |||
{ | |||
"sdk": { | |||
"version": "8.0.303", | |||
"version": "9.0.100-preview.7.24407.12", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine for now. We'll want to bump to rc1 that got shipped today soon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look great @radical thanks for working on this! Let's prioritize getting this merged given the breath as otherwise it is likely to get conflicts with other PRs.
Issue to track follow up work - #5676 |
Internal build for validation - https://dev.azure.com/dnceng/internal/_build/results?buildId=2535499 |
.. in workload testing as it is required for the internal build. `Aspire.Hosting.Sdk.Msi.arm64.9.0.0-preview.4.24460.2.nupkg, Aspire.Hosting.Sdk.Msi.x64.9.0.0-preview.4.24460.2.nupkg, Aspire.Hosting.Sdk.Msi.x86.9.0.0-preview.4.24460.2.nupkg, Aspire.ProjectTemplates.Msi.arm64.9.0.0-preview.4.24460.2.nupkg, Aspire.ProjectTemplates.Msi.x64.9.0.0-preview.4.24460.2.nupkg, Aspire.ProjectTemplates.Msi.x86.9.0.0-preview.4.24460.2.nupkg`
…ests .. like the various hosting integration tests. The run time can vary especially if docker needs to fetch an image.
.NET 9 Eng
channeldotnet9
nuget feed instead ofnuget8
All the projects still target
net8.0
.Future TODO:
Fixes #5446 .
TODO before merge:
main
runMicrosoft Reviewers: Open in CodeFlow