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

Upgrade DataGateway Solution to .Net 6 #164

Merged
merged 20 commits into from
Apr 20, 2022
Merged

Upgrade DataGateway Solution to .Net 6 #164

merged 20 commits into from
Apr 20, 2022

Conversation

seantleonard
Copy link
Contributor

@seantleonard seantleonard commented Jan 25, 2022

Summary

Upgrades the .csproj files to build against .Net 6. Also updates the Build pipeline files to use Ubuntu-latest and windows-2022 as they have .NET 6 installed.

Example of System.Text.JsonSerializer operation. This may also address comments relevant to #60

Example: JsonSerializer.SerializeToDocument(value: "{}", inputType: typeof(string));
Docs: https://docs.microsoft.com/dotnet/api/system.text.json.jsonserializer.serializetodocument?view=net-6.0#system-text-json-jsonserializer-serializetodocument(system-object-system-type-system-text-json-jsonserializeroptions)

resolves #154

@seantleonard
Copy link
Contributor Author

seantleonard commented Jan 25, 2022

Will investigate pipeline failures.
Pending resolution of actions/runner-images#4424
--> Adding .NET 6 SDK by default to Ubuntu images in Azure Dev Ops, which currently is not the case. May be able to workaround with custom configured use .net core task https://docs.microsoft.com/azure/devops/pipelines/tasks/tool/dotnet-core-tool-installer?view=azure-devops

Copy link
Contributor

@jarupatj jarupatj left a comment

Choose a reason for hiding this comment

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

:shipit:

@aaronburtle
Copy link
Contributor

Looks like the failures in the pipeline are just formatting issues. Dotnet format should be able to fix this. This extension might fix it automatically for you on save.
https://marketplace.visualstudio.com/items?itemName=MadsKristensen.CodeCleanupOnSave

@seantleonard
Copy link
Contributor Author

seantleonard commented Feb 8, 2022

hey, @Mathos1432 , do you know if we can configure , within the Build-pipelines.yml file, the version of .Net the container is built with? In this example failed task

The Docker step is running: /usr/bin/docker pull mcr.microsoft.com/dotnet/aspnet:5.0. I didn't see an input variable we could use from here, so wondering if there may be different steps that you might know of.

@aaronpowell
Copy link
Contributor

@seantleonard isn't it using https://github.com/Azure/hawaii-gql/blob/main/Dockerfile as the Dockerfile for build? You could bump that to .NET 6, or parameterise it if desired.

@seantleonard
Copy link
Contributor Author

seantleonard commented Feb 26, 2022

Now pending resolution of dotnet/format#1519 and workaround for manually installing dotnet 6 on Mac runs.

dotnet/format#1433

@@ -23,6 +23,11 @@ variables:
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
steps:
- task: UseDotNet@2
Copy link
Contributor

Choose a reason for hiding this comment

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

Just confirming this is only needed when the imageName is macOS-latest, right as per description?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As-is, this will download and install .NET 6.x.x SDK for Cosmos tests on all platforms. The effect seems minimal (7-10seconds) on Linux/Mac, but Windows, the task is now ~45 seconds. Maybe as future optimization step, we could specifically not run this on windows, as it is preinstalled on Win2022 images.

Copy link
Contributor

@Aniruddh25 Aniruddh25 left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for unblocking this!
Could you please update the PR description with latest before merging?

@seantleonard seantleonard merged commit d802b41 into main Apr 20, 2022
@seantleonard seantleonard deleted the DotNet6Upgrade branch April 20, 2022 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade to .NET 6
7 participants