Skip to content

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 7756f64 + 795e8d2 commit f6e6b2f
Show file tree
Hide file tree
Showing 67 changed files with 222 additions and 4,871 deletions.
5 changes: 3 additions & 2 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,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
15 changes: 0 additions & 15 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.sln"
}
10 changes: 0 additions & 10 deletions 3rd-Party-License.md

This file was deleted.

3 changes: 3 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,8 @@ jobs:
- task: UseDotNet@2
inputs:
version: '7.x'
- task: UseDotNet@2
inputs:
version: '8.x'
- powershell: ./build.ps1
displayName: 'Cake Build'
7 changes: 7 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"sdk": {
"allowPrerelease": true,
"version": "8.0.100",
"rollForward": "latestFeature"
}
}
5 changes: 4 additions & 1 deletion nuspec/nuget/Cake.Issues.PullRequests.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ See the Project Site for an overview of the whole ecosystem of addins for workin
<repository type="git" url="https://github.com/cake-contrib/Cake.Issues.git"/>
<copyright>Copyright © BBT Software AG and contributors</copyright>
<tags>Cake Script Cake-Issues CodeAnalysis Linting Issues Pull-Requests</tags>
<releaseNotes>https://github.com/cake-contrib/Cake.Issues/releases/tag/3.0.0</releaseNotes>
<releaseNotes>https://github.com/cake-contrib/Cake.Issues/releases/tag/4.0.0-beta.1</releaseNotes>
</metadata>
<files>
<file src="..\..\..\..\nuspec\nuget\icon.png" target="" />
Expand All @@ -32,5 +32,8 @@ See the Project Site for an overview of the whole ecosystem of addins for workin
<file src="net7.0\Cake.Issues.PullRequests.dll" target="lib\net7.0" />
<file src="net7.0\Cake.Issues.PullRequests.pdb" target="lib\net7.0" />
<file src="net7.0\Cake.Issues.PullRequests.xml" target="lib\net7.0" />
<file src="net8.0\Cake.Issues.PullRequests.dll" target="lib\net8.0" />
<file src="net8.0\Cake.Issues.PullRequests.pdb" target="lib\net8.0" />
<file src="net8.0\Cake.Issues.PullRequests.xml" target="lib\net8.0" />
</files>
</package>
5 changes: 4 additions & 1 deletion nuspec/nuget/Cake.Issues.Reporting.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ See the Project Site for an overview of the whole ecosystem of addins for workin
<repository type="git" url="https://github.com/cake-contrib/Cake.Issues.git"/>
<copyright>Copyright © BBT Software AG and contributors</copyright>
<tags>Cake Script Cake-Issues CodeAnalysis Linting Issues Reporting</tags>
<releaseNotes>https://github.com/cake-contrib/Cake.Issues/releases/tag/3.0.0</releaseNotes>
<releaseNotes>https://github.com/cake-contrib/Cake.Issues/releases/tag/4.0.0-beta.1</releaseNotes>
</metadata>
<files>
<file src="..\..\..\..\nuspec\nuget\icon.png" target="" />
Expand All @@ -32,5 +32,8 @@ See the Project Site for an overview of the whole ecosystem of addins for workin
<file src="net7.0\Cake.Issues.Reporting.dll" target="lib\net7.0" />
<file src="net7.0\Cake.Issues.Reporting.pdb" target="lib\net7.0" />
<file src="net7.0\Cake.Issues.Reporting.xml" target="lib\net7.0" />
<file src="net8.0\Cake.Issues.Reporting.dll" target="lib\net8.0" />
<file src="net8.0\Cake.Issues.Reporting.pdb" target="lib\net8.0" />
<file src="net8.0\Cake.Issues.Reporting.xml" target="lib\net8.0" />
</files>
</package>
5 changes: 4 additions & 1 deletion nuspec/nuget/Cake.Issues.Testing.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Common helpers for testing add-ins based on Cake.Issues
<repository type="git" url="https://github.com/cake-contrib/Cake.Issues.git"/>
<copyright>Copyright © BBT Software AG and contributors</copyright>
<tags>Cake Script Cake-Issues Issues Testing</tags>
<releaseNotes>https://github.com/cake-contrib/Cake.Issues/releases/tag/3.0.0</releaseNotes>
<releaseNotes>https://github.com/cake-contrib/Cake.Issues/releases/tag/4.0.0-beta.1</releaseNotes>
</metadata>
<files>
<file src="..\..\..\..\nuspec\nuget\icon.png" target="" />
Expand All @@ -27,5 +27,8 @@ Common helpers for testing add-ins based on Cake.Issues
<file src="net7.0\Cake.Issues.Testing.dll" target="lib\net7.0" />
<file src="net7.0\Cake.Issues.Testing.pdb" target="lib\net7.0" />
<file src="net7.0\Cake.Issues.Testing.xml" target="lib\net7.0" />
<file src="net8.0\Cake.Issues.Testing.dll" target="lib\net8.0" />
<file src="net8.0\Cake.Issues.Testing.pdb" target="lib\net8.0" />
<file src="net8.0\Cake.Issues.Testing.xml" target="lib\net8.0" />
</files>
</package>
5 changes: 4 additions & 1 deletion nuspec/nuget/Cake.Issues.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ See the Project Site for an overview of the whole ecosystem of addins for workin
<repository type="git" url="https://github.com/cake-contrib/Cake.Issues.git"/>
<copyright>Copyright © BBT Software AG and contributors</copyright>
<tags>cake cake-addin cake-issues code-analysis linting issues</tags>
<releaseNotes>https://github.com/cake-contrib/Cake.Issues/releases/tag/3.0.0</releaseNotes>
<releaseNotes>https://github.com/cake-contrib/Cake.Issues/releases/tag/4.0.0-beta.1</releaseNotes>
</metadata>
<files>
<file src="..\..\..\..\nuspec\nuget\icon.png" target="" />
Expand All @@ -34,5 +34,8 @@ See the Project Site for an overview of the whole ecosystem of addins for workin
<file src="net7.0\Cake.Issues.dll" target="lib\net7.0" />
<file src="net7.0\Cake.Issues.pdb" target="lib\net7.0" />
<file src="net7.0\Cake.Issues.xml" target="lib\net7.0" />
<file src="net8.0\Cake.Issues.dll" target="lib\net8.0" />
<file src="net8.0\Cake.Issues.pdb" target="lib\net8.0" />
<file src="net8.0\Cake.Issues.xml" target="lib\net8.0" />
</files>
</package>
5 changes: 3 additions & 2 deletions 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 @@ -14,7 +14,8 @@ BuildParameters.SetParameters(
repositoryOwner: "cake-contrib",
repositoryName: "Cake.Issues",
appVeyorAccountName: "cakecontrib",
shouldRunCoveralls: false); // Disabled because it's currently failing
shouldRunCoveralls: false, // Disabled because it's currently failing
shouldPostToGitter: false); // Disabled because it's currently failing

BuildParameters.PrintParameters(Context);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<IsPackable>false</IsPackable>
Expand All @@ -10,13 +10,13 @@
<CodeAnalysisRuleSet>..\Cake.Issues.Tests.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="Cake.Core" Version="3.0.0" />
<PackageReference Include="Cake.Testing" Version="3.0.0" />
<PackageReference Include="Shouldly" Version="4.1.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Cake.Core" Version="4.0.0" />
<PackageReference Include="Cake.Testing" Version="4.0.0" />
<PackageReference Include="Shouldly" Version="4.2.1" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5" />
<PackageReference Include="xunit" Version="2.6.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.4" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Cake.Issues\Cake.Issues.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,10 @@
/// <summary>
/// Implementation of a <see cref="BaseCheckingCommitIdCapability{T}"/> for use in test cases.
/// </summary>
public class FakeCheckingCommitIdCapability : BaseCheckingCommitIdCapability<FakePullRequestSystem>
/// <param name="log">The Cake log context.</param>
/// <param name="pullRequestSystem">Pull request system to which this capability belongs.</param>
public class FakeCheckingCommitIdCapability(ICakeLog log, FakePullRequestSystem pullRequestSystem) : BaseCheckingCommitIdCapability<FakePullRequestSystem>(log, pullRequestSystem)
{
/// <summary>
/// Initializes a new instance of the <see cref="FakeCheckingCommitIdCapability"/> class.
/// </summary>
/// <param name="log">The Cake log context.</param>
/// <param name="pullRequestSystem">Pull request system to which this capability belongs.</param>
public FakeCheckingCommitIdCapability(ICakeLog log, FakePullRequestSystem pullRequestSystem)
: base(log, pullRequestSystem)
{
}

/// <summary>
/// Gets the Cake log context.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
/// </summary>
public class FakeDiscussionThreadsCapability : BaseDiscussionThreadsCapability<FakePullRequestSystem>
{
private readonly List<IPullRequestDiscussionThread> discussionThreads = new ();
private readonly List<IPullRequestDiscussionThread> resolvedThreads = new ();
private readonly List<IPullRequestDiscussionThread> reopenedThreads = new ();
private readonly List<IPullRequestDiscussionThread> discussionThreads = [];
private readonly List<IPullRequestDiscussionThread> resolvedThreads = [];
private readonly List<IPullRequestDiscussionThread> reopenedThreads = [];

/// <summary>
/// Initializes a new instance of the <see cref="FakeDiscussionThreadsCapability"/> class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/// </summary>
public class FakeFilteringByModifiedFilesCapability : BaseFilteringByModifiedFilesCapability<FakePullRequestSystem>
{
private readonly List<FilePath> modifiedFiles = new ();
private readonly List<FilePath> modifiedFiles = [];

/// <summary>
/// Initializes a new instance of the <see cref="FakeFilteringByModifiedFilesCapability"/> class.
Expand Down
14 changes: 3 additions & 11 deletions src/Cake.Issues.PullRequests.Tests/FakePullRequestSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,10 @@
/// <summary>
/// Implementation of a <see cref="BasePullRequestSystem"/> for use in test cases.
/// </summary>
public class FakePullRequestSystem : BasePullRequestSystem
/// <param name="log">The Cake log instance.</param>
public class FakePullRequestSystem(ICakeLog log) : BasePullRequestSystem(log)
{
private readonly List<IIssue> postedIssues = new ();

/// <summary>
/// Initializes a new instance of the <see cref="FakePullRequestSystem"/> class.
/// </summary>
/// <param name="log">The Cake log instance.</param>
public FakePullRequestSystem(ICakeLog log)
: base(log)
{
}
private readonly List<IIssue> postedIssues = [];

/// <summary>
/// Gets the log instance.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
public class FakePullRequestSystemBuilder
{
private readonly ICakeLog log;
private readonly List<IPullRequestDiscussionThread> discussionThreads = new ();
private readonly List<FilePath> modifiedFiles = new ();
private readonly List<IPullRequestDiscussionThread> discussionThreads = [];
private readonly List<FilePath> modifiedFiles = [];
private bool withCheckingCommitIdCapability;
private bool withDiscussionThreadsCapability;
private bool withFilteringByModifiedFilesCapability;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,10 @@
/// <summary>
/// Implementation of a <see cref="BasePullRequestSystemCapability{T}"/> for use in test cases.
/// </summary>
public class FakePullRequestSystemCapability : BasePullRequestSystemCapability<FakePullRequestSystem>
/// <param name="log">The Cake log context.</param>
/// <param name="pullRequestSystem">Pull request system to which this capability belongs.</param>
public class FakePullRequestSystemCapability(ICakeLog log, FakePullRequestSystem pullRequestSystem) : BasePullRequestSystemCapability<FakePullRequestSystem>(log, pullRequestSystem)
{
/// <summary>
/// Initializes a new instance of the <see cref="FakePullRequestSystemCapability"/> class.
/// </summary>
/// <param name="log">The Cake log context.</param>
/// <param name="pullRequestSystem">Pull request system to which this capability belongs.</param>
public FakePullRequestSystemCapability(ICakeLog log, FakePullRequestSystem pullRequestSystem)
: base(log, pullRequestSystem)
{
}

/// <summary>
/// Gets the Cake log context.
Expand Down
5 changes: 4 additions & 1 deletion src/Cake.Issues.PullRequests.Tests/IssueFiltererTests.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace Cake.Issues.PullRequests.Tests
{
using System;
using System.Collections.Generic;
using System.Linq;
using Cake.Core.IO;
Expand Down Expand Up @@ -157,7 +158,9 @@ public void Should_Throw_If_Modified_Files_Contain_Absolute_Path()
new Dictionary<IIssue, IssueCommentInfo>()));

// Then
result.IsPullRequestIssuesException(@"Absolute file paths are not supported for modified files. Path: c:/FakeIssueProvider.cs");
result.IsPullRequestIssuesException(
@"Absolute file paths are not supported for modified files:" + Environment.NewLine +
@" c:/FakeIssueProvider.cs");
}

[Fact]
Expand Down
12 changes: 3 additions & 9 deletions src/Cake.Issues.PullRequests/BasePullRequestSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
public abstract class BasePullRequestSystem
: BaseIssueComponent<IReportIssuesToPullRequestSettings>, IPullRequestSystem
{
private readonly List<IPullRequestSystemCapability> capabilities = new ();
private readonly List<IPullRequestSystemCapability> capabilities = [];

/// <summary>
/// Initializes a new instance of the <see cref="BasePullRequestSystem"/> class.
Expand All @@ -31,17 +31,11 @@ public void AddCapability(IPullRequestSystemCapability capability)

/// <inheritdoc/>
public bool HasCapability<T>()
where T : IPullRequestSystemCapability
{
return this.capabilities.Any(x => x is T);
}
where T : IPullRequestSystemCapability => this.capabilities.Exists(x => x is T);

/// <inheritdoc/>
public T GetCapability<T>()
where T : IPullRequestSystemCapability
{
return this.capabilities.OfType<T>().FirstOrDefault();
}
where T : IPullRequestSystemCapability => this.capabilities.OfType<T>().FirstOrDefault();

/// <inheritdoc/>
public void PostDiscussionThreads(IEnumerable<IIssue> issues, string commentSource)
Expand Down
8 changes: 4 additions & 4 deletions src/Cake.Issues.PullRequests/Cake.Issues.PullRequests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<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</Product>
<Copyright>Copyright © BBT Software AG and contributors</Copyright>
Expand All @@ -18,8 +18,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Cake.Core" Version="3.0.0" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.0">
<PackageReference Include="Cake.Core" Version="4.0.0" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
5 changes: 3 additions & 2 deletions src/Cake.Issues.PullRequests/IssueFilterer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,11 @@ private static bool IssueHasMatchingComments(
/// <param name="modifiedFilePaths">List of modified files in the pull request.</param>
private static void ValidateModifiedFiles(IEnumerable<FilePath> modifiedFilePaths)
{
foreach (var filePath in modifiedFilePaths.Where(x => !x.IsRelative))
var absoluteFilePaths = modifiedFilePaths.Where(x => !x.IsRelative).ToList();
if (absoluteFilePaths.Count > 0)
{
throw new PullRequestIssuesException(
$"Absolute file paths are not supported for modified files. Path: {filePath}");
$"Absolute file paths are not supported for modified files:{Environment.NewLine}{string.Join(Environment.NewLine, absoluteFilePaths.Select(x => " " + x))}");
}
}

Expand Down
Loading

0 comments on commit f6e6b2f

Please sign in to comment.