Skip to content
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

chore: Change global.json roll-forward policy from latestPatch to latestMinor #1230

Merged
merged 2 commits into from
Aug 13, 2024

Conversation

0xced
Copy link
Contributor

@0xced 0xced commented Aug 11, 2024

What does this PR do?

This pull request changes the roll forward policy from latestPatch to latestMinor.

Why is it important?

Contributors can work on Testcontainers with the latest dotnet SDK. Note that it's impossible to compile the projects with the latest SDK (version 8.0.303) and the latestPatch policy.

dotnet --version
The command could not be loaded, possibly because:
  * You intended to execute a .NET application:
      The application '--version' does not exist.
  * You intended to execute a .NET SDK command:
      A compatible .NET SDK was not found.

Requested SDK version: 8.0.200
global.json file: /Users/0xced/Projects/testcontainers-dotnet/global.json

Installed SDKs:
6.0.424 [/usr/local/share/dotnet/sdk]
8.0.303 [/usr/local/share/dotnet/sdk]

Install the [8.0.200] .NET SDK or update [~/testcontainers-dotnet/global.json] to match an installed SDK.

Learn about SDK resolution:
https://aka.ms/dotnet/sdk-not-found

Related issues

None

So that contributors can work on Testcontainers with the latest dotnet SDK.
Copy link

netlify bot commented Aug 11, 2024

Deploy Preview for testcontainers-dotnet ready!

Name Link
🔨 Latest commit 0caa61c
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-dotnet/deploys/66bb79f4f9cb72000823101c
😎 Deploy Preview https://deploy-preview-1230--testcontainers-dotnet.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Collaborator

@HofmeisterAn HofmeisterAn left a comment

Choose a reason for hiding this comment

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

Wouldn't this lead to incompatibilities if developers use the latest SDK with features that aren't available in previous major versions? Locally, you can use the DOTNET_ROLL_FORWARD environment variable or set user-specific project settings.

@0xced
Copy link
Contributor Author

0xced commented Aug 13, 2024

Wouldn't this lead to incompatibilities if developers use the latest SDK with features that aren't available in previous major versions?

Well, those are SDK features so that should not have any impact on the Testcontainers projects themselves.

But using latestPatch forces to use .NET SDK 8.0.2xx. If I have the latest SDK installed (8.0.303) then I won't be able to work on Testcontainers. Building on the command line will give me the error mentioned in the original post. (Using dotnet --version as an example was maybe unfortunate, but using dotnet build produces the same error). Building in a IDE won't work either and will yield many errors.

Screenshot of Rider with many errors because of incompatible SDK versions

When working on #1231 I had to modify global.json locally to be able to compile the projects and run tests.

Locally, you can use the DOTNET_ROLL_FORWARD environment variable or set user-specific project settings.

The DOTNET_ROLL_FORWARD environment variable is for the dotnet runtime and is unrelated to the SDK. Andrew Lock gives a good explanation in his blog post Exploring the new rollForward and allowPrerelease settings in global.json. Although it was written in the .NET Core 2/3 era, the information is still applicable today with the recent SDKs.

Maintaining the global.json file is tricky, it's not the first time I submit pull request to fix it. 😉

I even fixed the official documentation that was wrong! dotnet/docs#35775

Copy link
Collaborator

@HofmeisterAn HofmeisterAn left a comment

Choose a reason for hiding this comment

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

Yes, I am aware of the limitations and issues.

The DOTNET_ROLL_FORWARD environment variable is for the dotnet runtime and is unrelated to the SDK.

Ah, I mixed that up — I remember using DOTNET_ROLL_FORWARD some time ago when I encountered similar issues, but I believe that was when I was running the Sonar CLI tool, IIRC. If we can make it easier for developers to build the projects, it is definitely something we should do. Thanks.

@HofmeisterAn HofmeisterAn added the chore A change that doesn't impact the existing functionality, e.g. internal refactorings or cleanups label Aug 13, 2024
@HofmeisterAn HofmeisterAn changed the title Change global.json roll-forward policy from latestPatch to latestMinor chore: Change global.json roll-forward policy from latestPatch to latestMinor Aug 13, 2024
@HofmeisterAn HofmeisterAn merged commit dd05999 into testcontainers:develop Aug 13, 2024
11 checks passed
@0xced 0xced deleted the rollForward-latestMinor branch August 13, 2024 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore A change that doesn't impact the existing functionality, e.g. internal refactorings or cleanups
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants