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

feat: add support for .NET SDK V4 #279

Merged
merged 4 commits into from
Oct 18, 2024
Merged

Conversation

philasmar
Copy link
Contributor

Issue #, if available:
DOTNET-7758

Description of changes:

  • Updated .NET SDK project references to 4.0.0-preview.4
  • Added .NET 8 target framework
  • Enabled Trimming support
  • Added SourceLink support
  • Updated sample apps to new cs project styles

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@philasmar philasmar requested review from normj and 96malhar October 16, 2024 19:13
@@ -229,15 +229,22 @@ public void Flush()
}
}
}


Copy link
Member

Choose a reason for hiding this comment

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

In the LogEventTransmissionSetup there needs to be a null check when checking the log group collection after calling DescribeLogGroupsAsync.

Also the the PutLogEventsRequest _request field in AWSLoggerCore is initialized the LogEvents collection is never initialized. I think you need to change the line

public PutLogEventsRequest _request = new PutLogEventsRequest();

to

public PutLogEventsRequest _request = new PutLogEventsRequest {LogEvents = new List<InputLogEvent>() };

Not related to your change but I don't know why the _request field is public. Can you try and make that private and see if there are any issues. My quick scan shows it only used in AWSLoggerCore.

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 addressed your comments.
As for the public field, it is defined inside the LogEventBatch class and then accessed from AWSLoggerCore. So it needs to be public.

@philasmar philasmar requested a review from normj October 17, 2024 03:01
Copy link
Member

@normj normj left a comment

Choose a reason for hiding this comment

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

I wanted to build the packages locally to make sure they still looked right with all of the project file changes but I'm getting the following errors when I run dotnet msbuild build.proj

> dotnet msbuild .\build.proj
  build failed with 5 error(s) and 4 warning(s) (3.2s)
    C:\codebase\aws-logging-dotnet\test\AWS.Logger.SeriLog.Tests\AWS.Logger.SeriLog.Tests.csproj : error NU1903: Warning As Error: Package 'System.Text.Json' 8.0.0 has a known high severity vulnerability, https://github.com/advisories/GHSA-8g4q-xg66-9fp4 [C:\codebase\aws-logging-dotnet\AWS.Logger.sln]
    C:\codebase\aws-logging-dotnet\test\AWS.Logger.AspNetCore.Tests\AWS.Logger.AspNetCore.Tests.csproj : error NU1903: Warning As Error: Package 'System.Text.Json' 8.0.0 has a known high severity vulnerability, https://github.com/advisories/GHSA-8g4q-xg66-9fp4 [C:\codebase\aws-logging-dotnet\AWS.Logger.sln]
    C:\codebase\aws-logging-dotnet\test\AWS.Logger.AspNetCore.Tests\AWS.Logger.AspNetCore.Tests.csproj : error NU1903: Warning As Error: Package 'System.Text.Json' 8.0.0 has a known high severity vulnerability, https://github.com/advisories/GHSA-hh2w-p6rv-4g7w [C:\codebase\aws-logging-dotnet\AWS.Logger.sln]
    C:\codebase\aws-logging-dotnet\test\AWS.Logger.SeriLog.Tests\AWS.Logger.SeriLog.Tests.csproj : error NU1903: Warning As Error: Package 'System.Text.Json' 8.0.0 has a known high severity vulnerability, https://github.com/advisories/GHSA-hh2w-p6rv-4g7w [C:\codebase\aws-logging-dotnet\AWS.Logger.sln]
    C:\codebase\aws-logging-dotnet\samples\Serilog\SerilogTestCodeFromConfigRestrictedToMinimumLevel\SerilogTestCodeFromConfigRestrictedToMinimumLevel.csproj : warning NU1903: Package 'System.Text.Json' 8.0.0 has a known high severity vulnerability, https://github.com/advisories/GHSA-8g4q-xg66-9fp4 [C:\codebase\aws-logging-dotnet\AWS.Logger.sln]
    C:\codebase\aws-logging-dotnet\samples\Serilog\SerilogTestCodeFromConfigRestrictedToMinimumLevel\SerilogTestCodeFromConfigRestrictedToMinimumLevel.csproj : warning NU1903: Package 'System.Text.Json' 8.0.0 has a known high severity vulnerability, https://github.com/advisories/GHSA-hh2w-p6rv-4g7w [C:\codebase\aws-logging-dotnet\AWS.Logger.sln]
    C:\codebase\aws-logging-dotnet\samples\Serilog\SerilogTestCodeFromConfig\SerilogTestCodeFromConfig.csproj : warning NU1903: Package 'System.Text.Json' 8.0.0 has a known high severity vulnerability, https://github.com/advisories/GHSA-8g4q-xg66-9fp4 [C:\codebase\aws-logging-dotnet\AWS.Logger.sln]
    C:\codebase\aws-logging-dotnet\samples\Serilog\SerilogTestCodeFromConfig\SerilogTestCodeFromConfig.csproj : warning NU1903: Package 'System.Text.Json' 8.0.0 has a known high severity vulnerability, https://github.com/advisories/GHSA-hh2w-p6rv-4g7w [C:\codebase\aws-logging-dotnet\AWS.Logger.sln]
    C:\codebase\aws-logging-dotnet\build.proj(10,7): error MSB3073: The command "dotnet restore AWS.Logger.sln" exited with code 1.

@philasmar
Copy link
Contributor Author

I wanted to build the packages locally to make sure they still looked right with all of the project file changes but I'm getting the following errors when I run dotnet msbuild build.proj

> dotnet msbuild .\build.proj
  build failed with 5 error(s) and 4 warning(s) (3.2s)
    C:\codebase\aws-logging-dotnet\test\AWS.Logger.SeriLog.Tests\AWS.Logger.SeriLog.Tests.csproj : error NU1903: Warning As Error: Package 'System.Text.Json' 8.0.0 has a known high severity vulnerability, https://github.com/advisories/GHSA-8g4q-xg66-9fp4 [C:\codebase\aws-logging-dotnet\AWS.Logger.sln]
    C:\codebase\aws-logging-dotnet\test\AWS.Logger.AspNetCore.Tests\AWS.Logger.AspNetCore.Tests.csproj : error NU1903: Warning As Error: Package 'System.Text.Json' 8.0.0 has a known high severity vulnerability, https://github.com/advisories/GHSA-8g4q-xg66-9fp4 [C:\codebase\aws-logging-dotnet\AWS.Logger.sln]
    C:\codebase\aws-logging-dotnet\test\AWS.Logger.AspNetCore.Tests\AWS.Logger.AspNetCore.Tests.csproj : error NU1903: Warning As Error: Package 'System.Text.Json' 8.0.0 has a known high severity vulnerability, https://github.com/advisories/GHSA-hh2w-p6rv-4g7w [C:\codebase\aws-logging-dotnet\AWS.Logger.sln]
    C:\codebase\aws-logging-dotnet\test\AWS.Logger.SeriLog.Tests\AWS.Logger.SeriLog.Tests.csproj : error NU1903: Warning As Error: Package 'System.Text.Json' 8.0.0 has a known high severity vulnerability, https://github.com/advisories/GHSA-hh2w-p6rv-4g7w [C:\codebase\aws-logging-dotnet\AWS.Logger.sln]
    C:\codebase\aws-logging-dotnet\samples\Serilog\SerilogTestCodeFromConfigRestrictedToMinimumLevel\SerilogTestCodeFromConfigRestrictedToMinimumLevel.csproj : warning NU1903: Package 'System.Text.Json' 8.0.0 has a known high severity vulnerability, https://github.com/advisories/GHSA-8g4q-xg66-9fp4 [C:\codebase\aws-logging-dotnet\AWS.Logger.sln]
    C:\codebase\aws-logging-dotnet\samples\Serilog\SerilogTestCodeFromConfigRestrictedToMinimumLevel\SerilogTestCodeFromConfigRestrictedToMinimumLevel.csproj : warning NU1903: Package 'System.Text.Json' 8.0.0 has a known high severity vulnerability, https://github.com/advisories/GHSA-hh2w-p6rv-4g7w [C:\codebase\aws-logging-dotnet\AWS.Logger.sln]
    C:\codebase\aws-logging-dotnet\samples\Serilog\SerilogTestCodeFromConfig\SerilogTestCodeFromConfig.csproj : warning NU1903: Package 'System.Text.Json' 8.0.0 has a known high severity vulnerability, https://github.com/advisories/GHSA-8g4q-xg66-9fp4 [C:\codebase\aws-logging-dotnet\AWS.Logger.sln]
    C:\codebase\aws-logging-dotnet\samples\Serilog\SerilogTestCodeFromConfig\SerilogTestCodeFromConfig.csproj : warning NU1903: Package 'System.Text.Json' 8.0.0 has a known high severity vulnerability, https://github.com/advisories/GHSA-hh2w-p6rv-4g7w [C:\codebase\aws-logging-dotnet\AWS.Logger.sln]
    C:\codebase\aws-logging-dotnet\build.proj(10,7): error MSB3073: The command "dotnet restore AWS.Logger.sln" exited with code 1.

You are probably seeing those because you .NET9 installed. I didn't get those errors locally and in the build system with .NET8. I updated the problematic dependencies and tested them with .NET9.

@philasmar philasmar requested a review from normj October 17, 2024 16:11
@philasmar philasmar merged commit 04627d6 into v4sdk-development Oct 18, 2024
2 checks passed
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.

3 participants