aspire icon indicating copy to clipboard operation
aspire copied to clipboard

Add net9.0 support for EFCore components

Open sebastienros opened this issue 1 year ago • 6 comments

Fixes #5207

Microsoft Reviewers: Open in CodeFlow

sebastienros avatar Sep 25 '24 23:09 sebastienros

Not blocking, but for futureproofing also change EnrichNpgsqlDbContext, EnrichMySqlDbContext, EnrichOracleDatabaseDbContext and EnrichCosmosDbContext to use ConfigureDbContext

We want to use these new APIs as part of these EF upgrade so that we can actually use the new methods and make sure they work in the scenarios they were designed for.

davidfowl avatar Sep 26 '24 15:09 davidfowl

@radical Please check the build changes. I updated the ZipTestArchive target to handle the multi-target build step which doesn't have OutDir. And also solved a concurrency issue when the two tfms are built in parallel and would write the same file. The non-default TFM is added as a prefix on the zip filename.

sebastienros avatar Sep 30 '24 18:09 sebastienros

This needs the workload testing bits to be re-enabled, which would give us a 9.0 sdk with 8.0 runtime to allow running the net9.0 tests here on helix.

radical avatar Oct 01 '24 08:10 radical

The net9.0 tests here will need a 9 sdk to run on helix. We could normally get that from the workload-tests setup, but since that is disabled in the repo right now, and waiting for on https://github.com/dotnet/aspire/pull/5932 - we can't test it right now.

I hope to have the templates PR merged this week. If this needs to merged sooner, then an alternative would be to get the test infra (just msbuild should be enough) changes here.

radical avatar Oct 01 '24 22:10 radical

net9.0 tests are running succesfully:

  • Aspire.Microsoft.EntityFrameworkCore.Cosmos.Tests-net9.0
  • Aspire.Microsoft.EntityFrameworkCore.SqlServer.Tests-net9.0
  • Aspire.Npgsql.EntityFrameworkCore.PostgreSQL.Tests-net9.0
  • Aspire.Oracle.EntityFrameworkCore.Tests-net9.0

radical avatar Oct 03 '24 19:10 radical

I have tested it works locally.

  • service with net9.0
  • both AddNpgsqlDbContext and EnrichNpgsqlDbContext
  • enabling/disabling metrics from code

sebastienros avatar Oct 03 '24 21:10 sebastienros

Two tests failed. One seems to be a random issue with te TestHost.App playground and the fact that RabbitMQ management was assigned the same port as CatalogDb web app.

The second is related to this change, but the tests timed out. Increasing it for now since none show up as a problem.

sebastienros avatar Oct 05 '24 16:10 sebastienros

One of the workload tests failed with:

  Failed to download package 'OpenTelemetry.Instrumentation.Http.1.9.0' from 'https://pkgs.dev.azure.com/dnceng/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/_packaging/45bacae2-5efb-47c8-91e5-8ec20c22b4f8/nuget/v3/flat2/opentelemetry.instrumentation.http/1.9.0/opentelemetry.instrumentation.http.1.9.0.nupkg'.
  The HTTP request to 'GET https://pkgs.dev.azure.com/dnceng/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/_packaging/45bacae2-5efb-47c8-91e5-8ec20c22b4f8/nuget/v3/flat2/opentelemetry.instrumentation.http/1.9.0/opentelemetry.instrumentation.http.1.9.0.nupkg' has timed out after 100000ms.

We can re-try.

radical avatar Oct 07 '24 22:10 radical

@radical workload test failure? This one was already failing in the previous run btw.

sebastienros avatar Oct 08 '24 00:10 sebastienros

backport this to rc1 please

davidfowl avatar Oct 08 '24 14:10 davidfowl

/backport to release/9.0-rc1

sebastienros avatar Oct 08 '24 15:10 sebastienros

Started backporting to release/9.0-rc1: https://github.com/dotnet/aspire/actions/runs/11238857605

github-actions[bot] avatar Oct 08 '24 15:10 github-actions[bot]

@sebastienros backporting to release/9.0-rc1 failed, the patch most likely resulted in conflicts:

$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch

Applying: Add net9.0 support for EFCore components
.git/rebase-apply/patch:45: trailing whitespace.
  
warning: 1 line adds whitespace errors.
Using index info to reconstruct a base tree...
M	eng/Versions.props
M	global.json
M	src/Components/Common/EntityFrameworkUtils.cs
Falling back to patching base and 3-way merge...
Auto-merging src/Components/Common/EntityFrameworkUtils.cs
Auto-merging global.json
Auto-merging eng/Versions.props
Applying: Update Npgsql
Using index info to reconstruct a base tree...
M	Directory.Packages.props
M	eng/Versions.props
Falling back to patching base and 3-way merge...
Auto-merging eng/Versions.props
CONFLICT (content): Merge conflict in eng/Versions.props
Auto-merging Directory.Packages.props
CONFLICT (content): Merge conflict in Directory.Packages.props
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0002 Update Npgsql
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

github-actions[bot] avatar Oct 08 '24 15:10 github-actions[bot]

@sebastienros an error occurred while backporting to release/9.0-rc1, please check the run log for details!

Error: git am failed, most likely due to a merge conflict.

github-actions[bot] avatar Oct 08 '24 15:10 github-actions[bot]