Ocelot icon indicating copy to clipboard operation
Ocelot copied to clipboard

.NET 9 update will break one of the tests because of a new `TrimStart` overload

Open AndyAyersMS opened this issue 1 year ago • 4 comments

Expected Behavior / New Feature

Updating to .NET 9 is easy.

Actual Behavior / Motivation for New Feature

Updating to .NET 9 will cause the GetServiceVersion_HasTags_HappyPath to fail, because a new TrimStart overload was added that takes priority over https://github.com/ThreeMammals/Ocelot/blob/19a8e2f8b3e773fbe962a56fc2e7067b6b19132b/src/Ocelot/Infrastructure/Extensions/StringExtensions.cs#L5

See https://github.com/dotnet/runtime/issues/103892

Steps to Reproduce the Problem

Update to .NET 9. Run tests.

Specifications

  • Version:
  • Platform:
  • Subsystem:

AndyAyersMS avatar Aug 30 '24 21:08 AndyAyersMS

Hello Andy, Thank you for bringing this humorous issue to our attention! Rest assured, we will address it and rename the extension method accordingly while migrating Ocelot to .NET 9 in November'24.

raman-m avatar Aug 31 '24 15:08 raman-m

@raman-m Whaaaat? 😸

ggnaegi avatar Sep 09 '24 09:09 ggnaegi

@raman-m I think it's premature to plan a migration to net 9, it's still in preview, I think it would be wise to wait for a 9.0.1 or 9.0.2 in January or February.

RaynaldM avatar Sep 23 '24 09:09 RaynaldM

@RaynaldM

I think it would be wise to wait for a 9.0.1 or 9.0.2 in January or February.

Are you referring to 9.1.0 or 9.2.0? 😄 By January/February '25, we'll certainly be on versions 9.1.0+. 🤣 All jokes aside, I believe we should migrate to .NET 9 immediately following the major release, which will also enable Ocelot users to transition. This upgrade is important because it will allow us to:

  • eliminate targets for net6.0 and net7.0
  • introduce a new net9.0 target alongside net8.0

I plan to start the migration within a week (Nov 15-20) following the .NET 9.0 release on November 12, 2024.

raman-m avatar Sep 24 '24 11:09 raman-m

.NET Runtime

In the .NET codebase, we have the following extensions: Search for TrimStart. It is advisable to move away from this name, thus renaming the method in Ocelot is necessary.

raman-m avatar Nov 27 '24 09:11 raman-m