Skip to content

Commit c26263c

Browse files
authored
Merge pull request #62 from json-api-dotnet/update-to-jadnc-v5.6.0
Update to JADNC v5.6.0
2 parents 961ecef + 949b5b0 commit c26263c

File tree

61 files changed

+279
-277
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+279
-277
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -43,36 +43,6 @@ jobs:
4343
dotnet-version: |
4444
6.0.x
4545
8.0.x
46-
- name: Setup PowerShell (Ubuntu)
47-
if: matrix.os == 'ubuntu-latest'
48-
run: |
49-
dotnet tool install --global PowerShell
50-
- name: Find latest PowerShell version (Windows)
51-
if: matrix.os == 'windows-latest'
52-
shell: pwsh
53-
run: |
54-
$packageName = "powershell"
55-
$outputText = dotnet tool search $packageName --take 1
56-
$outputLine = ("" + $outputText)
57-
$indexOfVersionLine = $outputLine.IndexOf($packageName)
58-
$latestVersion = $outputLine.substring($indexOfVersionLine + $packageName.length).trim().split(" ")[0].trim()
59-
60-
Write-Output "Found PowerShell version: $latestVersion"
61-
Write-Output "POWERSHELL_LATEST_VERSION=$latestVersion" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
62-
- name: Setup PowerShell (Windows)
63-
if: matrix.os == 'windows-latest'
64-
shell: cmd
65-
run: |
66-
set DOWNLOAD_LINK=https://github.com/PowerShell/PowerShell/releases/download/v%POWERSHELL_LATEST_VERSION%/PowerShell-%POWERSHELL_LATEST_VERSION%-win-x64.msi
67-
set OUTPUT_PATH=%RUNNER_TEMP%\PowerShell-%POWERSHELL_LATEST_VERSION%-win-x64.msi
68-
echo Downloading from: %DOWNLOAD_LINK% to: %OUTPUT_PATH%
69-
curl --location --output %OUTPUT_PATH% %DOWNLOAD_LINK%
70-
msiexec.exe /package %OUTPUT_PATH% /quiet USE_MU=1 ENABLE_MU=1 ADD_PATH=1 DISABLE_TELEMETRY=1
71-
- name: Setup PowerShell (macOS)
72-
if: matrix.os == 'macos-latest'
73-
run: |
74-
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
75-
brew install --cask powershell
7646
- name: Show installed versions
7747
shell: pwsh
7848
run: |
@@ -235,13 +205,13 @@ jobs:
235205
$baseCommitHash = git rev-parse HEAD~1
236206
237207
Write-Output "Running code cleanup on commit range $baseCommitHash..$headCommitHash in pull request."
238-
dotnet regitlint -s JsonApiDotNetCore.MongoDb.sln --print-command --skip-tool-check --max-runs=5 --jb --dotnetcoresdk=$(dotnet --version) --jb-profile="JADNC Full Cleanup" --jb --properties:Configuration=Release --jb --verbosity=WARN -f commits -a $headCommitHash -b $baseCommitHash --fail-on-diff --print-diff
208+
dotnet regitlint -s JsonApiDotNetCore.MongoDb.sln --print-command --skip-tool-check --max-runs=5 --jb --dotnetcoresdk=$(dotnet --version) --jb-profile="JADNC Full Cleanup" --jb --properties:Configuration=Release --jb --properties:RunAnalyzers=false --jb --verbosity=WARN -f commits -a $headCommitHash -b $baseCommitHash --fail-on-diff --print-diff
239209
- name: CleanupCode (on branch)
240210
if: github.event_name == 'push' || github.event_name == 'release'
241211
shell: pwsh
242212
run: |
243213
Write-Output "Running code cleanup on all files."
244-
dotnet regitlint -s JsonApiDotNetCore.MongoDb.sln --print-command --skip-tool-check --jb --dotnetcoresdk=$(dotnet --version) --jb-profile="JADNC Full Cleanup" --jb --properties:Configuration=Release --jb --verbosity=WARN --fail-on-diff --print-diff
214+
dotnet regitlint -s JsonApiDotNetCore.MongoDb.sln --print-command --skip-tool-check --jb --dotnetcoresdk=$(dotnet --version) --jb-profile="JADNC Full Cleanup" --jb --properties:Configuration=Release --jb --properties:RunAnalyzers=false --jb --verbosity=WARN --fail-on-diff --print-diff
245215
246216
publish:
247217
timeout-minutes: 60

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@
2727
<WarnOnPackingNonPackableProject>false</WarnOnPackingNonPackableProject>
2828
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)CodingGuidelines.ruleset</CodeAnalysisRuleSet>
2929
<RunSettingsFilePath>$(MSBuildThisFileDirectory)tests.runsettings</RunSettingsFilePath>
30-
<JsonApiDotNetCoreMongoDbVersionPrefix>5.5.1</JsonApiDotNetCoreMongoDbVersionPrefix>
30+
<JsonApiDotNetCoreMongoDbVersionPrefix>5.6.0</JsonApiDotNetCoreMongoDbVersionPrefix>
3131
</PropertyGroup>
3232
</Project>

JsonApiDotNetCore.MongoDb.sln

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
2323
ProjectSection(SolutionItems) = preProject
2424
.editorconfig = .editorconfig
2525
.gitignore = .gitignore
26+
.github\workflows\build.yml = .github\workflows\build.yml
2627
CodingGuidelines.ruleset = CodingGuidelines.ruleset
2728
CSharpGuidelinesAnalyzer.config = CSharpGuidelinesAnalyzer.config
2829
Directory.Build.props = Directory.Build.props
29-
tests.runsettings = tests.runsettings
3030
package-versions.props = package-versions.props
31+
tests.runsettings = tests.runsettings
3132
EndProjectSection
3233
EndProject
3334
Global

WarningSeverities.DotSettings

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConvertToConstant_002ELocal/@EntryIndexedValue">WARNING</s:String>
7070
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConvertToLambdaExpression/@EntryIndexedValue">WARNING</s:String>
7171
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConvertToNullCoalescingCompoundAssignment/@EntryIndexedValue">WARNING</s:String>
72+
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConvertToPrimaryConstructor/@EntryIndexedValue">WARNING</s:String>
7273
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConvertToStaticClass/@EntryIndexedValue">WARNING</s:String>
7374
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConvertToUsingDeclaration/@EntryIndexedValue">WARNING</s:String>
7475
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=DoubleNegationInPattern/@EntryIndexedValue">WARNING</s:String>
@@ -122,6 +123,7 @@
122123
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=NestedStringInterpolation/@EntryIndexedValue">WARNING</s:String>
123124
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=NotAccessedField_002EGlobal/@EntryIndexedValue">WARNING</s:String>
124125
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=OutdentIsOffPrevLevel/@EntryIndexedValue">WARNING</s:String>
126+
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=PropertyCanBeMadeInitOnly_002EGlobal/@EntryIndexedValue">WARNING</s:String>
125127
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=PropertyCanBeMadeInitOnly_002ELocal/@EntryIndexedValue">WARNING</s:String>
126128
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=PublicConstructorInAbstractClass/@EntryIndexedValue">WARNING</s:String>
127129
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RawStringCanBeSimplified/@EntryIndexedValue">WARNING</s:String>
@@ -164,7 +166,6 @@
164166
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RemoveRedundantOrStatement_002ETrue/@EntryIndexedValue">WARNING</s:String>
165167
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RemoveToList_002E1/@EntryIndexedValue">WARNING</s:String>
166168
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=RemoveToList_002E2/@EntryIndexedValue">WARNING</s:String>
167-
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ReplaceAsyncWithTaskReturn/@EntryIndexedValue">WARNING</s:String>
168169
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ReplaceObjectPatternWithVarPattern/@EntryIndexedValue">WARNING</s:String>
169170
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ReplaceSequenceEqualWithConstantPattern/@EntryIndexedValue">WARNING</s:String>
170171
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ReplaceWithFirstOrDefault_002E1/@EntryIndexedValue">WARNING</s:String>
@@ -196,6 +197,7 @@
196197
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ReplaceWithOfType_002ESingleOrDefault_002E1/@EntryIndexedValue">WARNING</s:String>
197198
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ReplaceWithOfType_002ESingleOrDefault_002E2/@EntryIndexedValue">WARNING</s:String>
198199
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ReplaceWithOfType_002EWhere/@EntryIndexedValue">WARNING</s:String>
200+
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ReplaceWithPrimaryConstructorParameter/@EntryIndexedValue">WARNING</s:String>
199201
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ReplaceWithSimpleAssignment_002EFalse/@EntryIndexedValue">WARNING</s:String>
200202
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ReplaceWithSimpleAssignment_002ETrue/@EntryIndexedValue">WARNING</s:String>
201203
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ReplaceWithSingleAssignment_002EFalse/@EntryIndexedValue">WARNING</s:String>

cleanupcode.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ if ($revision) {
2828

2929
if ($baseCommitHash -eq $headCommitHash) {
3030
Write-Output "Running code cleanup on staged/unstaged files."
31-
dotnet regitlint -s JsonApiDotNetCore.MongoDb.sln --print-command --skip-tool-check --max-runs=5 --jb --dotnetcoresdk=$(dotnet --version) --jb-profile="JADNC Full Cleanup" --jb --properties:Configuration=Release --jb --verbosity=WARN -f staged,modified
31+
dotnet regitlint -s JsonApiDotNetCore.MongoDb.sln --print-command --skip-tool-check --max-runs=5 --jb --dotnetcoresdk=$(dotnet --version) --jb-profile="JADNC Full Cleanup" --jb --properties:Configuration=Release --jb --properties:RunAnalyzers=false --jb --verbosity=WARN -f staged,modified
3232
VerifySuccessExitCode
3333
}
3434
else {
3535
Write-Output "Running code cleanup on commit range $baseCommitHash..$headCommitHash, including staged/unstaged files."
36-
dotnet regitlint -s JsonApiDotNetCore.MongoDb.sln --print-command --skip-tool-check --max-runs=5 --jb --dotnetcoresdk=$(dotnet --version) --jb-profile="JADNC Full Cleanup" --jb --properties:Configuration=Release --jb --verbosity=WARN -f staged,modified,commits -a $headCommitHash -b $baseCommitHash
36+
dotnet regitlint -s JsonApiDotNetCore.MongoDb.sln --print-command --skip-tool-check --max-runs=5 --jb --dotnetcoresdk=$(dotnet --version) --jb-profile="JADNC Full Cleanup" --jb --properties:Configuration=Release --jb --properties:RunAnalyzers=false --jb --verbosity=WARN -f staged,modified,commits -a $headCommitHash -b $baseCommitHash
3737
VerifySuccessExitCode
3838
}
3939
}
4040
else {
4141
Write-Output "Running code cleanup on all files."
42-
dotnet regitlint -s JsonApiDotNetCore.MongoDb.sln --print-command --skip-tool-check --jb --dotnetcoresdk=$(dotnet --version) --jb-profile="JADNC Full Cleanup" --jb --properties:Configuration=Release --jb --verbosity=WARN
42+
dotnet regitlint -s JsonApiDotNetCore.MongoDb.sln --print-command --skip-tool-check --jb --dotnetcoresdk=$(dotnet --version) --jb-profile="JADNC Full Cleanup" --jb --properties:Configuration=Release --jb --properties:RunAnalyzers=false --jb --verbosity=WARN
4343
VerifySuccessExitCode
4444
}

logo.png

-16 KB
Binary file not shown.

package-icon.png

2.84 KB
Loading

package-versions.props

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
<Project>
22
<PropertyGroup>
33
<!-- Published dependencies (only update on major version change) -->
4-
<JsonApiDotNetCoreFrozenVersion>5.5.0</JsonApiDotNetCoreFrozenVersion>
4+
<JsonApiDotNetCoreFrozenVersion>5.6.0</JsonApiDotNetCoreFrozenVersion>
55
<MongoDBDriverFrozenVersion>2.20.0</MongoDBDriverFrozenVersion>
66

77
<!-- Non-published dependencies (these are safe to update, won't cause a breaking change) -->
8-
<BogusVersion>34.0.*</BogusVersion>
8+
<BogusVersion>35.5.*</BogusVersion>
99
<CoverletVersion>6.0.*</CoverletVersion>
1010
<EphemeralMongoVersion>1.1.*</EphemeralMongoVersion>
1111
<FluentAssertionsVersion>6.12.*</FluentAssertionsVersion>
1212
<GitHubActionsTestLoggerVersion>2.3.*</GitHubActionsTestLoggerVersion>
13-
<InheritDocVersion>1.3.*</InheritDocVersion>
14-
<MongoDBDriverVersion>2.22.*</MongoDBDriverVersion>
13+
<InheritDocVersion>2.0.*</InheritDocVersion>
14+
<MongoDBDriverVersion>2.27.*</MongoDBDriverVersion>
1515
<SourceLinkVersion>8.0.*</SourceLinkVersion>
16-
<TestSdkVersion>17.8.*</TestSdkVersion>
17-
<XunitVersion>2.5.*</XunitVersion>
16+
<TestSdkVersion>17.10.*</TestSdkVersion>
17+
<XunitVersion>2.8.*</XunitVersion>
1818
</PropertyGroup>
1919

2020
<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0'">

src/Examples/JsonApiDotNetCoreMongoDbExample/Controllers/OperationsController.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ namespace JsonApiDotNetCoreMongoDbExample.Controllers;
88

99
public sealed class OperationsController(
1010
IJsonApiOptions options, IResourceGraph resourceGraph, ILoggerFactory loggerFactory, IOperationsProcessor processor, IJsonApiRequest request,
11-
ITargetedFields targetedFields) : JsonApiOperationsController(options, resourceGraph, loggerFactory, processor, request, targetedFields);
11+
ITargetedFields targetedFields, IAtomicOperationFilter operationFilter) : JsonApiOperationsController(options, resourceGraph, loggerFactory, processor,
12+
request, targetedFields, operationFilter);

src/JsonApiDotNetCore.MongoDb/AtomicOperations/MongoTransaction.cs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,24 +35,20 @@ public Task AfterProcessOperationAsync(CancellationToken cancellationToken)
3535
}
3636

3737
/// <inheritdoc />
38-
public Task CommitAsync(CancellationToken cancellationToken)
38+
public async Task CommitAsync(CancellationToken cancellationToken)
3939
{
4040
if (_ownsTransaction && _mongoDataAccess.ActiveSession != null)
4141
{
42-
return _mongoDataAccess.ActiveSession.CommitTransactionAsync(cancellationToken);
42+
await _mongoDataAccess.ActiveSession.CommitTransactionAsync(cancellationToken);
4343
}
44-
45-
return Task.CompletedTask;
4644
}
4745

4846
/// <inheritdoc />
49-
public ValueTask DisposeAsync()
47+
public async ValueTask DisposeAsync()
5048
{
5149
if (_ownsTransaction)
5250
{
53-
return _mongoDataAccess.DisposeAsync();
51+
await _mongoDataAccess.DisposeAsync();
5452
}
55-
56-
return ValueTask.CompletedTask;
5753
}
5854
}

0 commit comments

Comments
 (0)