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

[Dependencies] Updating SonarAnalyzer.CSharp (Code analysis) to 9.1.0.70676 #123

Merged
merged 3 commits into from
May 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Please ADD ALL Changes to the UNRELEASED SECTION and not a specific release
### Fixed
### Changed
- Dependencies - Updated Meziantou.Analyzer to 2.0.55
- Dependencies - Updated SonarAnalyzer.CSharp to 9.1.0.70676
### Removed
### Deployment Changes

Expand Down
2 changes: 1 addition & 1 deletion src/BuildBot.Discord/BuildBot.Discord.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<PackageReference Include="Roslynator.Analyzers" Version="4.3.0" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="SecurityCodeScan.VS2019" Version="5.6.7" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="SmartAnalyzers.CSharpExtensions.Annotations" Version="4.2.8" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.0.0.68202" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.1.0.70676" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="SourceLink.Create.CommandLine" Version="2.8.3" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="ToStringWithoutOverrideAnalyzer" Version="0.6.0" PrivateAssets="All" ExcludeAssets="runtime" />
</ItemGroup>
Expand Down
17 changes: 11 additions & 6 deletions src/BuildBot.Discord/Publishers/GitHub/StatusPublisher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,18 @@ public async Task PublishAsync(Status message, CancellationToken cancellationTok
return;
}

EmbedBuilder builder = new EmbedBuilder().WithTitle($"{message.Description} for {message.Context} from {message.Repository.Name} ({message.Branches.Last().Name})")
.WithUrl(message.TargetUrl)
.WithDescription($"Built at {message.StatusCommit.Sha}")
.WithColor(GetEmbedColor(message))
.WithFields(GetFields(message));
await this._bot.PublishAsync(BuildStatusMessage(message));
}

private static EmbedBuilder BuildStatusMessage(Status message)
{
Branch lastBranch = message.Branches[^1];

await this._bot.PublishAsync(builder);
return new EmbedBuilder().WithTitle($"{message.Description} for {message.Context} from {message.Repository.Name} ({lastBranch.Name})")
.WithUrl(message.TargetUrl)
.WithDescription($"Built at {message.StatusCommit.Sha}")
.WithColor(GetEmbedColor(message))
.WithFields(GetFields(message));
}

private static EmbedFieldBuilder[] GetFields(Status message)
Expand Down
2 changes: 1 addition & 1 deletion src/BuildBot.Json/BuildBot.Json.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<PackageReference Include="Roslynator.Analyzers" Version="4.3.0" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="SecurityCodeScan.VS2019" Version="5.6.7" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="SmartAnalyzers.CSharpExtensions.Annotations" Version="4.2.8" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.0.0.68202" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.1.0.70676" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="SourceLink.Create.CommandLine" Version="2.8.3" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="ToStringWithoutOverrideAnalyzer" Version="0.6.0" PrivateAssets="All" ExcludeAssets="runtime" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/BuildBot.ServiceModel/BuildBot.ServiceModel.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<PackageReference Include="Roslynator.Analyzers" Version="4.3.0" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="SecurityCodeScan.VS2019" Version="5.6.7" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="SmartAnalyzers.CSharpExtensions.Annotations" Version="4.2.8" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.0.0.68202" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.1.0.70676" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="SourceLink.Create.CommandLine" Version="2.8.3" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="ToStringWithoutOverrideAnalyzer" Version="0.6.0" PrivateAssets="All" ExcludeAssets="runtime" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/BuildBot.Tests/BuildBot.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<PackageReference Include="Roslynator.Analyzers" Version="4.3.0" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="SecurityCodeScan.VS2019" Version="5.6.7" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="SmartAnalyzers.CSharpExtensions.Annotations" Version="4.2.8" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.0.0.68202" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.1.0.70676" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="SourceLink.Create.CommandLine" Version="2.8.3" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="ToStringWithoutOverrideAnalyzer" Version="0.6.0" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="xunit.analyzers" Version="1.1.0" PrivateAssets="All" ExcludeAssets="runtime" />
Expand Down
23 changes: 0 additions & 23 deletions src/BuildBot.Tests/DecodesOctopusPush.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,29 +131,6 @@ public DecodesOctopusPush(ITestOutputHelper output)

private static JsonSerializerOptions SerializerOptionsWithContext { get; } = JsonSerialiser.Configure(new());

[Fact]
[SuppressMessage(category: "Philips.CodeAnalysis.DuplicateCodeAnalyzer", checkId: "PH2071:DuplicateCodeDetection", Justification = "Test code")]
public void Decode()
{
Deploy packet = AssertReallyNotNull(JsonSerializer.Deserialize<Deploy>(json: OCTOPUS_PUSH, options: SerializerOptions));

Assert.Equal(expected: "SubscriptionPayload", actual: packet.EventType);
Assert.Equal(expected: "https://octopus.funfair.io", actual: packet.Payload?.ServerUri);
Assert.Equal(expected: "Spaces-1", actual: packet.Payload?.Event?.SpaceId);
Assert.Equal(new[]
{
"Deployments-84781",
"Projects-825",
"Releases-81092",
"Environments-2",
"ServerTasks-197738",
"Channels-1070"
},
actual: packet.Payload?.Event?.RelatedDocumentIds);

Assert.Equal(expected: "DeploymentSucceeded", actual: packet.Payload?.Event?.Category);
}

[Fact]
[SuppressMessage(category: "Philips.CodeAnalysis.DuplicateCodeAnalyzer", checkId: "PH2071:DuplicateCodeDetection", Justification = "Test code")]
public void DecodeOpt()
Expand Down
2 changes: 1 addition & 1 deletion src/BuildBot/BuildBot.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
<PackageReference Include="Roslynator.Analyzers" Version="4.3.0" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="SecurityCodeScan.VS2019" Version="5.6.7" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="SmartAnalyzers.CSharpExtensions.Annotations" Version="4.2.8" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.0.0.68202" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.1.0.70676" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="SourceLink.Create.CommandLine" Version="2.8.3" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="ToStringWithoutOverrideAnalyzer" Version="0.6.0" PrivateAssets="All" ExcludeAssets="runtime" />
</ItemGroup>
Expand Down