From dc3d118b008cb339fc149886e9b1bfb5dac6ea88 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Fri, 13 Oct 2023 15:54:07 +0200
Subject: [PATCH 01/18] Update xunit-dotnet monorepo (#438)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj b/src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj
index 07bdd4d..d04c318 100644
--- a/src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj
+++ b/src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj
@@ -22,8 +22,8 @@
-
-
+
+
From 03fbc14594d484b7ecab305509a41d8ee6558f3d Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Mon, 16 Oct 2023 22:39:59 +0000
Subject: [PATCH 02/18] Update dependency xunit to v2.5.3 (#439)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj b/src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj
index d04c318..e13f8b3 100644
--- a/src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj
+++ b/src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj
@@ -22,7 +22,7 @@
-
+
From bafab21b788461b7ae67ccdcb9f65a47188c7dbb Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Thu, 26 Oct 2023 20:13:36 +0000
Subject: [PATCH 03/18] Update dependency dotnet-sdk to v7.0.403 (#440)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Pascal Berger
---
.appveyor.yml | 4 ++--
global.json | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.appveyor.yml b/.appveyor.yml
index 9a65094..428f713 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -11,8 +11,8 @@ 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.415 -InstallDir $env:DOTNET_INSTALL_DIR'
- - ps: '& "$($env:DOTNET_INSTALL_DIR)/dotnet-install.ps1" -Version 7.0.402 -InstallDir $env:DOTNET_INSTALL_DIR'
+ - ps: '& "$($env:DOTNET_INSTALL_DIR)/dotnet-install.ps1" -Version 6.0.416 -InstallDir $env:DOTNET_INSTALL_DIR'
+ - ps: '& "$($env:DOTNET_INSTALL_DIR)/dotnet-install.ps1" -Version 7.0.403 -InstallDir $env:DOTNET_INSTALL_DIR'
- ps: $env:Path = "$env:DOTNET_INSTALL_DIR;$env:Path"
- ps: dotnet --info
diff --git a/global.json b/global.json
index e00ab7a..51b7b3c 100644
--- a/global.json
+++ b/global.json
@@ -1,7 +1,7 @@
{
"sdk": {
"allowPrerelease": true,
- "version": "7.0.402",
+ "version": "7.0.403",
"rollForward": "latestFeature"
}
}
\ No newline at end of file
From 0a055eeab5863a181cd770ecb2b34000c85c4c52 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Wed, 1 Nov 2023 07:48:59 +0100
Subject: [PATCH 04/18] Update dependency xunit to v2.6.0 (#441)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj b/src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj
index e13f8b3..7d632d4 100644
--- a/src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj
+++ b/src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj
@@ -22,7 +22,7 @@
-
+
From a30ed9e4d5490d1e0b74596e7d650de05ed14284 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Thu, 2 Nov 2023 22:19:09 +0100
Subject: [PATCH 05/18] Update dependency xunit to v2.6.1 (#442)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj b/src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj
index 7d632d4..78f344d 100644
--- a/src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj
+++ b/src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj
@@ -22,7 +22,7 @@
-
+
From cd91a6af8dd08e94e3c4962f5985ba554d9c9ac2 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Wed, 8 Nov 2023 21:20:14 +0100
Subject: [PATCH 06/18] Update dependency Microsoft.NET.Test.Sdk to v17.8.0
(#443)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj b/src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj
index 78f344d..d62443b 100644
--- a/src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj
+++ b/src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj
@@ -14,7 +14,7 @@
-
+
From a137736334b3220a2bd93434660be55a1742dcba Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Fri, 17 Nov 2023 20:30:19 +0100
Subject: [PATCH 07/18] Update dependency Microsoft.CodeAnalysis.NetAnalyzers
to v8 (#446)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
src/Cake.AzureDevOps/Cake.AzureDevOps.csproj | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Cake.AzureDevOps/Cake.AzureDevOps.csproj b/src/Cake.AzureDevOps/Cake.AzureDevOps.csproj
index a9d87b9..616adbe 100644
--- a/src/Cake.AzureDevOps/Cake.AzureDevOps.csproj
+++ b/src/Cake.AzureDevOps/Cake.AzureDevOps.csproj
@@ -36,7 +36,7 @@
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
From 497afb65245f83adb07dd985ab252696e27867bb Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Sun, 19 Nov 2023 20:19:58 +0100
Subject: [PATCH 08/18] Update xunit-dotnet monorepo (#447)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj b/src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj
index d62443b..37a1ea3 100644
--- a/src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj
+++ b/src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj
@@ -22,8 +22,8 @@
-
-
+
+
From b4ddd368a58d852f61d7cbf8a7c87db3b1eb0514 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Sun, 19 Nov 2023 20:30:12 +0000
Subject: [PATCH 09/18] Update dependency dotnet-sdk to v7.0.404 (#445)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Pascal Berger
---
.appveyor.yml | 4 ++--
global.json | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.appveyor.yml b/.appveyor.yml
index 428f713..569631b 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -11,8 +11,8 @@ 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.416 -InstallDir $env:DOTNET_INSTALL_DIR'
- - ps: '& "$($env:DOTNET_INSTALL_DIR)/dotnet-install.ps1" -Version 7.0.403 -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:Path = "$env:DOTNET_INSTALL_DIR;$env:Path"
- ps: dotnet --info
diff --git a/global.json b/global.json
index 51b7b3c..110572a 100644
--- a/global.json
+++ b/global.json
@@ -1,7 +1,7 @@
{
"sdk": {
"allowPrerelease": true,
- "version": "7.0.403",
+ "version": "7.0.404",
"rollForward": "latestFeature"
}
}
\ No newline at end of file
From b4a121cdf9348f3451fb95cbbb40061a8e73f4c9 Mon Sep 17 00:00:00 2001
From: Pascal Berger
Date: Sun, 26 Nov 2023 16:46:40 +0100
Subject: [PATCH 10/18] Enable Renovate for test projects (#451)
---
.github/renovate.json | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/.github/renovate.json b/.github/renovate.json
index c715c78..2aa46b6 100644
--- a/.github/renovate.json
+++ b/.github/renovate.json
@@ -1,7 +1,8 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
- "github>cake-contrib/renovate-presets:cake-recipe"
+ "github>cake-contrib/renovate-presets:cake-recipe",
+ ":includeNodeModules"
],
"packageRules": [
{
From 88df0d5164b5a5226602f7a38c77a173b6b507aa Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Sun, 26 Nov 2023 17:17:53 +0100
Subject: [PATCH 11/18] Update cake monorepo to v4 (#448)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj | 6 +++---
src/Cake.AzureDevOps/Cake.AzureDevOps.csproj | 4 ++--
tests/frosting/net6.0/build/Build.csproj | 2 +-
tests/frosting/net7.0/build/Build.csproj | 2 +-
tests/script-runner/net6.0/.config/dotnet-tools.json | 2 +-
tests/script-runner/net7.0/.config/dotnet-tools.json | 2 +-
6 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj b/src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj
index 37a1ea3..5027584 100644
--- a/src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj
+++ b/src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj
@@ -15,9 +15,9 @@
-
-
-
+
+
+
diff --git a/src/Cake.AzureDevOps/Cake.AzureDevOps.csproj b/src/Cake.AzureDevOps/Cake.AzureDevOps.csproj
index 616adbe..362cbcb 100644
--- a/src/Cake.AzureDevOps/Cake.AzureDevOps.csproj
+++ b/src/Cake.AzureDevOps/Cake.AzureDevOps.csproj
@@ -34,8 +34,8 @@
-
-
+
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/tests/frosting/net6.0/build/Build.csproj b/tests/frosting/net6.0/build/Build.csproj
index c305f1a..6314969 100644
--- a/tests/frosting/net6.0/build/Build.csproj
+++ b/tests/frosting/net6.0/build/Build.csproj
@@ -5,7 +5,7 @@
$(MSBuildProjectDirectory)
-
+
\ No newline at end of file
diff --git a/tests/frosting/net7.0/build/Build.csproj b/tests/frosting/net7.0/build/Build.csproj
index 55f31cb..939e0eb 100644
--- a/tests/frosting/net7.0/build/Build.csproj
+++ b/tests/frosting/net7.0/build/Build.csproj
@@ -5,7 +5,7 @@
$(MSBuildProjectDirectory)
-
+
\ No newline at end of file
diff --git a/tests/script-runner/net6.0/.config/dotnet-tools.json b/tests/script-runner/net6.0/.config/dotnet-tools.json
index a37608c..7b34695 100644
--- a/tests/script-runner/net6.0/.config/dotnet-tools.json
+++ b/tests/script-runner/net6.0/.config/dotnet-tools.json
@@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"cake.tool": {
- "version": "3.0.0",
+ "version": "4.0.0",
"commands": [
"dotnet-cake"
]
diff --git a/tests/script-runner/net7.0/.config/dotnet-tools.json b/tests/script-runner/net7.0/.config/dotnet-tools.json
index a37608c..7b34695 100644
--- a/tests/script-runner/net7.0/.config/dotnet-tools.json
+++ b/tests/script-runner/net7.0/.config/dotnet-tools.json
@@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"cake.tool": {
- "version": "3.0.0",
+ "version": "4.0.0",
"commands": [
"dotnet-cake"
]
From b69b5865d80937989830dd3855e7630cd3a24a0d Mon Sep 17 00:00:00 2001
From: Pascal Berger
Date: Sun, 26 Nov 2023 20:29:09 +0100
Subject: [PATCH 12/18] Multi-Target .NET 8 (#455)
---
.appveyor.yml | 1 +
azure-pipelines.yml | 215 +++++++++++++++++-
global.json | 2 +-
.../Cake.AzureDevOps.Tests.csproj | 2 +-
.../FakeNullForMethodsGitClientFactory.cs | 2 +-
...zureDevOpsPullRequestCommentThreadTests.cs | 8 +-
.../PullRequest/CreatePullRequestFixture.cs | 11 +-
.../AzureDevOpsAadCredentials.cs | 13 +-
.../AzureDevOpsBasicCredentials.cs | 18 +-
src/Cake.AzureDevOps/AzureDevOpsException.cs | 12 -
.../AzureDevOpsWorkItemException.cs | 13 --
.../AzureDevOpsWorkItemNotFoundException.cs | 13 --
src/Cake.AzureDevOps/BuildClientFactory.cs | 7 +-
src/Cake.AzureDevOps/Cake.AzureDevOps.csproj | 2 +-
src/Cake.AzureDevOps/GitClientFactory.cs | 7 +-
.../AzureDevOpsBuildNotFoundException.cs | 13 --
.../AzureDevOpsBranchNotFoundException.cs | 13 --
.../PullRequest/AzureDevOpsPullRequest.cs | 48 +---
...AzureDevOpsPullRequestNotFoundException.cs | 13 --
.../TestManagementClientFactory.cs | 7 +-
.../WorkItemTrackingClientFactory.cs | 7 +-
tests/frosting/net8.0/build.ps1 | 13 ++
tests/frosting/net8.0/build.sh | 10 +
tests/frosting/net8.0/build/Build.csproj | 11 +
tests/frosting/net8.0/build/Program.cs | 157 +++++++++++++
tests/frosting/net8.0/global.json | 7 +
tests/frosting/net8.0/nuget.config | 14 ++
.../net8.0/.config/dotnet-tools.json | 12 +
tests/script-runner/net8.0/build.cake | 120 ++++++++++
tests/script-runner/net8.0/build.ps1 | 15 ++
tests/script-runner/net8.0/build.sh | 11 +
tests/script-runner/net8.0/global.json | 7 +
tests/script-runner/net8.0/nuget.config | 11 +
33 files changed, 626 insertions(+), 189 deletions(-)
create mode 100644 tests/frosting/net8.0/build.ps1
create mode 100755 tests/frosting/net8.0/build.sh
create mode 100644 tests/frosting/net8.0/build/Build.csproj
create mode 100644 tests/frosting/net8.0/build/Program.cs
create mode 100644 tests/frosting/net8.0/global.json
create mode 100644 tests/frosting/net8.0/nuget.config
create mode 100644 tests/script-runner/net8.0/.config/dotnet-tools.json
create mode 100644 tests/script-runner/net8.0/build.cake
create mode 100644 tests/script-runner/net8.0/build.ps1
create mode 100755 tests/script-runner/net8.0/build.sh
create mode 100644 tests/script-runner/net8.0/global.json
create mode 100644 tests/script-runner/net8.0/nuget.config
diff --git a/.appveyor.yml b/.appveyor.yml
index 569631b..a8b1255 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -13,6 +13,7 @@ install:
- 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.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
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index 8d2db58..2e53f36 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -16,16 +16,23 @@ jobs:
pool:
vmImage: 'windows-2022'
steps:
+ # .NET 5 required for GitVersion
- task: UseDotNet@2
inputs:
- version: '7.x'
+ version: '5.x'
+ displayName: 'Install .NET 5'
- task: UseDotNet@2
inputs:
version: '6.x'
- # .NET 5 required for GitVersion
+ displayName: 'Install .NET 6'
- task: UseDotNet@2
inputs:
- version: '5.x'
+ 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
@@ -41,16 +48,23 @@ jobs:
pool:
vmImage: 'macOS-11'
steps:
+ # .NET 5 required for GitVersion
- task: UseDotNet@2
inputs:
- version: '7.x'
+ version: '5.x'
+ displayName: 'Install .NET 5'
- task: UseDotNet@2
inputs:
version: '6.x'
- # .NET 5 required for GitVersion
+ displayName: 'Install .NET 6'
- task: UseDotNet@2
inputs:
- version: '5.x'
+ version: '7.x'
+ displayName: 'Install .NET 7'
+ - task: UseDotNet@2
+ inputs:
+ version: '8.x'
+ displayName: 'Install .NET 8'
- bash: |
./build.sh
displayName: 'Cake Build'
@@ -64,16 +78,23 @@ jobs:
pool:
vmImage: 'ubuntu-20.04'
steps:
+ # .NET 5 required for GitVersion
- task: UseDotNet@2
inputs:
- version: '7.x'
+ version: '5.x'
+ displayName: 'Install .NET 5'
- task: UseDotNet@2
inputs:
version: '6.x'
- # .NET 5 required for GitVersion
+ displayName: 'Install .NET 6'
- task: UseDotNet@2
inputs:
- version: '5.x'
+ 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'
@@ -82,7 +103,7 @@ jobs:
displayName: 'Publish NuGet package as build artifact'
# Integration Tests Frosting Windows (.NET 6)
-- job: Test_Frosting_Windows_Net5
+- job: Test_Frosting_Windows_Net6
displayName: Integration Tests Frosting Windows (.NET 6)
dependsOn: Build_Windows
pool:
@@ -96,6 +117,10 @@ jobs:
sourceFolder: $(Pipeline.Workspace)/NuGet Package Windows
targetFolder: $(Build.SourcesDirectory)/BuildArtifacts/Packages/NuGet
displayName: 'Copy build artifact for test run'
+ - task: UseDotNet@2
+ inputs:
+ version: '6.x'
+ displayName: 'Install .NET 6'
- powershell: ./build.ps1 --verbosity=diagnostic
workingDirectory: ./tests/frosting/net6.0
displayName: 'Run integration tests'
@@ -117,12 +142,41 @@ jobs:
sourceFolder: $(Pipeline.Workspace)/NuGet Package Windows
targetFolder: $(Build.SourcesDirectory)/BuildArtifacts/Packages/NuGet
displayName: 'Copy build artifact for test run'
+ - task: UseDotNet@2
+ inputs:
+ version: '7.x'
+ displayName: 'Install .NET 7'
- powershell: ./build.ps1 --verbosity=diagnostic
workingDirectory: ./tests/frosting/net7.0
displayName: 'Run integration tests'
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
+# Integration Tests Frosting Windows (.NET 8)
+- job: Test_Frosting_Windows_Net8
+ displayName: Integration Tests Frosting Windows (.NET 8)
+ dependsOn: Build_Windows
+ pool:
+ vmImage: 'windows-2022'
+ steps:
+ - download: current
+ artifact: NuGet Package Windows
+ displayName: 'Download build artifact'
+ - task: CopyFiles@2
+ inputs:
+ sourceFolder: $(Pipeline.Workspace)/NuGet Package Windows
+ targetFolder: $(Build.SourcesDirectory)/BuildArtifacts/Packages/NuGet
+ displayName: 'Copy build artifact for test run'
+ - task: UseDotNet@2
+ inputs:
+ version: '8.x'
+ displayName: 'Install .NET 8'
+ - powershell: ./build.ps1 --verbosity=diagnostic
+ workingDirectory: ./tests/frosting/net8.0
+ displayName: 'Run integration tests'
+ env:
+ SYSTEM_ACCESSTOKEN: $(System.AccessToken)
+
# Integration Tests Script Runner Windows (.NET 6)
- job: Test_Script_Runner_Windows_Net6
displayName: Integration Tests Script Runner Windows (.NET 6)
@@ -138,6 +192,10 @@ jobs:
sourceFolder: $(Pipeline.Workspace)/NuGet Package Windows
targetFolder: $(Build.SourcesDirectory)/BuildArtifacts/Packages/NuGet
displayName: 'Copy build artifact for test run'
+ - task: UseDotNet@2
+ inputs:
+ version: '6.x'
+ displayName: 'Install .NET 6'
- powershell: ./build.ps1 --verbosity=diagnostic
workingDirectory: ./tests/script-runner/net6.0
displayName: 'Run integration tests'
@@ -159,12 +217,41 @@ jobs:
sourceFolder: $(Pipeline.Workspace)/NuGet Package Windows
targetFolder: $(Build.SourcesDirectory)/BuildArtifacts/Packages/NuGet
displayName: 'Copy build artifact for test run'
+ - task: UseDotNet@2
+ inputs:
+ version: '7.x'
+ displayName: 'Install .NET 7'
- powershell: ./build.ps1 --verbosity=diagnostic
workingDirectory: ./tests/script-runner/net7.0
displayName: 'Run integration tests'
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
+# Integration Tests Script Runner Windows (.NET 8)
+- job: Test_Script_Runner_Windows_Net8
+ displayName: Integration Tests Script Runner Windows (.NET 8)
+ dependsOn: Build_Windows
+ pool:
+ vmImage: 'windows-2022'
+ steps:
+ - download: current
+ artifact: NuGet Package Windows
+ displayName: 'Download build artifact'
+ - task: CopyFiles@2
+ inputs:
+ sourceFolder: $(Pipeline.Workspace)/NuGet Package Windows
+ targetFolder: $(Build.SourcesDirectory)/BuildArtifacts/Packages/NuGet
+ displayName: 'Copy build artifact for test run'
+ - task: UseDotNet@2
+ inputs:
+ version: '8.x'
+ displayName: 'Install .NET 8'
+ - powershell: ./build.ps1 --verbosity=diagnostic
+ workingDirectory: ./tests/script-runner/net8.0
+ displayName: 'Run integration tests'
+ env:
+ SYSTEM_ACCESSTOKEN: $(System.AccessToken)
+
# Integration Tests Frosting macOS (.NET 6)
- job: Test_Frosting_macOS_Net6
displayName: Integration Tests Frosting macOS (.NET 6)
@@ -183,6 +270,7 @@ jobs:
- task: UseDotNet@2
inputs:
version: '6.x'
+ displayName: 'Install .NET 6'
- bash: ./build.sh --verbosity=diagnostic
workingDirectory: ./tests/frosting/net6.0
displayName: 'Run integration tests'
@@ -207,12 +295,38 @@ jobs:
- task: UseDotNet@2
inputs:
version: '7.x'
+ displayName: 'Install .NET 7'
- bash: ./build.sh --verbosity=diagnostic
workingDirectory: ./tests/frosting/net7.0
displayName: 'Run integration tests'
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
+# Integration Tests Frosting macOS (.NET 8)
+- job: Test_Frosting_macOS_Net8
+ displayName: Integration Tests Frosting macOS (.NET 8)
+ dependsOn: Build_macOS
+ pool:
+ vmImage: 'macOS-11'
+ steps:
+ - download: current
+ artifact: NuGet Package macOS
+ displayName: 'Download build artifact'
+ - task: CopyFiles@2
+ inputs:
+ sourceFolder: $(Pipeline.Workspace)/NuGet Package macOS
+ targetFolder: $(Build.SourcesDirectory)/BuildArtifacts/Packages/NuGet
+ displayName: 'Copy build artifact for test run'
+ - task: UseDotNet@2
+ inputs:
+ version: '8.x'
+ displayName: 'Install .NET 8'
+ - bash: ./build.sh --verbosity=diagnostic
+ workingDirectory: ./tests/frosting/net8.0
+ displayName: 'Run integration tests'
+ env:
+ SYSTEM_ACCESSTOKEN: $(System.AccessToken)
+
# Integration Tests Script Runner macOS (.NET 6)
- job: Test_Script_Runner_macOS_Net6
displayName: Integration Tests Script Runner macOS (.NET 6)
@@ -231,6 +345,7 @@ jobs:
- task: UseDotNet@2
inputs:
version: '6.x'
+ displayName: 'Install .NET 6'
- bash: ./build.sh --verbosity=diagnostic
workingDirectory: ./tests/script-runner/net6.0
displayName: 'Run integration tests'
@@ -255,12 +370,38 @@ jobs:
- task: UseDotNet@2
inputs:
version: '7.x'
+ displayName: 'Install .NET 7'
- bash: ./build.sh --verbosity=diagnostic
workingDirectory: ./tests/script-runner/net7.0
displayName: 'Run integration tests'
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
+# Integration Tests Script Runner macOS (.NET 8)
+- job: Test_Script_Runner_macOS_Net8
+ displayName: Integration Tests Script Runner macOS (.NET 8)
+ dependsOn: Build_macOS
+ pool:
+ vmImage: 'macOS-11'
+ steps:
+ - download: current
+ artifact: NuGet Package macOS
+ displayName: 'Download build artifact'
+ - task: CopyFiles@2
+ inputs:
+ sourceFolder: $(Pipeline.Workspace)/NuGet Package macOS
+ targetFolder: $(Build.SourcesDirectory)/BuildArtifacts/Packages/NuGet
+ displayName: 'Copy build artifact for test run'
+ - task: UseDotNet@2
+ inputs:
+ version: '8.x'
+ displayName: 'Install .NET 8'
+ - bash: ./build.sh --verbosity=diagnostic
+ workingDirectory: ./tests/script-runner/net8.0
+ displayName: 'Run integration tests'
+ env:
+ SYSTEM_ACCESSTOKEN: $(System.AccessToken)
+
# Integration Tests Frosting Ubuntu (.NET 6)
- job: Test_Frosting_Ubuntu_Net6
displayName: Integration Tests Frosting Ubuntu (.NET 6)
@@ -279,6 +420,7 @@ jobs:
- task: UseDotNet@2
inputs:
version: '6.x'
+ displayName: 'Install .NET 6'
- bash: ./build.sh --verbosity=diagnostic
workingDirectory: ./tests/frosting/net6.0
displayName: 'Run integration tests'
@@ -303,12 +445,38 @@ jobs:
- task: UseDotNet@2
inputs:
version: '7.x'
+ displayName: 'Install .NET 7'
- bash: ./build.sh --verbosity=diagnostic
workingDirectory: ./tests/frosting/net7.0
displayName: 'Run integration tests'
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
+# Integration Tests Frosting Ubuntu (.NET 8)
+- job: Test_Frosting_Ubuntu_Net8
+ displayName: Integration Tests Frosting Ubuntu (.NET 8)
+ dependsOn: Build_Ubuntu
+ pool:
+ vmImage: 'ubuntu-20.04'
+ steps:
+ - download: current
+ artifact: NuGet Package Ubuntu
+ displayName: 'Download build artifact'
+ - task: CopyFiles@2
+ inputs:
+ sourceFolder: $(Pipeline.Workspace)/NuGet Package Ubuntu
+ targetFolder: $(Build.SourcesDirectory)/BuildArtifacts/Packages/NuGet
+ displayName: 'Copy build artifact for test run'
+ - task: UseDotNet@2
+ inputs:
+ version: '8.x'
+ displayName: 'Install .NET 8'
+ - bash: ./build.sh --verbosity=diagnostic
+ workingDirectory: ./tests/frosting/net8.0
+ displayName: 'Run integration tests'
+ env:
+ SYSTEM_ACCESSTOKEN: $(System.AccessToken)
+
# Integration Tests Script Runner Ubuntu (.NET 6)
- job: Test_Script_Runner_Ubuntu_Net6
displayName: Integration Tests Script Runner Ubuntu (.NET 6)
@@ -327,6 +495,7 @@ jobs:
- task: UseDotNet@2
inputs:
version: '6.x'
+ displayName: 'Install .NET 6'
- bash: ./build.sh --verbosity=diagnostic
workingDirectory: ./tests/script-runner/net6.0
displayName: 'Run integration tests'
@@ -351,8 +520,34 @@ jobs:
- task: UseDotNet@2
inputs:
version: '7.x'
+ displayName: 'Install .NET 7'
- bash: ./build.sh --verbosity=diagnostic
workingDirectory: ./tests/script-runner/net7.0
displayName: 'Run integration tests'
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
+
+# Integration Tests Script Runner Ubuntu (.NET 8)
+- job: Test_Script_Runner_Ubuntu_Net8
+ displayName: Integration Tests Script Runner Ubuntu (.NET 8)
+ dependsOn: Build_Ubuntu
+ pool:
+ vmImage: 'ubuntu-20.04'
+ steps:
+ - download: current
+ artifact: NuGet Package Ubuntu
+ displayName: 'Download build artifact'
+ - task: CopyFiles@2
+ inputs:
+ sourceFolder: $(Pipeline.Workspace)/NuGet Package Ubuntu
+ targetFolder: $(Build.SourcesDirectory)/BuildArtifacts/Packages/NuGet
+ displayName: 'Copy build artifact for test run'
+ - task: UseDotNet@2
+ inputs:
+ version: '8.x'
+ displayName: 'Install .NET 8'
+ - bash: ./build.sh --verbosity=diagnostic
+ workingDirectory: ./tests/script-runner/net8.0
+ displayName: 'Run integration tests'
+ env:
+ SYSTEM_ACCESSTOKEN: $(System.AccessToken)
diff --git a/global.json b/global.json
index 110572a..3660ff8 100644
--- a/global.json
+++ b/global.json
@@ -1,7 +1,7 @@
{
"sdk": {
"allowPrerelease": true,
- "version": "7.0.404",
+ "version": "8.0.100",
"rollForward": "latestFeature"
}
}
\ No newline at end of file
diff --git a/src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj b/src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj
index 5027584..ddbdb76 100644
--- a/src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj
+++ b/src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj
@@ -1,7 +1,7 @@
- net6.0;net7.0
+ net6.0;net7.0;net8.0
false
Cake.AzureDevOps
Copyright © Pascal Berger
diff --git a/src/Cake.AzureDevOps.Tests/Fakes/FakeNullForMethodsGitClientFactory.cs b/src/Cake.AzureDevOps.Tests/Fakes/FakeNullForMethodsGitClientFactory.cs
index d68101d..5b010d2 100644
--- a/src/Cake.AzureDevOps.Tests/Fakes/FakeNullForMethodsGitClientFactory.cs
+++ b/src/Cake.AzureDevOps.Tests/Fakes/FakeNullForMethodsGitClientFactory.cs
@@ -18,7 +18,7 @@ protected override Mock Setup(Mock m)
m.Setup(arg => arg.GetCommitDiffsAsync(It.IsAny(), It.IsAny(), true, null, null, It.IsAny(), It.IsAny(), null, CancellationToken.None))
.ReturnsAsync(()
- => new GitCommitDiffs { ChangeCounts = new Dictionary(), Changes = new List() });
+ => new GitCommitDiffs { ChangeCounts = [], Changes = new List() });
m.Setup(arg => arg.UpdateThreadAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), null, CancellationToken.None))
.ReturnsAsync(() => null);
diff --git a/src/Cake.AzureDevOps.Tests/Repos/PullRequest/CommentThread/AzureDevOpsPullRequestCommentThreadTests.cs b/src/Cake.AzureDevOps.Tests/Repos/PullRequest/CommentThread/AzureDevOpsPullRequestCommentThreadTests.cs
index bdfab0a..ca05eaf 100644
--- a/src/Cake.AzureDevOps.Tests/Repos/PullRequest/CommentThread/AzureDevOpsPullRequestCommentThreadTests.cs
+++ b/src/Cake.AzureDevOps.Tests/Repos/PullRequest/CommentThread/AzureDevOpsPullRequestCommentThreadTests.cs
@@ -51,7 +51,7 @@ public void Should_Return_Valid_Comment_Thread()
Status = CommentThreadStatus.Pending,
ThreadContext = new CommentThreadContext { FilePath = "/src/myclass.cs" },
Comments = new List { new () { Content = "Hello", CommentType = CommentType.Text, IsDeleted = false } },
- Properties = new PropertiesCollection(),
+ Properties = [],
};
// When
@@ -215,7 +215,7 @@ public void Should_Set_Collection_With_Single_Element()
{
Id = 16,
Status = CommentThreadStatus.Active,
- Properties = new PropertiesCollection(),
+ Properties = [],
};
// When
@@ -294,7 +294,7 @@ public void Should_Return_Default_Value_If_Property_Does_Not_Exist_For_String_Va
{
Id = 42,
Status = CommentThreadStatus.Active,
- Properties = new PropertiesCollection(),
+ Properties = [],
});
// When
@@ -313,7 +313,7 @@ public void Should_Return_Default_Value_If_Property_Does_Not_Exist_For_Int_Value
{
Id = 42,
Status = CommentThreadStatus.Active,
- Properties = new PropertiesCollection(),
+ Properties = [],
});
// When
diff --git a/src/Cake.AzureDevOps.Tests/Repos/PullRequest/CreatePullRequestFixture.cs b/src/Cake.AzureDevOps.Tests/Repos/PullRequest/CreatePullRequestFixture.cs
index 5bb25ef..1e32c2d 100644
--- a/src/Cake.AzureDevOps.Tests/Repos/PullRequest/CreatePullRequestFixture.cs
+++ b/src/Cake.AzureDevOps.Tests/Repos/PullRequest/CreatePullRequestFixture.cs
@@ -4,12 +4,10 @@
using Cake.AzureDevOps.Authentication;
using Cake.AzureDevOps.Repos.PullRequest;
- internal class CreatePullRequestFixture
- : BasePullRequestFixture
+ internal class CreatePullRequestFixture(string repoUrl, string sourceRefName, string targetRefName, string title, string description)
+ : BasePullRequestFixture
{
- public CreatePullRequestFixture(string repoUrl, string sourceRefName, string targetRefName, string title, string description)
- {
- this.Settings =
+ public AzureDevOpsCreatePullRequestSettings Settings { get; } =
new AzureDevOpsCreatePullRequestSettings(
new Uri(repoUrl),
sourceRefName,
@@ -17,8 +15,5 @@ public CreatePullRequestFixture(string repoUrl, string sourceRefName, string tar
title,
description,
new AzureDevOpsNtlmCredentials());
- }
-
- public AzureDevOpsCreatePullRequestSettings Settings { get; }
}
}
diff --git a/src/Cake.AzureDevOps/Authentication/AzureDevOpsAadCredentials.cs b/src/Cake.AzureDevOps/Authentication/AzureDevOpsAadCredentials.cs
index a067e53..f11cced 100644
--- a/src/Cake.AzureDevOps/Authentication/AzureDevOpsAadCredentials.cs
+++ b/src/Cake.AzureDevOps/Authentication/AzureDevOpsAadCredentials.cs
@@ -3,16 +3,9 @@
///
/// Credentials for authentication with an Azure Active Directory.
///
- public class AzureDevOpsAadCredentials : AzureDevOpsBasicCredentials
+ /// User name.
+ /// Password.
+ public class AzureDevOpsAadCredentials(string userName, string password) : AzureDevOpsBasicCredentials(userName, password)
{
- ///
- /// Initializes a new instance of the class.
- ///
- /// User name.
- /// Password.
- public AzureDevOpsAadCredentials(string userName, string password)
- : base(userName, password)
- {
- }
}
}
diff --git a/src/Cake.AzureDevOps/Authentication/AzureDevOpsBasicCredentials.cs b/src/Cake.AzureDevOps/Authentication/AzureDevOpsBasicCredentials.cs
index 5f2788a..a124434 100644
--- a/src/Cake.AzureDevOps/Authentication/AzureDevOpsBasicCredentials.cs
+++ b/src/Cake.AzureDevOps/Authentication/AzureDevOpsBasicCredentials.cs
@@ -3,27 +3,19 @@
///
/// Credentials for basic authentication.
///
- public class AzureDevOpsBasicCredentials : IAzureDevOpsCredentials
+ /// User name.
+ /// Password.
+ public class AzureDevOpsBasicCredentials(string userName, string password) : IAzureDevOpsCredentials
{
- ///
- /// Initializes a new instance of the class.
- ///
- /// User name.
- /// Password.
- public AzureDevOpsBasicCredentials(string userName, string password)
- {
- this.UserName = userName;
- this.Password = password;
- }
///
/// Gets the user name.
///
- public string UserName { get; }
+ public string UserName { get; } = userName;
///
/// Gets the password.
///
- public string Password { get; }
+ public string Password { get; } = password;
}
}
diff --git a/src/Cake.AzureDevOps/AzureDevOpsException.cs b/src/Cake.AzureDevOps/AzureDevOpsException.cs
index 796e042..d4c0ba7 100644
--- a/src/Cake.AzureDevOps/AzureDevOpsException.cs
+++ b/src/Cake.AzureDevOps/AzureDevOpsException.cs
@@ -36,17 +36,5 @@ public AzureDevOpsException(string message, Exception innerException)
: base(message, innerException)
{
}
-
- ///
- /// Initializes a new instance of the class with serialized data.
- ///
- /// The that holds the serialized object data about
- /// the exception being thrown.
- /// The that contains contextual information about
- /// the source or destination.
- protected AzureDevOpsException(SerializationInfo info, StreamingContext context)
- : base(info, context)
- {
- }
}
}
diff --git a/src/Cake.AzureDevOps/Boards/WorkItemTracking/AzureDevOpsWorkItemException.cs b/src/Cake.AzureDevOps/Boards/WorkItemTracking/AzureDevOpsWorkItemException.cs
index 29df36c..bfd5d8f 100644
--- a/src/Cake.AzureDevOps/Boards/WorkItemTracking/AzureDevOpsWorkItemException.cs
+++ b/src/Cake.AzureDevOps/Boards/WorkItemTracking/AzureDevOpsWorkItemException.cs
@@ -1,7 +1,6 @@
namespace Cake.AzureDevOps.Boards.WorkItemTracking
{
using System;
- using System.Runtime.Serialization;
///
/// Represents an error for a work item.
@@ -36,17 +35,5 @@ public AzureDevOpsWorkItemException(string message, Exception innerException)
: base(message, innerException)
{
}
-
- ///
- /// Initializes a new instance of the class with serialized data.
- ///
- /// The that holds the serialized object data about
- /// the exception being thrown.
- /// The that contains contextual information about
- /// the source or destination.
- protected AzureDevOpsWorkItemException(SerializationInfo info, StreamingContext context)
- : base(info, context)
- {
- }
}
}
diff --git a/src/Cake.AzureDevOps/Boards/WorkItemTracking/AzureDevOpsWorkItemNotFoundException.cs b/src/Cake.AzureDevOps/Boards/WorkItemTracking/AzureDevOpsWorkItemNotFoundException.cs
index beb6edc..870fade 100644
--- a/src/Cake.AzureDevOps/Boards/WorkItemTracking/AzureDevOpsWorkItemNotFoundException.cs
+++ b/src/Cake.AzureDevOps/Boards/WorkItemTracking/AzureDevOpsWorkItemNotFoundException.cs
@@ -1,7 +1,6 @@
namespace Cake.AzureDevOps.Boards.WorkItemTracking
{
using System;
- using System.Runtime.Serialization;
///
/// Represents an error if a work item was not found.
@@ -45,17 +44,5 @@ public AzureDevOpsWorkItemNotFoundException(string message, Exception innerExcep
: base(message, innerException)
{
}
-
- ///
- /// Initializes a new instance of the class with serialized data.
- ///
- /// The that holds the serialized object data about
- /// the exception being thrown.
- /// The that contains contextual information about
- /// the source or destination.
- protected AzureDevOpsWorkItemNotFoundException(SerializationInfo info, StreamingContext context)
- : base(info, context)
- {
- }
}
}
diff --git a/src/Cake.AzureDevOps/BuildClientFactory.cs b/src/Cake.AzureDevOps/BuildClientFactory.cs
index a2a91c4..99ec7b9 100644
--- a/src/Cake.AzureDevOps/BuildClientFactory.cs
+++ b/src/Cake.AzureDevOps/BuildClientFactory.cs
@@ -23,13 +23,8 @@ public BuildHttpClient CreateBuildClient(Uri collectionUrl, IAzureDevOpsCredenti
authorizedIdentity = connection.AuthorizedIdentity;
- var buildClient = connection.GetClient();
- if (buildClient == null)
- {
+ return connection.GetClient() ??
throw new AzureDevOpsException("Could not retrieve the BuildHttpClient object");
- }
-
- return buildClient;
}
}
}
diff --git a/src/Cake.AzureDevOps/Cake.AzureDevOps.csproj b/src/Cake.AzureDevOps/Cake.AzureDevOps.csproj
index 362cbcb..769e2db 100644
--- a/src/Cake.AzureDevOps/Cake.AzureDevOps.csproj
+++ b/src/Cake.AzureDevOps/Cake.AzureDevOps.csproj
@@ -1,7 +1,7 @@
- net6.0;net7.0
+ net6.0;net7.0;net8.0
diff --git a/src/Cake.AzureDevOps/GitClientFactory.cs b/src/Cake.AzureDevOps/GitClientFactory.cs
index 249e208..81b2388 100644
--- a/src/Cake.AzureDevOps/GitClientFactory.cs
+++ b/src/Cake.AzureDevOps/GitClientFactory.cs
@@ -23,13 +23,8 @@ public GitHttpClient CreateGitClient(Uri collectionUrl, IAzureDevOpsCredentials
authorizedIdentity = connection.AuthorizedIdentity;
- var gitClient = connection.GetClient();
- if (gitClient == null)
- {
+ return connection.GetClient() ??
throw new AzureDevOpsException("Could not retrieve the GitHttpClient object");
- }
-
- return gitClient;
}
}
}
diff --git a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildNotFoundException.cs b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildNotFoundException.cs
index c351dd8..a821fe9 100644
--- a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildNotFoundException.cs
+++ b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuildNotFoundException.cs
@@ -1,7 +1,6 @@
namespace Cake.AzureDevOps.Pipelines
{
using System;
- using System.Runtime.Serialization;
///
/// Represents an error if a build was not found.
@@ -36,17 +35,5 @@ public AzureDevOpsBuildNotFoundException(string message, Exception innerExceptio
: base(message, innerException)
{
}
-
- ///
- /// Initializes a new instance of the class with serialized data.
- ///
- /// The that holds the serialized object data about
- /// the exception being thrown.
- /// The that contains contextual information about
- /// the source or destination.
- protected AzureDevOpsBuildNotFoundException(SerializationInfo info, StreamingContext context)
- : base(info, context)
- {
- }
}
}
diff --git a/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsBranchNotFoundException.cs b/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsBranchNotFoundException.cs
index 0d44a80..1820366 100644
--- a/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsBranchNotFoundException.cs
+++ b/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsBranchNotFoundException.cs
@@ -1,7 +1,6 @@
namespace Cake.AzureDevOps.Repos.PullRequest
{
using System;
- using System.Runtime.Serialization;
///
/// Represents an error if a branch was not found.
@@ -36,17 +35,5 @@ public AzureDevOpsBranchNotFoundException(string branchName, Exception innerExce
: base($"Branch not found \"{branchName}\"", innerException)
{
}
-
- ///
- /// Initializes a new instance of the class with serialized data.
- ///
- /// The that holds the serialized object data about
- /// the exception being thrown.
- /// The that contains contextual information about
- /// the source or destination.
- protected AzureDevOpsBranchNotFoundException(SerializationInfo info, StreamingContext context)
- : base(info, context)
- {
- }
}
}
diff --git a/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequest.cs b/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequest.cs
index 64f03fe..8de8415 100644
--- a/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequest.cs
+++ b/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequest.cs
@@ -382,15 +382,10 @@ public void Vote(AzureDevOpsPullRequestVote vote)
authorizedIdentity.Id.ToString())
.ConfigureAwait(false)
.GetAwaiter()
- .GetResult();
-
- if (createdReviewer == null)
- {
+ .GetResult() ??
throw new AzureDevOpsPullRequestNotFoundException(
this.pullRequest.Repository.Id,
this.pullRequest.PullRequestId);
- }
-
var createdVote = (AzureDevOpsPullRequestVote)createdReviewer.Vote;
this.log.Verbose("Voted for pull request with '{0}'.", createdVote.ToString());
}
@@ -431,15 +426,10 @@ public void SetStatus(AzureDevOpsPullRequestStatus status)
this.pullRequest.PullRequestId)
.ConfigureAwait(false)
.GetAwaiter()
- .GetResult();
-
- if (postedStatus == null)
- {
+ .GetResult() ??
throw new AzureDevOpsPullRequestNotFoundException(
this.pullRequest.Repository.Id,
this.pullRequest.PullRequestId);
- }
-
this.log.Verbose(
"Set status '{0}' to {1}.",
postedStatus.Context?.Name,
@@ -512,7 +502,7 @@ public IEnumerable GetModifiedFiles()
.GetAwaiter()
.GetResult();
- if (!commitDiffs.ChangeCounts.Any())
+ if (commitDiffs.ChangeCounts.Count == 0)
{
this.log.Verbose("Found 0 changed files in the pull request");
@@ -771,15 +761,9 @@ public int GetLatestIterationId()
this.PullRequestId)
.ConfigureAwait(false)
.GetAwaiter()
- .GetResult();
-
- if (iterations == null)
- {
+ .GetResult() ??
throw new AzureDevOpsException("Could not retrieve the iterations");
- }
-
- var iterationId = iterations.Max(x => x.Id ?? -1);
- return iterationId;
+ return iterations.Max(x => x.Id ?? -1);
}
}
@@ -841,13 +825,8 @@ internal static AzureDevOpsPullRequest Create(ICakeLog log, IGitClientFactory gi
.GetRepositoryAsync(repositoryDescription.ProjectName, repositoryDescription.RepositoryName)
.ConfigureAwait(false)
.GetAwaiter()
- .GetResult();
-
- if (repository == null)
- {
+ .GetResult() ??
throw new AzureDevOpsException("Could not read repository.");
- }
-
var targetBranchName = settings.TargetRefName;
targetBranchName ??= repository.DefaultBranch;
@@ -859,20 +838,11 @@ internal static AzureDevOpsPullRequest Create(ICakeLog log, IGitClientFactory gi
filter: targetBranchName.Replace("refs/", string.Empty))
.ConfigureAwait(false)
.GetAwaiter()
- .GetResult();
-
- if (refs == null)
- {
+ .GetResult() ??
throw new AzureDevOpsBranchNotFoundException(targetBranchName);
- }
-
- var targetBranch = refs.SingleOrDefault();
-
- if (targetBranch == null)
- {
+ var targetBranch =
+ refs.SingleOrDefault() ??
throw new AzureDevOpsBranchNotFoundException(targetBranchName);
- }
-
var pullRequest = new GitPullRequest()
{
SourceRefName = settings.SourceRefName,
diff --git a/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequestNotFoundException.cs b/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequestNotFoundException.cs
index 84eeb3c..312571f 100644
--- a/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequestNotFoundException.cs
+++ b/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequestNotFoundException.cs
@@ -1,7 +1,6 @@
namespace Cake.AzureDevOps.Repos.PullRequest
{
using System;
- using System.Runtime.Serialization;
///
/// Represents an error if a pull request was not found.
@@ -46,17 +45,5 @@ public AzureDevOpsPullRequestNotFoundException(string message, Exception innerEx
: base(message, innerException)
{
}
-
- ///
- /// Initializes a new instance of the class with serialized data.
- ///
- /// The that holds the serialized object data about
- /// the exception being thrown.
- /// The that contains contextual information about
- /// the source or destination.
- protected AzureDevOpsPullRequestNotFoundException(SerializationInfo info, StreamingContext context)
- : base(info, context)
- {
- }
}
}
diff --git a/src/Cake.AzureDevOps/TestManagementClientFactory.cs b/src/Cake.AzureDevOps/TestManagementClientFactory.cs
index 8139073..684ccb7 100644
--- a/src/Cake.AzureDevOps/TestManagementClientFactory.cs
+++ b/src/Cake.AzureDevOps/TestManagementClientFactory.cs
@@ -23,13 +23,8 @@ public TestManagementHttpClient CreateTestManagementClient(Uri collectionUrl, IA
authorizedIdentity = connection.AuthorizedIdentity;
- var testClient = connection.GetClient();
- if (testClient == null)
- {
+ return connection.GetClient() ??
throw new AzureDevOpsException("Could not retrieve the TestManagementHttpClient object");
- }
-
- return testClient;
}
}
}
diff --git a/src/Cake.AzureDevOps/WorkItemTrackingClientFactory.cs b/src/Cake.AzureDevOps/WorkItemTrackingClientFactory.cs
index eadf4b1..97cb5bd 100644
--- a/src/Cake.AzureDevOps/WorkItemTrackingClientFactory.cs
+++ b/src/Cake.AzureDevOps/WorkItemTrackingClientFactory.cs
@@ -23,13 +23,8 @@ public WorkItemTrackingHttpClient CreateWorkItemTrackingClient(Uri collectionUrl
authorizedIdentity = connection.AuthorizedIdentity;
- var workItemTrackingClient = connection.GetClient();
- if (workItemTrackingClient == null)
- {
+ return connection.GetClient() ??
throw new AzureDevOpsException("Could not retrieve the WorkItemTrackingHttpClient object");
- }
-
- return workItemTrackingClient;
}
}
}
diff --git a/tests/frosting/net8.0/build.ps1 b/tests/frosting/net8.0/build.ps1
new file mode 100644
index 0000000..c56e9b9
--- /dev/null
+++ b/tests/frosting/net8.0/build.ps1
@@ -0,0 +1,13 @@
+$ADDIN_PACKAGE_PATH = "packages/cake.azuredevops"
+if (Test-Path $ADDIN_PACKAGE_PATH)
+{
+ Write-Host "Cleaning up cached version of $ADDIN_PACKAGE_PATH..."
+ Remove-Item $ADDIN_PACKAGE_PATH -Recurse;
+}
+else
+{
+ Write-Host "$ADDIN_PACKAGE_PATH not cached..."
+}
+
+dotnet run --project build/Build.csproj -- $args
+exit $LASTEXITCODE;
\ No newline at end of file
diff --git a/tests/frosting/net8.0/build.sh b/tests/frosting/net8.0/build.sh
new file mode 100755
index 0000000..8d8f53f
--- /dev/null
+++ b/tests/frosting/net8.0/build.sh
@@ -0,0 +1,10 @@
+$ADDIN_PACKAGE_PATH = "packages/cake.azuredevops"
+if [ -d "$ADDIN_PACKAGE_PATH" ]
+then
+ echo "Cleaning up cached version of $ADDIN_PACKAGE_PATH..."
+ rm -Rf $ADDIN_PACKAGE_PATH
+else
+ echo "$ADDIN_PACKAGE_PATH not cached..."
+fi
+
+dotnet run --project ./build/Build.csproj -- "$@"
\ No newline at end of file
diff --git a/tests/frosting/net8.0/build/Build.csproj b/tests/frosting/net8.0/build/Build.csproj
new file mode 100644
index 0000000..da4a668
--- /dev/null
+++ b/tests/frosting/net8.0/build/Build.csproj
@@ -0,0 +1,11 @@
+
+
+ Exe
+ net8.0
+ $(MSBuildProjectDirectory)
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tests/frosting/net8.0/build/Program.cs b/tests/frosting/net8.0/build/Program.cs
new file mode 100644
index 0000000..61cd252
--- /dev/null
+++ b/tests/frosting/net8.0/build/Program.cs
@@ -0,0 +1,157 @@
+using Cake.Common.Build;
+using Cake.Common.Diagnostics;
+using Cake.Core;
+using Cake.Core.Diagnostics;
+using Cake.Frosting;
+using Cake.AzureDevOps;
+using System.Linq;
+
+public static class Program
+{
+ public static int Main(string[] args)
+ {
+ return new CakeHost()
+ .UseContext()
+ .Run(args);
+ }
+}
+
+public class BuildContext : FrostingContext
+{
+ public BuildContext(ICakeContext context)
+ : base(context)
+ {
+ }
+}
+
+[TaskName("Read-Build")]
+public sealed class ReadBuildTask : FrostingTask
+{
+ public override void Run(BuildContext context)
+ {
+ var build =
+ context.AzureDevOpsBuildUsingAzurePipelinesOAuthToken();
+
+ context.Information(build.BuildId);
+ }
+}
+
+[TaskName("Read-BuildChanges")]
+public sealed class ReadBuildChangesTask : FrostingTask
+{
+ public override void Run(BuildContext context)
+ {
+ var build =
+ context.AzureDevOpsBuildUsingAzurePipelinesOAuthToken();
+
+ var changes = build.GetChanges();
+ if (!changes.Any())
+ {
+ context.Information("No changes found.");
+ }
+ else
+ {
+ foreach (var change in changes)
+ {
+ context.Information("{0}: {1} by {2}", change.Id, change.Message, change.Author);
+ }
+ }
+ }
+}
+
+[TaskName("Read-BuildTimelineRecords")]
+public sealed class ReadBuildTimelineRecordsTask : FrostingTask
+{
+ public override void Run(BuildContext context)
+ {
+ var build =
+ context.AzureDevOpsBuildUsingAzurePipelinesOAuthToken();
+
+ var timelineRecords = build.GetTimelineRecords();
+ if (!timelineRecords.Any())
+ {
+ context.Information("No timeline records found.");
+ }
+ else
+ {
+ foreach (var timelineRecord in timelineRecords)
+ {
+ context.Information("{0}: {1}", timelineRecord.Id, timelineRecord.Name);
+ }
+ }
+ }
+}
+
+[TaskName("Read-BuildArtifacts")]
+public sealed class ReadBuildArtifactsTask : FrostingTask
+{
+ public override void Run(BuildContext context)
+ {
+ // var build =
+ // context.AzureDevOpsBuildUsingAzurePipelinesOAuthToken();
+
+ // var artifacts = build.GetArtifacts();
+ // if (!artifacts.Any())
+ // {
+ // context.Information("No artifacts found.");
+ // }
+ // else
+ // {
+ // foreach (var artifact in artifacts)
+ // {
+ // context.Information("{0}: {1}", artifact.Id, artifact.Name);
+ // }
+ // }
+ }
+}
+
+[TaskName("Read-BuildTestRuns")]
+public sealed class ReadBuildTestRunsTask : FrostingTask
+{
+ public override void Run(BuildContext context)
+ {
+ // var build =
+ // context.AzureDevOpsBuildUsingAzurePipelinesOAuthToken();
+
+ // var testRuns = build.GetTestRuns();
+ // if (!testRuns.Any())
+ // {
+ // context.Information("No test runs found.");
+ // }
+ // else
+ // {
+ // foreach (var testRun in testRuns)
+ // {
+ // context.Information("{0}", testRun.RunId);
+ // }
+ // }
+ }
+}
+
+[TaskName("Read-PullRequest")]
+public sealed class ReadPullRequestTask : FrostingTask
+{
+ public override bool ShouldRun(BuildContext context)
+ {
+ return context.BuildSystem().IsPullRequest;
+ }
+
+ public override void Run(BuildContext context)
+ {
+ // var pullRequest =
+ // context.AzureDevOpsPullRequestUsingAzurePipelinesOAuthToken();
+
+ // context.Information(pullRequest.TargetRefName);
+ }
+}
+
+[TaskName("Default")]
+[IsDependentOn(typeof(ReadBuildTask))]
+[IsDependentOn(typeof(ReadBuildChangesTask))]
+[IsDependentOn(typeof(ReadBuildTimelineRecordsTask))]
+[IsDependentOn(typeof(ReadBuildArtifactsTask))]
+[IsDependentOn(typeof(ReadBuildTestRunsTask))]
+[IsDependentOn(typeof(ReadPullRequestTask))]
+public class DefaultTask : FrostingTask
+{
+}
diff --git a/tests/frosting/net8.0/global.json b/tests/frosting/net8.0/global.json
new file mode 100644
index 0000000..3660ff8
--- /dev/null
+++ b/tests/frosting/net8.0/global.json
@@ -0,0 +1,7 @@
+{
+ "sdk": {
+ "allowPrerelease": true,
+ "version": "8.0.100",
+ "rollForward": "latestFeature"
+ }
+}
\ No newline at end of file
diff --git a/tests/frosting/net8.0/nuget.config b/tests/frosting/net8.0/nuget.config
new file mode 100644
index 0000000..663b555
--- /dev/null
+++ b/tests/frosting/net8.0/nuget.config
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tests/script-runner/net8.0/.config/dotnet-tools.json b/tests/script-runner/net8.0/.config/dotnet-tools.json
new file mode 100644
index 0000000..7b34695
--- /dev/null
+++ b/tests/script-runner/net8.0/.config/dotnet-tools.json
@@ -0,0 +1,12 @@
+{
+ "version": 1,
+ "isRoot": true,
+ "tools": {
+ "cake.tool": {
+ "version": "4.0.0",
+ "commands": [
+ "dotnet-cake"
+ ]
+ }
+ }
+ }
\ No newline at end of file
diff --git a/tests/script-runner/net8.0/build.cake b/tests/script-runner/net8.0/build.cake
new file mode 100644
index 0000000..20015a3
--- /dev/null
+++ b/tests/script-runner/net8.0/build.cake
@@ -0,0 +1,120 @@
+#addin nuget:?package=Cake.AzureDevOps&prerelease
+
+//////////////////////////////////////////////////
+// ARGUMENTS
+//////////////////////////////////////////////////
+
+var target = Argument("target", "Default");
+
+//////////////////////////////////////////////////
+// TARGETS
+//////////////////////////////////////////////////
+
+Task("Read-Build")
+ .Does(() =>
+{
+ var build = AzureDevOpsBuildUsingAzurePipelinesOAuthToken();
+
+ Information(build.BuildId);
+});
+
+Task("Read-BuildChanges")
+ .Does(() =>
+{
+ var build = AzureDevOpsBuildUsingAzurePipelinesOAuthToken();
+
+ var changes = build.GetChanges();
+ if (!changes.Any())
+ {
+ Information("No changes found.");
+ }
+ else
+ {
+ foreach (var change in changes)
+ {
+ Information("{0}: {1} by {2}", change.Id, change.Message, change.Author);
+ }
+ }
+});
+
+Task("Read-BuildTimelineRecords")
+ .Does(() =>
+{
+ var build = AzureDevOpsBuildUsingAzurePipelinesOAuthToken();
+
+ var timelineRecords = build.GetTimelineRecords();
+ if (!timelineRecords.Any())
+ {
+ Information("No timeline records found.");
+ }
+ else
+ {
+ foreach (var timelineRecord in timelineRecords)
+ {
+ Information("{0}: {1}", timelineRecord.Id, timelineRecord.Name);
+ }
+ }
+});
+
+Task("Read-BuildArtifacts")
+ .Does(() =>
+{
+ // var build = AzureDevOpsBuildUsingAzurePipelinesOAuthToken();
+
+ // var artifacts = build.GetArtifacts();
+ // if (!artifacts.Any())
+ // {
+ // Information("No artifacts found.");
+ // }
+ // else
+ // {
+ // foreach (var artifact in artifacts)
+ // {
+ // Information("{0}: {1}", artifact.Id, artifact.Name);
+ // }
+ // }
+});
+
+Task("Read-BuildTestRuns")
+ .Does(() =>
+{
+ // var build = AzureDevOpsBuildUsingAzurePipelinesOAuthToken();
+
+ // var testRuns = build.GetTestRuns();
+ // if (!testRuns.Any())
+ // {
+ // Information("No test runs found.");
+ // }
+ // else
+ // {
+ // foreach (var testRun in testRuns)
+ // {
+ // Information("{0}", testRun.RunId);
+ // }
+ // }
+});
+
+Task("Read-PullRequest")
+ .WithCriteria((context) => context.BuildSystem().IsPullRequest, "Only supported for pull request builds.")
+ .Does(() =>
+{
+ // var pullRequest =
+ // AzureDevOpsPullRequestUsingAzurePipelinesOAuthToken();
+
+ // Information(pullRequest.TargetRefName);
+});
+
+
+Task("Default")
+ .IsDependentOn("Read-Build")
+ .IsDependentOn("Read-BuildChanges")
+ .IsDependentOn("Read-BuildTimelineRecords")
+ .IsDependentOn("Read-BuildArtifacts")
+ .IsDependentOn("Read-BuildTestRuns")
+ .IsDependentOn("Read-PullRequest");
+
+//////////////////////////////////////////////////
+// EXECUTION
+//////////////////////////////////////////////////
+
+RunTarget(target);
\ No newline at end of file
diff --git a/tests/script-runner/net8.0/build.ps1 b/tests/script-runner/net8.0/build.ps1
new file mode 100644
index 0000000..fe60276
--- /dev/null
+++ b/tests/script-runner/net8.0/build.ps1
@@ -0,0 +1,15 @@
+$ErrorActionPreference = 'Stop'
+
+$SCRIPT_NAME = "build.cake"
+
+Write-Host "Restoring .NET Core tools"
+dotnet tool restore
+if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
+
+Write-Host "Bootstrapping Cake"
+dotnet cake $SCRIPT_NAME --bootstrap
+if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
+
+Write-Host "Running Build"
+dotnet cake $SCRIPT_NAME @args
+if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
\ No newline at end of file
diff --git a/tests/script-runner/net8.0/build.sh b/tests/script-runner/net8.0/build.sh
new file mode 100755
index 0000000..921a324
--- /dev/null
+++ b/tests/script-runner/net8.0/build.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+SCRIPT_NAME="build.cake"
+
+echo "Restoring .NET Core tools"
+dotnet tool restore
+
+echo "Bootstrapping Cake"
+dotnet cake $SCRIPT_NAME --bootstrap
+
+echo "Running Build"
+dotnet cake $SCRIPT_NAME "$@"
\ No newline at end of file
diff --git a/tests/script-runner/net8.0/global.json b/tests/script-runner/net8.0/global.json
new file mode 100644
index 0000000..3660ff8
--- /dev/null
+++ b/tests/script-runner/net8.0/global.json
@@ -0,0 +1,7 @@
+{
+ "sdk": {
+ "allowPrerelease": true,
+ "version": "8.0.100",
+ "rollForward": "latestFeature"
+ }
+}
\ No newline at end of file
diff --git a/tests/script-runner/net8.0/nuget.config b/tests/script-runner/net8.0/nuget.config
new file mode 100644
index 0000000..62768c3
--- /dev/null
+++ b/tests/script-runner/net8.0/nuget.config
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
From e9c8015007eb2590f12ac860eaaea4578d04eed1 Mon Sep 17 00:00:00 2001
From: Pascal Berger
Date: Sun, 26 Nov 2023 20:56:59 +0100
Subject: [PATCH 13/18] Remove BaseAzureDevOpsPullRequestSettings.SourceBranch
(#457)
---
.../Repos/PullRequest/BaseAzureDevOpsPullRequestSettings.cs | 6 ------
1 file changed, 6 deletions(-)
diff --git a/src/Cake.AzureDevOps/Repos/PullRequest/BaseAzureDevOpsPullRequestSettings.cs b/src/Cake.AzureDevOps/Repos/PullRequest/BaseAzureDevOpsPullRequestSettings.cs
index 2e26ab5..4996662 100644
--- a/src/Cake.AzureDevOps/Repos/PullRequest/BaseAzureDevOpsPullRequestSettings.cs
+++ b/src/Cake.AzureDevOps/Repos/PullRequest/BaseAzureDevOpsPullRequestSettings.cs
@@ -81,12 +81,6 @@ protected BaseAzureDevOpsPullRequestSettings(IAzureDevOpsCredentials credentials
///
public Uri RepositoryUrl { get; }
- ///
- /// Gets the branch for which the pull request is made.
- ///
- [Obsolete("Use SourceRefName instead.")]
- public string SourceBranch => this.SourceRefName;
-
///
/// Gets the branch for which the pull request is made.
///
From b771b6c18d9b0bed10985dd5afcbdf8eb1727675 Mon Sep 17 00:00:00 2001
From: Pascal Berger
Date: Sun, 26 Nov 2023 22:01:00 +0100
Subject: [PATCH 14/18] GetIterationChanges should return empty collection
instead of null (#459)
---
.../Repos/PullRequest/AzureDevOpsPullRequest.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequest.cs b/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequest.cs
index 8de8415..73b61bb 100644
--- a/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequest.cs
+++ b/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequest.cs
@@ -771,12 +771,12 @@ public int GetLatestIterationId()
/// Gets all the pull request changes of the given iteration.
///
/// The id of the iteration.
- /// The collection of the iteration changes of the given id. Returns null if pull request is not valid.
+ /// The collection of the iteration changes of the given id. Returns an empty collection if pull request is not valid.
public IEnumerable GetIterationChanges(int iterationId)
{
if (!this.ValidatePullRequest())
{
- return null;
+ return [];
}
using (var gitClient = this.gitClientFactory.CreateGitClient(this.CollectionUrl, this.credentials))
From 910a2f37d7cde1149b70e8592a0d61c0d8e151ed Mon Sep 17 00:00:00 2001
From: Pascal Berger
Date: Sun, 26 Nov 2023 22:25:04 +0100
Subject: [PATCH 15/18] Improve exception documentation (#460)
---
.../PullRequest/AzureDevOpsPullRequest.cs | 48 +++++++++++++++----
1 file changed, 39 insertions(+), 9 deletions(-)
diff --git a/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequest.cs b/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequest.cs
index 73b61bb..2832d5f 100644
--- a/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequest.cs
+++ b/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequest.cs
@@ -466,7 +466,10 @@ public IEnumerable GetCommits()
///
/// Gets the files modified by the pull request.
///
- /// The collection of the modified files paths.
+ /// The collection of the modified files paths or an empty list if no pull request could be found and
+ /// is set to false..
+ /// If pull request could not be found and
+ /// is set to true.
public IEnumerable GetModifiedFiles()
{
if (!this.ValidatePullRequest())
@@ -526,7 +529,10 @@ public IEnumerable GetModifiedFiles()
///
/// Gets the pull request comment threads.
///
- /// The list of comment threads of the pull request.
+ /// The list of comment threads of the pull request or an empty list if no pull request could be found and
+ /// is set to false.
+ /// If pull request could not be found and
+ /// is set to true.
public IEnumerable GetCommentThreads()
{
if (!this.ValidatePullRequest())
@@ -550,6 +556,8 @@ public IEnumerable GetCommentThreads()
/// Sets the pull request comment thread status to .
///
/// The Id of the comment thread.
+ /// If pull request could not be found and
+ /// is set to true.
public void ResolveCommentThread(int threadId)
{
this.SetCommentThreadStatus(threadId, CommentThreadStatus.Fixed);
@@ -559,6 +567,8 @@ public void ResolveCommentThread(int threadId)
/// Sets the pull request comment thread to .
///
/// The Id of the comment thread.
+ /// If pull request could not be found and
+ /// is set to true.
public void ActivateCommentThread(int threadId)
{
this.SetCommentThreadStatus(threadId, CommentThreadStatus.Active);
@@ -568,6 +578,8 @@ public void ActivateCommentThread(int threadId)
/// Sets the pull request comment thread to .
///
/// The Id of the comment thread.
+ /// If pull request could not be found and
+ /// is set to true.
public void CloseCommentThread(int threadId)
{
this.SetCommentThreadStatus(threadId, CommentThreadStatus.Closed);
@@ -577,7 +589,10 @@ public void CloseCommentThread(int threadId)
/// Creates a new comment thread with a single comment in the pull request.
///
/// Comment which should be added.
- /// A newly created comment thread, or null if it can't be created.
+ /// A newly created comment thread, or if no pull request could be found and
+ /// is set to false..
+ /// If pull request could not be found and
+ /// is set to true.
public AzureDevOpsPullRequestCommentThread CreateComment(string comment)
{
comment.NotNullOrWhiteSpace(nameof(comment));
@@ -606,7 +621,10 @@ public AzureDevOpsPullRequestCommentThread CreateComment(string comment)
/// Path to the file to create the comment for.
/// The line number of a thread's position. Starts at 1.
/// The character offset of a thread's position inside of a line. Starts at 0.
- /// A newly created comment thread, or null if it can't be created.
+ /// A newly created comment thread, or if no pull request could be found and
+ /// is set to false..
+ /// If pull request could not be found and
+ /// is set to true.
public AzureDevOpsPullRequestCommentThread CreateComment(string comment, FilePath filePath, int lineNumber, int offset)
{
comment.NotNullOrWhiteSpace(nameof(comment));
@@ -673,7 +691,10 @@ public void DeleteComment(AzureDevOpsComment comment)
/// Updates the comment.
///
/// The updated comment.
- /// The updated comment, or null if it can't be updated.
+ /// The updated comment, or if no pull request could be found and
+ /// is set to false..
+ /// If pull request could not be found and
+ /// is set to true.
public AzureDevOpsComment UpdateComment(AzureDevOpsComment comment)
{
comment.NotNull(nameof(comment));
@@ -710,7 +731,10 @@ public AzureDevOpsComment UpdateComment(AzureDevOpsComment comment)
/// Creates a new comment thread in the pull request.
///
/// The instance of the thread.
- /// A newly created comment thread, or null if it can't be created.
+ /// A newly created comment thread, or if no pull request could be found and
+ /// is set to false..
+ /// If pull request could not be found and
+ /// is set to true.
public AzureDevOpsPullRequestCommentThread CreateCommentThread(AzureDevOpsPullRequestCommentThread thread)
{
thread.NotNull(nameof(thread));
@@ -743,7 +767,10 @@ public AzureDevOpsPullRequestCommentThread CreateCommentThread(AzureDevOpsPullRe
///
/// Gets the Id of the latest pull request iteration.
///
- /// The Id of the pull request iteration. Returns -1 in case the pull request is not valid.
+ /// The Id of the pull request iteration or -1 if no pull request could be found and
+ /// is set to false..
+ /// If pull request could not be found and
+ /// is set to true.
/// If it is not possible to obtain a collection of .
public int GetLatestIterationId()
{
@@ -771,7 +798,10 @@ public int GetLatestIterationId()
/// Gets all the pull request changes of the given iteration.
///
/// The id of the iteration.
- /// The collection of the iteration changes of the given id. Returns an empty collection if pull request is not valid.
+ /// The collection of the iteration changes of the given id or an empty list if no pull request could be found and
+ /// is set to false..
+ /// If pull request could not be found and
+ /// is set to true.
public IEnumerable GetIterationChanges(int iterationId)
{
if (!this.ValidatePullRequest())
@@ -905,7 +935,7 @@ private void SetCommentThreadStatus(int threadId, CommentThreadStatus status)
///
/// Validates if a pull request could be found.
/// Depending on
- /// the pull request instance can be null for subsequent calls.
+ /// the pull request instance can be for subsequent calls.
///
/// True if a valid pull request instance exists.
/// If
From f272f1e9f019e432291aa32fb4774cf5e29b268a Mon Sep 17 00:00:00 2001
From: Pascal Berger
Date: Sun, 26 Nov 2023 22:52:11 +0100
Subject: [PATCH 16/18] Fix linting issues (#461)
---
.../Fakes/FakeAllSetGitClientFactory.cs | 83 ++++++++---------
.../FakeAllSetTestManagementClientFactory.cs | 22 ++---
.../FakeNullForMethodsGitClientFactory.cs | 5 +-
.../Fakes/FakeNullGitClientFactory.cs | 2 +-
...zureDevOpsPullRequestCommentThreadTests.cs | 10 ++-
.../AzureDevOpsBasicCredentials.cs | 1 -
.../Pipelines/AzureDevOpsBuild.cs | 15 ++--
.../PullRequest/AzureDevOpsPullRequest.cs | 89 +++++++++----------
8 files changed, 115 insertions(+), 112 deletions(-)
diff --git a/src/Cake.AzureDevOps.Tests/Fakes/FakeAllSetGitClientFactory.cs b/src/Cake.AzureDevOps.Tests/Fakes/FakeAllSetGitClientFactory.cs
index 475abbd..ed0b98b 100644
--- a/src/Cake.AzureDevOps.Tests/Fakes/FakeAllSetGitClientFactory.cs
+++ b/src/Cake.AzureDevOps.Tests/Fakes/FakeAllSetGitClientFactory.cs
@@ -41,24 +41,24 @@ public override GitHttpClient CreateGitClient(Uri collectionUrl, IAzureDevOpsCre
null,
default))
.ReturnsAsync((string _, string repoId2, GitPullRequestSearchCriteria sc, int _, int _, int _, object _, CancellationToken _)
- => new List(new[]
- {
- new GitPullRequest
- {
- PullRequestId = 777,
- Status = PullRequestStatus.Active,
- Repository = new GitRepository
+ =>
+ [
+ new GitPullRequest
{
- Id = Guid.NewGuid(),
- Name = repoId2,
+ PullRequestId = 777,
+ Status = PullRequestStatus.Active,
+ Repository = new GitRepository
+ {
+ Id = Guid.NewGuid(),
+ Name = repoId2,
+ },
+ SourceRefName = sc.SourceRefName,
+ TargetRefName = "master",
+ CodeReviewId = 123,
+ LastMergeSourceCommit = new GitCommitRef { CommitId = "4a92b977" },
+ LastMergeTargetCommit = new GitCommitRef { CommitId = "78a3c113" },
},
- SourceRefName = sc.SourceRefName,
- TargetRefName = "master",
- CodeReviewId = 123,
- LastMergeSourceCommit = new GitCommitRef { CommitId = "4a92b977" },
- LastMergeTargetCommit = new GitCommitRef { CommitId = "78a3c113" },
- },
- }));
+ ]);
mock = this.Setup(mock);
@@ -159,18 +159,18 @@ protected override Mock Setup(Mock m)
{
FilePath = "/some/path/to/file.cs",
},
- Comments = new List
- {
- new () { Content = "Hello", IsDeleted = false, CommentType = CommentType.CodeChange, Id = 1 },
- new () { Content = "Goodbye", IsDeleted = true, CommentType = CommentType.Text, Id = 2 },
- },
+ Comments =
+ [
+ new () { Content = "Hello", IsDeleted = false, CommentType = CommentType.CodeChange, Id = 1 },
+ new () { Content = "Goodbye", IsDeleted = true, CommentType = CommentType.Text, Id = 2 },
+ ],
Status = CommentThreadStatus.Active,
},
new ()
{
Id = 22,
ThreadContext = null,
- Comments = new List(),
+ Comments = [],
Status = CommentThreadStatus.Fixed,
},
};
@@ -201,11 +201,11 @@ protected override Mock Setup(Mock m)
null,
CancellationToken.None))
.ReturnsAsync((Guid _, int _, bool? _, object _, CancellationToken _)
- => new List
- {
- new () { Id = 42, CreatedDate = DateTime.Today.AddDays(-3) },
- new () { Id = 16, CreatedDate = DateTime.Today.AddDays(-1) },
- });
+ =>
+ [
+ new () { Id = 42, CreatedDate = DateTime.Today.AddDays(-3) },
+ new () { Id = 16, CreatedDate = DateTime.Today.AddDays(-1) },
+ ]);
m.Setup(arg => arg.GetPullRequestIterationsAsync(
It.IsAny(),
@@ -214,19 +214,20 @@ protected override Mock Setup(Mock m)
null,
CancellationToken.None))
.ReturnsAsync((Guid _, int _, bool? _, object _, CancellationToken _)
- => new List
- {
- new () { Id = null },
- });
+ =>
+ [
+ new () { Id = null },
+ ]);
// Setup GitPullRequestIterationChanges collection
var changes = new GitPullRequestIterationChanges
{
- ChangeEntries = new List
- {
- new () { ChangeId = 100, ChangeTrackingId = 1, Item = new GitItem { Path = "/src/my/class1.cs" } },
- new () { ChangeId = 200, ChangeTrackingId = 2, Item = new GitItem { Path = string.Empty } },
- },
+ ChangeEntries =
+ [
+ new () { ChangeId = 100, ChangeTrackingId = 1, Item = new GitItem { Path = "/src/my/class1.cs" } },
+ new () { ChangeId = 200, ChangeTrackingId = 2, Item = new GitItem { Path = string.Empty } },
+
+ ],
};
m.Setup(arg => arg.GetPullRequestIterationChangesAsync(
@@ -254,7 +255,7 @@ protected override Mock Setup(Mock m)
null,
null,
CancellationToken.None))
- .ReturnsAsync(() => new List());
+ .ReturnsAsync(() => []);
m.Setup(args => args.GetRepositoryAsync(It.IsAny(), "MyRepoName", null, CancellationToken.None))
.ReturnsAsync(() => new GitRepository() { DefaultBranch = "master" });
@@ -271,10 +272,10 @@ protected override Mock Setup(Mock m)
null,
null,
CancellationToken.None))
- .ReturnsAsync(() => new List()
- {
- new ("master"),
- });
+ .ReturnsAsync(() =>
+ [
+ new ("master"),
+ ]);
m.Setup(
arg =>
diff --git a/src/Cake.AzureDevOps.Tests/Fakes/FakeAllSetTestManagementClientFactory.cs b/src/Cake.AzureDevOps.Tests/Fakes/FakeAllSetTestManagementClientFactory.cs
index 5e127b4..158e60a 100644
--- a/src/Cake.AzureDevOps.Tests/Fakes/FakeAllSetTestManagementClientFactory.cs
+++ b/src/Cake.AzureDevOps.Tests/Fakes/FakeAllSetTestManagementClientFactory.cs
@@ -15,23 +15,23 @@ public override TestManagementHttpClient CreateTestManagementClient(Uri collecti
var mock = new Mock(MockBehavior.Strict, collectionUrl, credentials.ToVssCredentials());
mock.Setup(arg => arg.GetTestResultDetailsForBuildAsync(It.IsAny(), It.Is(id => id == 1), null, null, null, null, null, null, null, default))
- .ReturnsAsync(() => new TestResultsDetails { ResultsForGroup = new List() });
+ .ReturnsAsync(() => new TestResultsDetails { ResultsForGroup = [] });
mock.Setup(arg => arg.GetTestResultDetailsForBuildAsync(It.IsAny(), It.Is(id => id > 1), null, null, null, null, null, null, null, default))
.ReturnsAsync(() => new TestResultsDetails
{
- ResultsForGroup = new List()
- {
- new ()
- {
- Results = new List()
+ ResultsForGroup =
+ [
+ new ()
{
- new () { Id = 11, TestRun = new ShallowReference { Id = "1" } },
- new () { Id = 12, TestRun = new ShallowReference { Id = "1" } },
- new () { Id = 13, TestRun = new ShallowReference { Id = "1" } },
+ Results =
+ [
+ new () { Id = 11, TestRun = new ShallowReference { Id = "1" } },
+ new () { Id = 12, TestRun = new ShallowReference { Id = "1" } },
+ new () { Id = 13, TestRun = new ShallowReference { Id = "1" } },
+ ],
},
- },
- },
+ ],
});
mock.Setup(arg => arg.GetTestResultsAsync(It.IsAny(), It.IsAny(), null, It.IsAny(), It.IsAny(), It.IsAny>(), null, default))
diff --git a/src/Cake.AzureDevOps.Tests/Fakes/FakeNullForMethodsGitClientFactory.cs b/src/Cake.AzureDevOps.Tests/Fakes/FakeNullForMethodsGitClientFactory.cs
index 5b010d2..a2d9688 100644
--- a/src/Cake.AzureDevOps.Tests/Fakes/FakeNullForMethodsGitClientFactory.cs
+++ b/src/Cake.AzureDevOps.Tests/Fakes/FakeNullForMethodsGitClientFactory.cs
@@ -17,14 +17,13 @@ protected override Mock Setup(Mock m)
.ReturnsAsync(() => null);
m.Setup(arg => arg.GetCommitDiffsAsync(It.IsAny(), It.IsAny(), true, null, null, It.IsAny(), It.IsAny(), null, CancellationToken.None))
- .ReturnsAsync(()
- => new GitCommitDiffs { ChangeCounts = [], Changes = new List() });
+ .ReturnsAsync(() => new GitCommitDiffs { ChangeCounts = [], Changes = [] });
m.Setup(arg => arg.UpdateThreadAsync(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), null, CancellationToken.None))
.ReturnsAsync(() => null);
m.Setup(arg => arg.GetThreadsAsync(It.IsAny(), It.IsAny(), null, null, null, CancellationToken.None))
- .ReturnsAsync(() => new List());
+ .ReturnsAsync(() => []);
m.Setup(arg => arg.CreateThreadAsync(It.IsAny(), It.IsAny(), It.IsAny(), null, CancellationToken.None))
.ReturnsAsync(() => null);
diff --git a/src/Cake.AzureDevOps.Tests/Fakes/FakeNullGitClientFactory.cs b/src/Cake.AzureDevOps.Tests/Fakes/FakeNullGitClientFactory.cs
index ecc3556..4ce93f8 100644
--- a/src/Cake.AzureDevOps.Tests/Fakes/FakeNullGitClientFactory.cs
+++ b/src/Cake.AzureDevOps.Tests/Fakes/FakeNullGitClientFactory.cs
@@ -16,7 +16,7 @@ public override GitHttpClient CreateGitClient(Uri collectionUrl, IAzureDevOpsCre
.ReturnsAsync(() => null);
mock.Setup(arg => arg.GetPullRequestsAsync(It.IsAny(), It.IsAny(), It.IsAny(), null, null, 1, null, default))
- .ReturnsAsync(() => new List());
+ .ReturnsAsync(() => []);
mock = this.Setup(mock);
diff --git a/src/Cake.AzureDevOps.Tests/Repos/PullRequest/CommentThread/AzureDevOpsPullRequestCommentThreadTests.cs b/src/Cake.AzureDevOps.Tests/Repos/PullRequest/CommentThread/AzureDevOpsPullRequestCommentThreadTests.cs
index ca05eaf..d7f0e3f 100644
--- a/src/Cake.AzureDevOps.Tests/Repos/PullRequest/CommentThread/AzureDevOpsPullRequestCommentThreadTests.cs
+++ b/src/Cake.AzureDevOps.Tests/Repos/PullRequest/CommentThread/AzureDevOpsPullRequestCommentThreadTests.cs
@@ -50,7 +50,10 @@ public void Should_Return_Valid_Comment_Thread()
Id = 42,
Status = CommentThreadStatus.Pending,
ThreadContext = new CommentThreadContext { FilePath = "/src/myclass.cs" },
- Comments = new List { new () { Content = "Hello", CommentType = CommentType.Text, IsDeleted = false } },
+ Comments =
+ [
+ new () { Content = "Hello", CommentType = CommentType.Text, IsDeleted = false }
+ ],
Properties = [],
};
@@ -152,7 +155,10 @@ public void Should_Set_Properly()
// When
var azureDevOpsThread = new AzureDevOpsPullRequestCommentThread(thread)
{
- Comments = new List { new ("hi", false) },
+ Comments =
+ [
+ new ("hi", false)
+ ],
};
// Then
diff --git a/src/Cake.AzureDevOps/Authentication/AzureDevOpsBasicCredentials.cs b/src/Cake.AzureDevOps/Authentication/AzureDevOpsBasicCredentials.cs
index a124434..ab351fc 100644
--- a/src/Cake.AzureDevOps/Authentication/AzureDevOpsBasicCredentials.cs
+++ b/src/Cake.AzureDevOps/Authentication/AzureDevOpsBasicCredentials.cs
@@ -7,7 +7,6 @@
/// Password.
public class AzureDevOpsBasicCredentials(string userName, string password) : IAzureDevOpsCredentials
{
-
///
/// Gets the user name.
///
diff --git a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuild.cs b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuild.cs
index b4d4197..6775d40 100644
--- a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuild.cs
+++ b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsBuild.cs
@@ -358,7 +358,7 @@ public IEnumerable GetChanges()
{
if (!this.ValidateBuild())
{
- return new List();
+ return [];
}
using (var buildClient = this.buildClientFactory.CreateBuildClient(this.CollectionUrl, this.settings.Credentials))
@@ -384,7 +384,7 @@ public IEnumerable GetWorkItemIds()
{
if (!this.ValidateBuild())
{
- return Array.Empty();
+ return [];
}
using (var buildClient = this.buildClientFactory.CreateBuildClient(this.CollectionUrl, this.settings.Credentials))
@@ -403,7 +403,8 @@ public IEnumerable GetWorkItemIds()
throw new InvalidOperationException("Either ProjectId or ProjectName needs to be set");
}
- return task
+ return
+ task
.ConfigureAwait(false)
.GetAwaiter()
.GetResult()
@@ -422,7 +423,7 @@ public IEnumerable GetWorkItems()
{
if (!this.ValidateBuild())
{
- return Array.Empty();
+ return [];
}
var workItemIds = this.GetWorkItemIds();
@@ -463,7 +464,7 @@ public IEnumerable GetTimelineRecords()
{
if (!this.ValidateBuild())
{
- return new List();
+ return [];
}
using (var buildClient = this.buildClientFactory.CreateBuildClient(this.CollectionUrl, this.settings.Credentials))
@@ -490,7 +491,7 @@ public IEnumerable GetArtifacts()
{
if (!this.ValidateBuild())
{
- return new List();
+ return [];
}
using (var buildClient = this.buildClientFactory.CreateBuildClient(this.CollectionUrl, this.settings.Credentials))
@@ -610,7 +611,7 @@ public IEnumerable GetTestRuns(int? maxResultsPerTestRun, IE
{
if (!this.ValidateBuild())
{
- return new List();
+ return [];
}
using (var testClient = this.testClientFactory.CreateTestManagementClient(this.CollectionUrl, this.settings.Credentials))
diff --git a/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequest.cs b/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequest.cs
index 2832d5f..a287930 100644
--- a/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequest.cs
+++ b/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequest.cs
@@ -448,7 +448,7 @@ public IEnumerable GetCommits()
{
if (!this.ValidatePullRequest())
{
- return new List();
+ return [];
}
using (var gitClient = this.gitClientFactory.CreateGitClient(this.CollectionUrl, this.credentials))
@@ -474,7 +474,7 @@ public IEnumerable GetModifiedFiles()
{
if (!this.ValidatePullRequest())
{
- return new List();
+ return [];
}
var targetVersionDescriptor = new GitTargetVersionDescriptor
@@ -509,7 +509,7 @@ public IEnumerable GetModifiedFiles()
{
this.log.Verbose("Found 0 changed files in the pull request");
- return new List();
+ return [];
}
var changes =
@@ -537,7 +537,7 @@ public IEnumerable GetCommentThreads()
{
if (!this.ValidatePullRequest())
{
- return new List();
+ return [];
}
using (var gitClient = this.gitClientFactory.CreateGitClient(this.CollectionUrl, this.credentials))
@@ -600,15 +600,15 @@ public AzureDevOpsPullRequestCommentThread CreateComment(string comment)
var thread = new AzureDevOpsPullRequestCommentThread
{
Status = AzureDevOpsCommentThreadStatus.Active,
- Comments = new List
- {
- new ()
- {
- CommentType = AzureDevOpsCommentType.System,
- IsDeleted = false,
- Content = comment,
- },
- },
+ Comments =
+ [
+ new ()
+ {
+ CommentType = AzureDevOpsCommentType.System,
+ IsDeleted = false,
+ Content = comment,
+ },
+ ],
};
return this.CreateCommentThread(thread);
@@ -635,15 +635,15 @@ public AzureDevOpsPullRequestCommentThread CreateComment(string comment, FilePat
var thread = new AzureDevOpsPullRequestCommentThread
{
Status = AzureDevOpsCommentThreadStatus.Active,
- Comments = new List
- {
- new ()
- {
- CommentType = AzureDevOpsCommentType.System,
- IsDeleted = false,
- Content = comment,
- },
- },
+ Comments =
+ [
+ new ()
+ {
+ CommentType = AzureDevOpsCommentType.System,
+ IsDeleted = false,
+ Content = comment,
+ },
+ ],
FilePath = filePath,
LineNumber = lineNumber,
Offset = offset,
@@ -704,7 +704,6 @@ public AzureDevOpsComment UpdateComment(AzureDevOpsComment comment)
return null;
}
- AzureDevOpsComment resultingComment = null;
using (var gitClient = this.gitClientFactory.CreateGitClient(this.CollectionUrl, this.credentials))
{
var newComment = gitClient
@@ -720,11 +719,11 @@ public AzureDevOpsComment UpdateComment(AzureDevOpsComment comment)
if (newComment != null)
{
- resultingComment = new AzureDevOpsComment(newComment, comment.ThreadId);
+ return new AzureDevOpsComment(newComment, comment.ThreadId);
}
}
- return resultingComment;
+ return null;
}
///
@@ -744,7 +743,6 @@ public AzureDevOpsPullRequestCommentThread CreateCommentThread(AzureDevOpsPullRe
return null;
}
- AzureDevOpsPullRequestCommentThread resultingThread = null;
using (var gitClient = this.gitClientFactory.CreateGitClient(this.CollectionUrl, this.credentials))
{
var newThread = gitClient.CreateThreadAsync(
@@ -757,11 +755,11 @@ public AzureDevOpsPullRequestCommentThread CreateCommentThread(AzureDevOpsPullRe
if (newThread != null)
{
- resultingThread = new AzureDevOpsPullRequestCommentThread(newThread);
+ return new AzureDevOpsPullRequestCommentThread(newThread);
}
}
- return resultingThread;
+ return null;
}
///
@@ -821,15 +819,14 @@ public IEnumerable GetIterationChanges(in
.GetAwaiter()
.GetResult();
- var azureDevOpsChanges = changes?.ChangeEntries.Select(c =>
- new AzureDevOpsPullRequestIterationChange
- {
- ChangeId = c.ChangeId,
- ChangeTrackingId = c.ChangeTrackingId,
- ItemPath = c.Item.Path.IsNullOrEmpty() ? null : new FilePath(c.Item.Path),
- });
-
- return azureDevOpsChanges;
+ return
+ changes?.ChangeEntries.Select(c =>
+ new AzureDevOpsPullRequestIterationChange
+ {
+ ChangeId = c.ChangeId,
+ ChangeTrackingId = c.ChangeTrackingId,
+ ItemPath = c.Item.Path.IsNullOrEmpty() ? null : new FilePath(c.Item.Path),
+ });
}
}
@@ -846,13 +843,13 @@ internal static AzureDevOpsPullRequest Create(ICakeLog log, IGitClientFactory gi
gitClientFactory.NotNull(nameof(gitClientFactory));
settings.NotNull(nameof(settings));
- var repositoryDescription = new RepositoryDescription(settings.RepositoryUrl);
+ var repoDesc = new RepositoryDescription(settings.RepositoryUrl);
- using (var gitClient = gitClientFactory.CreateGitClient(repositoryDescription.CollectionUrl, settings.Credentials))
+ using (var gitClient = gitClientFactory.CreateGitClient(repoDesc.CollectionUrl, settings.Credentials))
{
var repository =
gitClient
- .GetRepositoryAsync(repositoryDescription.ProjectName, repositoryDescription.RepositoryName)
+ .GetRepositoryAsync(repoDesc.ProjectName, repoDesc.RepositoryName)
.ConfigureAwait(false)
.GetAwaiter()
.GetResult() ??
@@ -863,8 +860,8 @@ internal static AzureDevOpsPullRequest Create(ICakeLog log, IGitClientFactory gi
var refs =
gitClient
.GetRefsAsync(
- repositoryDescription.ProjectName,
- repositoryDescription.RepositoryName,
+ repoDesc.ProjectName,
+ repoDesc.RepositoryName,
filter: targetBranchName.Replace("refs/", string.Empty))
.ConfigureAwait(false)
.GetAwaiter()
@@ -873,7 +870,7 @@ internal static AzureDevOpsPullRequest Create(ICakeLog log, IGitClientFactory gi
var targetBranch =
refs.SingleOrDefault() ??
throw new AzureDevOpsBranchNotFoundException(targetBranchName);
- var pullRequest = new GitPullRequest()
+ var pr = new GitPullRequest()
{
SourceRefName = settings.SourceRefName,
TargetRefName = targetBranch.Name,
@@ -884,9 +881,9 @@ internal static AzureDevOpsPullRequest Create(ICakeLog log, IGitClientFactory gi
var createdPullRequest =
gitClient
.CreatePullRequestAsync(
- pullRequest,
- repositoryDescription.ProjectName,
- repositoryDescription.RepositoryName)
+ pr,
+ repoDesc.ProjectName,
+ repoDesc.RepositoryName)
.ConfigureAwait(false)
.GetAwaiter()
.GetResult();
From 75c8811fd887194f68a22d7659259a4ccb051ea0 Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Sat, 9 Dec 2023 11:35:54 +0100
Subject: [PATCH 17/18] Update xunit-dotnet monorepo (#462)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
---
src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj b/src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj
index ddbdb76..db93ce3 100644
--- a/src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj
+++ b/src/Cake.AzureDevOps.Tests/Cake.AzureDevOps.Tests.csproj
@@ -22,8 +22,8 @@
-
-
+
+
From 55380aacf095967c979b8ae088483b086a076b81 Mon Sep 17 00:00:00 2001
From: Pascal Berger
Date: Sat, 9 Dec 2023 19:10:54 +0100
Subject: [PATCH 18/18] Update release notes link
---
src/Cake.AzureDevOps/Cake.AzureDevOps.csproj | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Cake.AzureDevOps/Cake.AzureDevOps.csproj b/src/Cake.AzureDevOps/Cake.AzureDevOps.csproj
index 769e2db..ca6a020 100644
--- a/src/Cake.AzureDevOps/Cake.AzureDevOps.csproj
+++ b/src/Cake.AzureDevOps/Cake.AzureDevOps.csproj
@@ -22,7 +22,7 @@
MIT
git
https://github.com/cake-contrib/Cake.AzureDevOps.git
- https://github.com/cake-contrib/Cake.AzureDevOps/releases/tag/3.0.2
+ https://github.com/cake-contrib/Cake.AzureDevOps/releases/tag/$(Version)
true
false
$(TargetsForTfmSpecificContentInPackage);PackBuildOutputs