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/3.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalberger committed Jul 13, 2023
2 parents f9929da + 702694a commit e80450b
Show file tree
Hide file tree
Showing 20 changed files with 233 additions and 192 deletions.
7 changes: 3 additions & 4 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ install:
- ps: $env:DOTNET_INSTALL_DIR = "$pwd\.dotnetsdk"
- 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 2.1.818 -InstallDir $env:DOTNET_INSTALL_DIR'
- ps: '& "$($env:DOTNET_INSTALL_DIR)/dotnet-install.ps1" -Version 3.1.414 -InstallDir $env:DOTNET_INSTALL_DIR'
- ps: '& "$($env:DOTNET_INSTALL_DIR)/dotnet-install.ps1" -Version 5.0.402 -InstallDir $env:DOTNET_INSTALL_DIR'
- ps: '& "$($env:DOTNET_INSTALL_DIR)/dotnet-install.ps1" -Version 6.0.100 -InstallDir $env:DOTNET_INSTALL_DIR'
- 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:Path = "$env:DOTNET_INSTALL_DIR;$env:Path"
- ps: dotnet --info

Expand Down
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"cake.tool": {
"version": "0.38.5",
"version": "1.3.0",
"commands": [
"dotnet-cake"
]
Expand Down
18 changes: 6 additions & 12 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,14 @@ updates:
open-pull-requests-limit: 10
ignore:
- dependency-name: Cake.Core
versions:
- "(,3.0)"
update-types: ["version-update:semver-minor"]
- dependency-name: Cake.Testing
versions:
- "(,3.0)"
update-types: ["version-update:semver-minor"]
- dependency-name: Cake.AzureDevOps
versions:
- "> 1.0.0, < 2"
update-types: ["version-update:semver-minor"]
- dependency-name: Cake.Issues
versions:
- "> 1.0.0, < 2"
update-types: ["version-update:semver-minor"]
- dependency-name: Cake.Issues.Testing
versions:
- "> 1.0.0, < 2"
update-types: ["version-update:semver-minor"]
- dependency-name: Cake.Issues.PullRequests
versions:
- "> 1.0.0, < 2"
update-types: ["version-update:semver-minor"]
28 changes: 20 additions & 8 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ jobs:
pool:
vmImage: 'windows-2022'
steps:
# .NET 5 required for GitVersion
- task: UseDotNet@2
inputs:
version: '5.x'
- task: UseDotNet@2
inputs:
version: '6.x'
- task: UseDotNet@2
inputs:
version: '7.x'
- powershell: |
$ENV:CAKE_SKIP_GITVERSION=([string]::IsNullOrEmpty($ENV:SYSTEM_PULLREQUEST_PULLREQUESTID) -eq $False).ToString()
.\build.ps1
Expand All @@ -22,34 +32,36 @@ jobs:
- job: macOS
pool:
vmImage: 'macOS-10.15'
vmImage: 'macOS-11'
steps:
# .NET 5 required for GitVersion
- task: UseDotNet@2
inputs:
version: '6.x'
version: '5.x'
- task: UseDotNet@2
inputs:
version: '5.x'
version: '6.x'
- task: UseDotNet@2
inputs:
version: '3.x'
version: '7.x'
- bash: |
./build.sh
displayName: 'Cake Build'
- job: Ubuntu
pool:
vmImage: 'ubuntu-18.04'
vmImage: 'ubuntu-20.04'
steps:
# .NET 5 required for GitVersion
- task: UseDotNet@2
inputs:
version: '6.x'
version: '5.x'
- task: UseDotNet@2
inputs:
version: '5.x'
version: '6.x'
- task: UseDotNet@2
inputs:
version: '3.x'
version: '7.x'
- 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": "6.0.100",
"version": "7.0.100",
"rollForward": "latestFeature"
}
}
36 changes: 25 additions & 11 deletions recipe.cake
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#load nuget:?package=Cake.Recipe&version=2.2.1
#load nuget:?package=Cake.Recipe&version=3.0.0

//*************************************************************************************************
// Settings
//*************************************************************************************************

Environment.SetVariableNames();

Expand All @@ -10,27 +14,37 @@ BuildParameters.SetParameters(
repositoryOwner: "cake-contrib",
repositoryName: "Cake.Issues.PullRequests.AzureDevOps",
appVeyorAccountName: "cakecontrib",
shouldRunCoveralls: false, // Disabled because it's currently failing
shouldGenerateDocumentation: false,
shouldCalculateVersion: true,
shouldRunDupFinder: false, // dupFinder is missing in 2021.3.0-eap
shouldRunCodecov: false,
shouldRunDotNetCorePack: true);

BuildParameters.PrintParameters(Context);

ToolSettings.SetToolSettings(
context: Context,
dupFinderExcludePattern: new string[] { BuildParameters.RootDirectoryPath + "/src/Cake.Issues.PullRequests.AzureDevOps.Tests/Capabilities/*.cs" },
testCoverageFilter: "+[*]* -[xunit.*]* -[Cake.Core]* -[Cake.Common]* -[Cake.Testing]* -[*.Tests]* -[Cake.Issues]* -[Cake.Issues.Testing]* -[Cake.Issues.PullRequests]* -[Cake.AzureDevOps]* -[Shouldly]* -[DiffEngine]* -[EmptyFiles]*",
testCoverageExcludeByAttribute: "*.ExcludeFromCodeCoverage*",
testCoverageExcludeByFile: "*/*Designer.cs;*/*.g.cs;*/*.g.i.cs");

// Workaround until https://github.com/cake-contrib/Cake.Recipe/issues/862 has been fixed in Cake.Recipe
ToolSettings.SetToolPreprocessorDirectives(
reSharperTools: "#tool nuget:?package=JetBrains.ReSharper.CommandLineTools&version=2021.3.1",
gitVersionGlobalTool: "#tool dotnet:?package=GitVersion.Tool&version=5.8.1");
//*************************************************************************************************
// Custom tasks
//*************************************************************************************************

Task("BreakBuildOnIssues")
.Description("Breaks build if any issues in the code are found.")
.Does<IssuesData>((data) =>
{
if (data.Issues.Any())
{
throw new Exception("Issues found in code.");
}
});

IssuesBuildTasks.IssuesTask
.IsDependentOn("BreakBuildOnIssues");

// Disable Upload-Coveralls-Report task since it fails to install the tool on AppVeyor
BuildParameters.Tasks.UploadCoverallsReportTask.WithCriteria(() => false);
//*************************************************************************************************
// Execution
//*************************************************************************************************

Build.RunDotNetCore();
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Cake.Issues.Testing;
using Xunit;

// ReSharper disable once ClassNeverInstantiated.Global
public sealed class AzureDevOpsPullRequestSystemSettingsTests
{
public sealed class TheCtor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Cake.Testing;
using Xunit;

// ReSharper disable once ClassNeverInstantiated.Global
public sealed class AzureDevOpsPullRequestSystemTests
{
public sealed class TheCtor
Expand All @@ -15,7 +16,7 @@ public sealed class TheCtor
public void Should_Throw_If_Log_Is_Null()
{
// Given
ICakeLog log = null;
const ICakeLog log = null;
var settings =
new AzureDevOpsPullRequestSystemSettings(
new Uri("https://google.com"),
Expand All @@ -34,7 +35,7 @@ public void Should_Throw_If_Settings_Are_Null()
{
// Given
var log = new FakeLog();
AzureDevOpsPullRequestSystemSettings settings = null;
const AzureDevOpsPullRequestSystemSettings settings = null;

// When
var result = Record.Exception(() => new AzureDevOpsPullRequestSystem(log, settings));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.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="2.0.0" />
<PackageReference Include="Cake.Issues.PullRequests" Version="2.0.0" />
<PackageReference Include="Cake.Issues.Testing" Version="2.0.0" />
<PackageReference Include="Cake.Testing" Version="2.0.0" />
<PackageReference Include="Cake.AzureDevOps" Version="2.0.0-beta0001" />
<PackageReference Include="NSubstitute" Version="4.3.0" />
<PackageReference Include="Shouldly" Version="4.0.3" />
<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="StyleCop.Analyzers" Version="1.1.118" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />
<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" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using NSubstitute;
using Xunit;

// ReSharper disable once ClassNeverInstantiated.Global
public sealed class AzureDevOpsCheckingCommitIdCapabilityTests
{
public sealed class TheCtor
Expand All @@ -15,7 +16,7 @@ public sealed class TheCtor
public void Should_Throw_If_Log_Is_Null()
{
// Given
ICakeLog log = null;
const ICakeLog log = null;
var pullRequestSystem = Substitute.For<IAzureDevOpsPullRequestSystem>();

// When
Expand All @@ -30,7 +31,7 @@ public void Should_Throw_If_PullRequestSystem_Is_Null()
{
// Given
var log = new FakeLog();
AzureDevOpsPullRequestSystem pullRequestSystem = null;
const AzureDevOpsPullRequestSystem pullRequestSystem = null;

// When
var result = Record.Exception(() => new AzureDevOpsCheckingCommitIdCapability(log, pullRequestSystem));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using NSubstitute;
using Xunit;

// ReSharper disable once ClassNeverInstantiated.Global
public sealed class AzureDevOpsDiscussionThreadsCapabilityTests
{
public sealed class TheCtor
Expand All @@ -15,7 +16,7 @@ public sealed class TheCtor
public void Should_Throw_If_Log_Is_Null()
{
// Given
ICakeLog log = null;
const ICakeLog log = null;
var pullRequestSystem = Substitute.For<IAzureDevOpsPullRequestSystem>();

// When
Expand All @@ -30,7 +31,7 @@ public void Should_Throw_If_PullRequestSystem_Is_Null()
{
// Given
var log = new FakeLog();
AzureDevOpsPullRequestSystem pullRequestSystem = null;
const AzureDevOpsPullRequestSystem pullRequestSystem = null;

// When
var result = Record.Exception(() => new AzureDevOpsDiscussionThreadsCapability(log, pullRequestSystem));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using NSubstitute;
using Xunit;

// ReSharper disable once ClassNeverInstantiated.Global
public sealed class AzureDevOpsFilteringByModifiedFilesCapabilityTests
{
public sealed class TheCtor
Expand All @@ -15,7 +16,7 @@ public sealed class TheCtor
public void Should_Throw_If_Log_Is_Null()
{
// Given
ICakeLog log = null;
const ICakeLog log = null;
var pullRequestSystem = Substitute.For<IAzureDevOpsPullRequestSystem>();

// When
Expand All @@ -30,7 +31,7 @@ public void Should_Throw_If_PullRequestSystem_Is_Null()
{
// Given
var log = new FakeLog();
AzureDevOpsPullRequestSystem pullRequestSystem = null;
const AzureDevOpsPullRequestSystem pullRequestSystem = null;

// When
var result = Record.Exception(() => new AzureDevOpsFilteringByModifiedFilesCapability(log, pullRequestSystem));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Shouldly;
using Xunit;

// ReSharper disable once ClassNeverInstantiated.Global
public sealed class CommentExtensionsTests
{
public sealed class TheToPullRequestDiscussionCommentExtension
Expand All @@ -14,7 +15,7 @@ public sealed class TheToPullRequestDiscussionCommentExtension
public void Should_Throw_If_Comment_Is_Null()
{
// Given
AzureDevOpsComment comment = null;
const AzureDevOpsComment comment = null;

// When
var result = Record.Exception(() => comment.ToPullRequestDiscussionComment());
Expand All @@ -27,7 +28,7 @@ public void Should_Throw_If_Comment_Is_Null()
public void Should_Set_Correct_Content()
{
// Given
var content = "foo";
const string content = "foo";
var comment =
new AzureDevOpsComment
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Shouldly;
using Xunit;

// ReSharper disable once ClassNeverInstantiated.Global
public sealed class CommentThreadStatusExtensionsTests
{
public sealed class TheToPullRequestDiscussionStatusExtension
Expand Down
Loading

0 comments on commit e80450b

Please sign in to comment.