Skip to content

Commit e444e96

Browse files
author
Bart Koelman
committed
Update to latest JetBrains tools
In the past, [cibuild hung after update to the latest version](#1045). Since then, the codebase has changed and a new minor version was released. These result in the cibuild no longer hanging. Stats from my laptop (old=v2021.1.4, new=v2021.2.2): ``` master, inspectcode (old): 2:59 master, inspectcode (new): 2:00 nrt, inspectcode (old): 3:04 nrt, inspectcode (new): 2:33 master, cleanupcode (old): 11:06 master, cleanupcode (new): 5:39 nrt, cleanupcode (old): 11:59 nrt, cleanupcode (new): 6:34 ``` So the newer versions got faster. And cleanupcode still takes the most time. In this PR, 722 of 1020 files have changed, which is 70% of the total codebase. Because during PR cibuild, we run cleanupcode only on changed files (in chunks), this PR takes very long and sometimes times out. This is an exceptional case, future PRs shouldn't touch so many files. So in the end, I believe this update is the best way forward.
1 parent cc45e15 commit e444e96

15 files changed

+19
-25
lines changed

.config/dotnet-tools.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"isRoot": true,
44
"tools": {
55
"jetbrains.resharper.globaltools": {
6-
"version": "2021.1.4",
6+
"version": "2021.2.2",
77
"commands": [
88
"jb"
99
]

Build.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function CheckLastExitCode {
88

99
function RunInspectCode {
1010
$outputPath = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(), 'jetbrains-inspectcode-results.xml')
11-
dotnet jb inspectcode JsonApiDotNetCore.sln --output="$outputPath" --profile=WarningSeverities.DotSettings --properties:Configuration=Release --severity=WARNING --verbosity=WARN -dsl=GlobalAll -dsl=SolutionPersonal -dsl=ProjectPersonal
11+
dotnet jb inspectcode JsonApiDotNetCore.sln --no-build --output="$outputPath" --profile=WarningSeverities.DotSettings --properties:Configuration=Release --severity=WARNING --verbosity=WARN -dsl=GlobalAll -dsl=SolutionPersonal -dsl=ProjectPersonal
1212
CheckLastExitCode
1313

1414
[xml]$xml = Get-Content "$outputPath"

benchmarks/Deserialization/OperationsDeserializationBenchmarks.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ public class OperationsDeserializationBenchmarks : DeserializationBenchmarkBase
276276

277277
protected override JsonApiRequest CreateJsonApiRequest(IResourceGraph resourceGraph)
278278
{
279-
return new()
279+
return new JsonApiRequest
280280
{
281281
Kind = EndpointKind.AtomicOperations
282282
};

benchmarks/Deserialization/ResourceDeserializationBenchmarks.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public class ResourceDeserializationBenchmarks : DeserializationBenchmarkBase
139139

140140
protected override JsonApiRequest CreateJsonApiRequest(IResourceGraph resourceGraph)
141141
{
142-
return new()
142+
return new JsonApiRequest
143143
{
144144
Kind = EndpointKind.Primary,
145145
PrimaryResourceType = resourceGraph.GetResourceType<IncomingResource>(),

benchmarks/Serialization/OperationsSerializationBenchmarks.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public string SerializeOperationsResponse()
122122

123123
protected override JsonApiRequest CreateJsonApiRequest(IResourceGraph resourceGraph)
124124
{
125-
return new()
125+
return new JsonApiRequest
126126
{
127127
Kind = EndpointKind.AtomicOperations,
128128
PrimaryResourceType = resourceGraph.GetResourceType<OutgoingResource>()

benchmarks/Serialization/ResourceSerializationBenchmarks.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public string SerializeResourceResponse()
113113

114114
protected override JsonApiRequest CreateJsonApiRequest(IResourceGraph resourceGraph)
115115
{
116-
return new()
116+
return new JsonApiRequest
117117
{
118118
Kind = EndpointKind.Primary,
119119
PrimaryResourceType = resourceGraph.GetResourceType<OutgoingResource>()

benchmarks/Serialization/SerializationBenchmarkBase.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -223,23 +223,23 @@ private sealed class FakeLinkBuilder : ILinkBuilder
223223
{
224224
public TopLevelLinks GetTopLevelLinks()
225225
{
226-
return new()
226+
return new TopLevelLinks
227227
{
228228
Self = "TopLevel:Self"
229229
};
230230
}
231231

232232
public ResourceLinks GetResourceLinks(ResourceType resourceType, string id)
233233
{
234-
return new()
234+
return new ResourceLinks
235235
{
236236
Self = "Resource:Self"
237237
};
238238
}
239239

240240
public RelationshipLinks GetRelationshipLinks(RelationshipAttribute relationship, string leftId)
241241
{
242-
return new()
242+
return new RelationshipLinks
243243
{
244244
Self = "Relationship:Self",
245245
Related = "Relationship:Related"

cleanupcode.ps1

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ if ($LASTEXITCODE -ne 0) {
88
throw "Tool restore failed with exit code $LASTEXITCODE"
99
}
1010

11-
dotnet build -c Release
11+
dotnet restore
1212

1313
if ($LASTEXITCODE -ne 0) {
14-
throw "Build failed with exit code $LASTEXITCODE"
14+
throw "Package restore failed with exit code $LASTEXITCODE"
1515
}
1616

1717
dotnet regitlint -s JsonApiDotNetCore.sln --print-command --jb --profile --jb --profile='\"JADNC Full Cleanup\"' --jb --properties:Configuration=Release --jb --verbosity=WARN

inspectcode.ps1

+1-7
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,9 @@ if ($LASTEXITCODE -ne 0) {
88
throw "Tool restore failed with exit code $LASTEXITCODE"
99
}
1010

11-
dotnet build -c Release
12-
13-
if ($LASTEXITCODE -ne 0) {
14-
throw "Build failed with exit code $LASTEXITCODE"
15-
}
16-
1711
$outputPath = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(), 'jetbrains-inspectcode-results.xml')
1812
$resultPath = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(), 'jetbrains-inspectcode-results.html')
19-
dotnet jb inspectcode JsonApiDotNetCore.sln --output="$outputPath" --profile=WarningSeverities.DotSettings --properties:Configuration=Release --severity=WARNING --verbosity=WARN -dsl=GlobalAll -dsl=SolutionPersonal -dsl=ProjectPersonal
13+
dotnet jb inspectcode JsonApiDotNetCore.sln --build --output="$outputPath" --profile=WarningSeverities.DotSettings --properties:Configuration=Release --severity=WARNING --verbosity=WARN -dsl=GlobalAll -dsl=SolutionPersonal -dsl=ProjectPersonal
2014

2115
if ($LASTEXITCODE -ne 0) {
2216
throw "Code inspection failed with exit code $LASTEXITCODE"

src/JsonApiDotNetCore/Errors/ResourcesInRelationshipsNotFoundException.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public ResourcesInRelationshipsNotFoundException(IEnumerable<MissingResourceInRe
1919

2020
private static ErrorObject CreateError(MissingResourceInRelationship missingResourceInRelationship)
2121
{
22-
return new(HttpStatusCode.NotFound)
22+
return new ErrorObject(HttpStatusCode.NotFound)
2323
{
2424
Title = "A related resource does not exist.",
2525
Detail = $"Related resource of type '{missingResourceInRelationship.ResourceType}' with ID '{missingResourceInRelationship.ResourceId}' " +

src/JsonApiDotNetCore/ObjectExtensions.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ public static T[] AsArray<T>(this T element)
2121

2222
public static List<T> AsList<T>(this T element)
2323
{
24-
return new()
24+
return new List<T>
2525
{
2626
element
2727
};
2828
}
2929

3030
public static HashSet<T> AsHashSet<T>(this T element)
3131
{
32-
return new()
32+
return new HashSet<T>
3333
{
3434
element
3535
};

src/JsonApiDotNetCore/Serialization/JsonConverters/JsonObjectConverter.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ protected static void WriteSubTree<TValue>(Utf8JsonWriter writer, TValue value,
2929

3030
protected static JsonException GetEndOfStreamError()
3131
{
32-
return new("Unexpected end of JSON stream.");
32+
return new JsonException("Unexpected end of JSON stream.");
3333
}
3434
}
3535
}

src/JsonApiDotNetCore/Serialization/Response/ResourceObjectTreeNode.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public ResourceObjectTreeNode(IIdentifiable resource, ResourceType type, Resourc
5151

5252
public static ResourceObjectTreeNode CreateRoot()
5353
{
54-
return new(RootResource, RootType, new ResourceObject());
54+
return new ResourceObjectTreeNode(RootResource, RootType, new ResourceObject());
5555
}
5656

5757
public void AttachDirectChild(ResourceObjectTreeNode treeNode)

test/JsonApiDotNetCoreTests/IntegrationTests/AtomicOperations/QueryStrings/MusicTrackReleaseDefinition.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public MusicTrackReleaseDefinition(IResourceGraph resourceGraph, ISystemClock sy
2424

2525
public override QueryStringParameterHandlers<MusicTrack> OnRegisterQueryableHandlersForQueryStringParameters()
2626
{
27-
return new()
27+
return new QueryStringParameterHandlers<MusicTrack>
2828
{
2929
["isRecentlyReleased"] = FilterOnRecentlyReleased
3030
};

test/TestBuildingBlocks/HttpResponseMessageExtensions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public static class HttpResponseMessageExtensions
1111
{
1212
public static HttpResponseMessageAssertions Should(this HttpResponseMessage instance)
1313
{
14-
return new(instance);
14+
return new HttpResponseMessageAssertions(instance);
1515
}
1616

1717
public sealed class HttpResponseMessageAssertions : ReferenceTypeAssertions<HttpResponseMessage, HttpResponseMessageAssertions>

0 commit comments

Comments
 (0)