-
Notifications
You must be signed in to change notification settings - Fork 0
Adopt ANcpLua.NET.Sdk 3.4.27 across .NET projects and refactor JS SDK usage #17
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,7 +46,8 @@ | |
| "Restore", | ||
| "SetupTestcontainers", | ||
| "Test", | ||
| "UnitTests" | ||
| "UnitTests", | ||
| "Verify" | ||
| ] | ||
| }, | ||
| "Verbosity": { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,17 @@ | ||
| <Project> | ||
|
|
||
| <!-- Enable new dotnet test experience for .NET 10 + Microsoft Testing Platform --> | ||
| <!-- Applied to all projects; only test projects (with MTP packages) will use it --> | ||
| <PropertyGroup> | ||
| <TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport> | ||
| </PropertyGroup> | ||
| <!-- SDK enables TreatWarningsAsErrors in CI/Release. The list below carves out specific | ||
| rule IDs that surface heavily on the existing codebase and are scheduled for | ||
| follow-up cleanup PRs rather than the SDK-adoption PR. Each ID has a target PR. --> | ||
| <PropertyGroup> | ||
| <WarningsNotAsErrors> | ||
| $(WarningsNotAsErrors); | ||
| AL0025;AL0026;AL0039;AL0070;AL0081;AL0101;AL0114;AL0137; | ||
| RS0030; | ||
| CA1002;CA1032;CA1034;CA1052;CA1056;CA1307;CA1725;CA1819;CA1822;CA1823;CA1852;CA1859; | ||
| CA2000;CA2012;CA2201;CA5394; | ||
| IDE0370;IDE1006 | ||
| </WarningsNotAsErrors> | ||
| </PropertyGroup> | ||
|
|
||
| </Project> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,7 @@ public sealed class ReportProcessor( | |
| ILogger<ReportProcessor> logger) : IReportProcessor | ||
| { | ||
| private const string SchemaFileName = "accessReport.xsd"; | ||
| private static readonly XmlSerializer Serializer = new(typeof(AccessReportDto)); | ||
| private static readonly XmlSerializer s_serializer = new(typeof(AccessReportDto)); | ||
|
|
||
| private XmlSchemaSet Schemas => field ??= LoadSchemas(); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ⚪ LOW RISK Suggestion: Lazy initialization with |
||
|
|
||
|
|
@@ -89,7 +89,7 @@ private XmlSchemaSet LoadSchemas() | |
| }; | ||
|
|
||
| using XmlReader reader = XmlReader.Create(stream, settings); | ||
| AccessReportDto dto = (AccessReportDto)Serializer.Deserialize(reader)!; | ||
| AccessReportDto dto = (AccessReportDto)s_serializer.Deserialize(reader)!; | ||
|
|
||
| if (validationErrors.Count > 0) | ||
| { | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -220,7 +220,7 @@ private IServiceCollection AddInfrastructure(IConfiguration config) | |||||||
|
|
||||||||
| private IServiceCollection AddPostgres(IConfiguration config) | ||||||||
| { | ||||||||
| NpgsqlDataSource dataSource = new NpgsqlDataSourceBuilder(config.GetConnectionString("PaperlessDb")!) | ||||||||
| NpgsqlDataSource dataSource = new NpgsqlDataSourceBuilder(config.GetConnectionString("PaperlessDb")) | ||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 MEDIUM RISK Add a guard clause to handle missing connection strings explicitly, which improves error clarity and satisfies the compiler when NRT is enabled.
Suggested change
|
||||||||
| .MapEnum<DocumentStatus>("document_status") | ||||||||
| .Build(); | ||||||||
|
|
||||||||
|
|
||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,9 +5,6 @@ namespace PaperlessREST.Host.Extensions; | |
| /// </summary> | ||
| public static class TypedErrorOrAsyncExtensions | ||
| { | ||
| private static readonly NotFound NotFound = TypedResults.NotFound(); | ||
| private static readonly NoContent NoContent = TypedResults.NoContent(); | ||
|
|
||
| private static ValidationProblem CreateValidationProblem(IReadOnlyList<Error> errors) => | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ⚪ LOW RISK Nitpick: Re-introduce the cached static instances for NotFound and NoContent results to maintain performance and reduce allocations in high-traffic scenarios. |
||
| TypedResults.ValidationProblem( | ||
| errors.Where(e => e.Type == ErrorType.Validation) | ||
|
|
@@ -79,7 +76,7 @@ public async Task<Results<Ok<TResult>, NotFound>> ToOkOr404<TResult>( | |
| } | ||
|
|
||
| return result.FirstError.Type == ErrorType.NotFound | ||
| ? NotFound | ||
| ? TypedResults.NotFound() | ||
| : throw ContractViolationException.ForNotFoundOnly(result.FirstError, result.Errors, callerName); | ||
| } | ||
|
|
||
|
|
@@ -126,11 +123,11 @@ public async Task<Results<NoContent, NotFound>> ToNoContentOr404([CallerMemberNa | |
|
|
||
| if (!result.IsError) | ||
| { | ||
| return NoContent; | ||
| return TypedResults.NoContent(); | ||
| } | ||
|
|
||
| return result.FirstError.Type == ErrorType.NotFound | ||
| ? NotFound | ||
| ? TypedResults.NotFound() | ||
| : throw ContractViolationException.ForNotFoundOnly(result.FirstError, result.Errors, callerName); | ||
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔴 HIGH RISK
Update the package versions to match the stable releases mentioned in the comment to ensure a successful build. The versions 7.3.1 and 10.0.7 do not exist for these packages.