Skip to content
This repository has been archived by the owner on Apr 6, 2024. It is now read-only.

Commit

Permalink
Merge branch 'release/4.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalberger committed Dec 23, 2023
2 parents e80450b + c1c168b commit da0e6e9
Show file tree
Hide file tree
Showing 18 changed files with 115 additions and 116 deletions.
5 changes: 3 additions & 2 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ install:
- ps: mkdir $env:DOTNET_INSTALL_DIR -Force | Out-Null
- ps: Invoke-WebRequest -Uri "https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.ps1" -OutFile "$($env:DOTNET_INSTALL_DIR)/dotnet-install.ps1"
- ps: '& "$($env:DOTNET_INSTALL_DIR)/dotnet-install.ps1" -Version 5.0.408 -InstallDir $env:DOTNET_INSTALL_DIR'
- ps: '& "$($env:DOTNET_INSTALL_DIR)/dotnet-install.ps1" -Version 6.0.405 -InstallDir $env:DOTNET_INSTALL_DIR'
- ps: '& "$($env:DOTNET_INSTALL_DIR)/dotnet-install.ps1" -Version 7.0.102 -InstallDir $env:DOTNET_INSTALL_DIR'
- ps: '& "$($env:DOTNET_INSTALL_DIR)/dotnet-install.ps1" -Version 6.0.417 -InstallDir $env:DOTNET_INSTALL_DIR'
- ps: '& "$($env:DOTNET_INSTALL_DIR)/dotnet-install.ps1" -Version 7.0.404 -InstallDir $env:DOTNET_INSTALL_DIR'
- ps: '& "$($env:DOTNET_INSTALL_DIR)/dotnet-install.ps1" -Version 8.0.100 -InstallDir $env:DOTNET_INSTALL_DIR'
- ps: $env:Path = "$env:DOTNET_INSTALL_DIR;$env:Path"
- ps: dotnet --info

Expand Down
21 changes: 0 additions & 21 deletions .github/dependabot.yml

This file was deleted.

6 changes: 6 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"github>cake-contrib/renovate-presets:cake-issues"
]
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"dotnet.defaultSolution": "src\\Cake.Issues.PullRequests.AzureDevOps.sln"
}
1 change: 1 addition & 0 deletions GitReleaseManager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ issue-labels-include:
- Bug
- Improvement
- Documentation
- Dependencies
issue-labels-exclude:
- Build
issue-labels-alias:
Expand Down
21 changes: 21 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,19 @@ jobs:
- task: UseDotNet@2
inputs:
version: '5.x'
displayName: 'Install .NET 5'
- task: UseDotNet@2
inputs:
version: '6.x'
displayName: 'Install .NET 6'
- task: UseDotNet@2
inputs:
version: '7.x'
displayName: 'Install .NET 7'
- task: UseDotNet@2
inputs:
version: '8.x'
displayName: 'Install .NET 8'
- powershell: |
$ENV:CAKE_SKIP_GITVERSION=([string]::IsNullOrEmpty($ENV:SYSTEM_PULLREQUEST_PULLREQUESTID) -eq $False).ToString()
.\build.ps1
Expand All @@ -38,12 +45,19 @@ jobs:
- task: UseDotNet@2
inputs:
version: '5.x'
displayName: 'Install .NET 5'
- task: UseDotNet@2
inputs:
version: '6.x'
displayName: 'Install .NET 6'
- task: UseDotNet@2
inputs:
version: '7.x'
displayName: 'Install .NET 7'
- task: UseDotNet@2
inputs:
version: '8.x'
displayName: 'Install .NET 8'
- bash: |
./build.sh
displayName: 'Cake Build'
Expand All @@ -56,12 +70,19 @@ jobs:
- task: UseDotNet@2
inputs:
version: '5.x'
displayName: 'Install .NET 5'
- task: UseDotNet@2
inputs:
version: '6.x'
displayName: 'Install .NET 6'
- task: UseDotNet@2
inputs:
version: '7.x'
displayName: 'Install .NET 7'
- task: UseDotNet@2
inputs:
version: '8.x'
displayName: 'Install .NET 8'
- bash: |
./build.sh --verbosity=diagnostic
displayName: 'Cake Build'
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"sdk": {
"allowPrerelease": true,
"version": "7.0.100",
"version": "8.0.100",
"rollForward": "latestFeature"
}
}
6 changes: 5 additions & 1 deletion recipe.cake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#load nuget:?package=Cake.Recipe&version=3.0.0
#load nuget:?package=Cake.Recipe&version=3.1.1

//*************************************************************************************************
// Settings
Expand All @@ -15,11 +15,15 @@ BuildParameters.SetParameters(
repositoryName: "Cake.Issues.PullRequests.AzureDevOps",
appVeyorAccountName: "cakecontrib",
shouldRunCoveralls: false, // Disabled because it's currently failing
shouldPostToGitter: false, // Disabled because it's currently failing
shouldGenerateDocumentation: false,
shouldRunDotNetCorePack: true);

BuildParameters.PrintParameters(Context);

ToolSettings.SetToolPreprocessorDirectives(
reSharperTools: "#tool nuget:?package=JetBrains.ReSharper.CommandLineTools&version=2023.3.0");

ToolSettings.SetToolSettings(
context: Context,
testCoverageFilter: "+[*]* -[xunit.*]* -[Cake.Core]* -[Cake.Common]* -[Cake.Testing]* -[*.Tests]* -[Cake.Issues]* -[Cake.Issues.Testing]* -[Cake.Issues.PullRequests]* -[Cake.AzureDevOps]* -[Shouldly]* -[DiffEngine]* -[EmptyFiles]*",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<IsPackable>false</IsPackable>
<Product>Cake.Issues.PullRequests.AzureDevOps</Product>
<Copyright>Copyright © BBT Software AG and contributors</Copyright>
Expand All @@ -15,17 +15,17 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Cake.Issues" Version="3.0.0" />
<PackageReference Include="Cake.Issues.PullRequests" Version="3.0.0" />
<PackageReference Include="Cake.Issues.Testing" Version="3.0.0" />
<PackageReference Include="Cake.Testing" Version="3.0.0" />
<PackageReference Include="Cake.AzureDevOps" Version="3.0.0" />
<PackageReference Include="NSubstitute" Version="4.4.0" />
<PackageReference Include="Shouldly" Version="4.1.0" />
<PackageReference Include="Cake.Issues" Version="4.0.0" />
<PackageReference Include="Cake.Issues.PullRequests" Version="4.0.0" />
<PackageReference Include="Cake.Issues.Testing" Version="4.0.0" />
<PackageReference Include="Cake.Testing" Version="4.0.0" />
<PackageReference Include="Cake.AzureDevOps" Version="4.0.0" />
<PackageReference Include="NSubstitute" Version="5.1.0" />
<PackageReference Include="Shouldly" Version="4.2.1" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.6.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.5" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,31 @@ public sealed class TheGetContentMethod
{
[Theory]
[InlineData(
@"foo.cs",
"foo.cs",
123,
"Some message",
IssuePriority.Warning,
"foo",
null,
"foo: Some message")]
[InlineData(
@"foo.cs",
"foo.cs",
123,
"Some message",
IssuePriority.Warning,
"",
null,
"Some message")]
[InlineData(
@"foo.cs",
"foo.cs",
123,
"Some message",
IssuePriority.Warning,
" ",
null,
"Some message")]
[InlineData(
@"foo.cs",
"foo.cs",
123,
"Some message",
IssuePriority.Warning,
Expand Down
2 changes: 2 additions & 0 deletions src/Cake.Issues.PullRequests.AzureDevOps.ruleset
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@
<Rule Id="CA5122" Action="None" />
</Rules>
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
<!-- Currently not compatible with collection initializers. See https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/3687 -->
<Rule Id="SA1010" Action="None" />
<Rule Id="SA1633" Action="None" />
</Rules>
</RuleSet>
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ protected override void InternalPostDiscussionThreads(IEnumerable<IIssue> issues
// ReSharper disable once PossibleMultipleEnumeration
var threads = this.CreateDiscussionThreads(issues, commentSource).ToList();

if (!threads.Any())
if (threads.Count == 0)
{
this.Log.Verbose("No threads to post");
return;
Expand All @@ -107,7 +107,7 @@ private static void AddCodeFlowProperties(
IIssue issue,
int iterationId,
int changeTrackingId,
IDictionary<string, object> properties)
Dictionary<string, object> properties)
{
issue.NotNull(nameof(issue));
properties.NotNull(nameof(properties));
Expand Down Expand Up @@ -139,7 +139,7 @@ private bool ValidatePullRequest()
return false;
}

private IEnumerable<AzureDevOpsPullRequestCommentThread> CreateDiscussionThreads(
private List<AzureDevOpsPullRequestCommentThread> CreateDiscussionThreads(
IEnumerable<IIssue> issues,
string commentSource)
{
Expand All @@ -149,7 +149,7 @@ private IEnumerable<AzureDevOpsPullRequestCommentThread> CreateDiscussionThreads
if (this.azureDevOpsPullRequest.CodeReviewId <= 0)
{
this.Log.Error("Skipping creation of discussion thread since code review ID is not set.");
return new List<AzureDevOpsPullRequestCommentThread>();
return [];
}

this.Log.Verbose("Creating new discussion threads");
Expand Down Expand Up @@ -254,15 +254,15 @@ private int GetCodeFlowLatestIterationId()
return iterationId;
}

private IEnumerable<AzureDevOpsPullRequestIterationChange> GetCodeFlowChanges(int iterationId)
private List<AzureDevOpsPullRequestIterationChange> GetCodeFlowChanges(int iterationId)
{
var changes =
this.azureDevOpsPullRequest.GetIterationChanges(iterationId);

if (changes == null)
{
this.Log.Warning("Changes for iteration {0} could not be detected", iterationId);
return new List<AzureDevOpsPullRequestIterationChange>();
return [];
}

var result = changes.ToList();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
namespace Cake.Issues.PullRequests.AzureDevOps
{
using System.Diagnostics.CodeAnalysis;
using Cake.Core.Annotations;

/// <summary>
/// Contains functionality related to writing code analysis issues to Azure DevOps pull requests.
/// </summary>
[CakeAliasCategory(IssuesAliasConstants.MainCakeAliasCategory)]
[SuppressMessage("ReSharper", "RedundantTypeDeclarationBody", Justification = "Fixing will crash StyleCop")]
public static partial class AzureDevOpsPullRequestSystemAliases
{
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\Cake.Issues.PullRequests.AzureDevOps.xml</DocumentationFile>
</PropertyGroup>

Expand Down Expand Up @@ -32,7 +32,7 @@ See the Project Site for an overview of the whole ecosystem of addins for workin
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/cake-contrib/Cake.Issues.PullRequests.AzureDevOps.git</RepositoryUrl>
<PackageReleaseNotes>https://github.com/cake-contrib/Cake.Issues.PullRequests.AzureDevOps/releases/tag/3.0.0</PackageReleaseNotes>
<PackageReleaseNotes>https://github.com/cake-contrib/Cake.Issues.PullRequests.AzureDevOps/releases/tag/4.0.0</PackageReleaseNotes>
</PropertyGroup>

<ItemGroup>
Expand All @@ -41,11 +41,11 @@ See the Project Site for an overview of the whole ecosystem of addins for workin
</ItemGroup>

<ItemGroup>
<PackageReference Include="Cake.Core" Version="3.0.0" PrivateAssets="All" />
<PackageReference Include="Cake.Issues" Version="3.0.0" PrivateAssets="All" />
<PackageReference Include="Cake.Issues.PullRequests" Version="3.0.0" PrivateAssets="All" />
<PackageReference Include="Cake.AzureDevOps" Version="3.0.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.0">
<PackageReference Include="Cake.Core" Version="4.0.0" PrivateAssets="All" />
<PackageReference Include="Cake.Issues" Version="4.0.0" PrivateAssets="All" />
<PackageReference Include="Cake.Issues.PullRequests" Version="4.0.0" PrivateAssets="All" />
<PackageReference Include="Cake.AzureDevOps" Version="4.0.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,11 @@
/// <summary>
/// Implementation of a <see cref="BaseCheckingCommitIdCapability{T}"/> for <see cref="AzureDevOpsPullRequestSystem"/>.
/// </summary>
internal class AzureDevOpsCheckingCommitIdCapability : BaseCheckingCommitIdCapability<IAzureDevOpsPullRequestSystem>
/// <param name="log">The Cake log context.</param>
/// <param name="pullRequestSystem">Pull request system to which this capability belongs.</param>
internal class AzureDevOpsCheckingCommitIdCapability(ICakeLog log, IAzureDevOpsPullRequestSystem pullRequestSystem)
: BaseCheckingCommitIdCapability<IAzureDevOpsPullRequestSystem>(log, pullRequestSystem)
{
/// <summary>
/// Initializes a new instance of the <see cref="AzureDevOpsCheckingCommitIdCapability"/> class.
/// </summary>
/// <param name="log">The Cake log context.</param>
/// <param name="pullRequestSystem">Pull request system to which this capability belongs.</param>
public AzureDevOpsCheckingCommitIdCapability(ICakeLog log, IAzureDevOpsPullRequestSystem pullRequestSystem)
: base(log, pullRequestSystem)
{
}

/// <inheritdoc />
public override string GetLastSourceCommitId()
{
Expand Down
Loading

0 comments on commit da0e6e9

Please sign in to comment.