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

[ODS-6169] Update Code Generation to .NET 8 #920

Merged
merged 30 commits into from
Jan 29, 2024
Merged

[ODS-6169] Update Code Generation to .NET 8 #920

merged 30 commits into from
Jan 29, 2024

Conversation

stephenfuqua
Copy link
Contributor

@stephenfuqua stephenfuqua commented Jan 23, 2024

All approval tests are passing on my machine:

image

@stephenfuqua stephenfuqua marked this pull request as ready for review January 25, 2024 16:33

runs-on: windows-latest

runs-on: ubuntu-latest
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't see anything in this script that would require Windows instead of Ubuntu. Note: In the Admin API project, we publish NuGet packages to Azure Artifacts using Ubuntu.

paths:
- Application/EdFi.Admin.DataAccess/**/*
- Application/EdFi.Admin.DataAccess.UnitTests/**/*
- Application/EdFi.Common/**/*
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@JBrenesSimpat I didn't think of this when reviewing your ticket: we only need to run this action when files in one of these three directories have changed. Please take the same approach with the Security. DataAccess.

@semalaiappan you might want to think about doing the same thing in the main branch. In limiting the action this way, a pull request only runs the jobs that are truly required - and that means we'll get feedback on the pull request more quickly.

Copy link
Contributor

Choose a reason for hiding this comment

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

a small adjustment here, the path for the unit test should be - test/EdFi.Admin.DataAccess.UnitTests/**/*

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The 6.1-patch2 tag has a bug that prevents Code Generation from compiling. This workflow would have stopped that from happening.

I created a ticket to do the same in the main branch.

- name: Run Integration Tests
working-directory: ./Ed-Fi-ODS/Utilities/CodeGeneration
run: |
dotnet test --filter FullyQualifiedName~IntegrationTests --logger "trx;LogFileName=integration-tests.trx" --logger "console;verbosity=detailed"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note that I'm logging both to file and to the console. The console logging helps in debugging if there are any failures - you don't have to download the trx file.

SerializationInfo info,
StreamingContext context) : base(info, context)
{
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is an obsolete approach in .NET 8.

@@ -16,6 +16,69 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace EdFi.Ods.Api.Services.Controllers.AcademicWeeks.EdFi.Academic_Week_Readable_Excludes_Optional_References
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This new code is based on profile information added in v6.1-patch1, and it should have been added to the repo in that patch release.

@@ -14,25 +14,14 @@

namespace EdFi.Ods.CodeGen
{
public class ApplicationRunner : IApplicationRunner
public class ApplicationRunner(ITemplateProcessor templateProcessor, IEnumerable<IAssemblyDataProvider> assemblyDataProviders) : IApplicationRunner
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using newer style class constructor.

{
throw new ArgumentNullException(nameof(cancellationToken));
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

CancellationToken is not nullable in .NET 8.

@stephenfuqua
Copy link
Contributor Author

@semalaiappan I added Actions workflow updates to this:

  1. Rename the files to match main
  2. Rename the descriptions inside the file
  3. Remove references to main in the branch paths, since this code will never merge to main.

I applied these changes to Code Generation and to any files that would have been touched in other pull requests that already merged. I ignored files that will be covered in upcoming tickets.

@stephenfuqua stephenfuqua merged commit ed27961 into main-6x Jan 29, 2024
2 checks passed
@stephenfuqua stephenfuqua deleted the ODS-6169 branch January 29, 2024 16:01
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.

2 participants