From 681a6268911a14e4ae0e4440ad9bed322859238e Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Tue, 10 Oct 2023 22:27:57 +0200 Subject: [PATCH 1/5] Use Renovate preset for Cake.Recipe based repos (#432) --- .github/renovate.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/renovate.json b/.github/renovate.json index c28d224e..c715c78d 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -1,7 +1,7 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": [ - "github>cake-contrib/renovate-presets" + "github>cake-contrib/renovate-presets:cake-recipe" ], "packageRules": [ { From c5ce3efa20dcc24da169891e3dc71abde1435a61 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 11 Oct 2023 13:51:00 +0000 Subject: [PATCH 2/5] Update dependency dotnet-sdk to v7.0.402 (#434) 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 1e7a8f3c..9a650947 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.413 -InstallDir $env:DOTNET_INSTALL_DIR' - - ps: '& "$($env:DOTNET_INSTALL_DIR)/dotnet-install.ps1" -Version 7.0.401 -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:Path = "$env:DOTNET_INSTALL_DIR;$env:Path" - ps: dotnet --info diff --git a/global.json b/global.json index 35ea6ca8..e00ab7a4 100644 --- a/global.json +++ b/global.json @@ -1,7 +1,7 @@ { "sdk": { "allowPrerelease": true, - "version": "7.0.401", + "version": "7.0.402", "rollForward": "latestFeature" } } \ No newline at end of file From 98631a2e6ec2cde06154f461ebd32d3dc128e556 Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Wed, 11 Oct 2023 21:50:37 +0200 Subject: [PATCH 3/5] (GH-435) Don't throw exception if not running in PR build (#436) --- .../AzureDevOpsPullRequestSettingsTests.cs | 330 ++++++++++++++++++ .../AzureDevOpsAliases.PullRequest.cs | 25 +- .../AzureDevOpsPullRequestSettings.cs | 14 +- 3 files changed, 356 insertions(+), 13 deletions(-) diff --git a/src/Cake.AzureDevOps.Tests/Repos/PullRequest/AzureDevOpsPullRequestSettingsTests.cs b/src/Cake.AzureDevOps.Tests/Repos/PullRequest/AzureDevOpsPullRequestSettingsTests.cs index 4721d50f..33dc7637 100644 --- a/src/Cake.AzureDevOps.Tests/Repos/PullRequest/AzureDevOpsPullRequestSettingsTests.cs +++ b/src/Cake.AzureDevOps.Tests/Repos/PullRequest/AzureDevOpsPullRequestSettingsTests.cs @@ -553,6 +553,36 @@ public void Should_Throw_If_Repository_Url_Env_Var_Is_Not_Set() result.IsInvalidOperationException(); } + [Fact] + public void Should_Throw_If_Repository_Url_Env_Var_Is_Not_Set_And_Parameter_Is_True() + { + // Given + Environment.SetEnvironmentVariable("BUILD_REPOSITORY_URI", null); + Environment.SetEnvironmentVariable("SYSTEM_PULLREQUEST_PULLREQUESTID", "42"); + Environment.SetEnvironmentVariable("SYSTEM_ACCESSTOKEN", "foo"); + + // When + var result = Record.Exception(() => AzureDevOpsPullRequestSettings.UsingAzurePipelinesOAuthToken(true)); + + // Then + result.IsInvalidOperationException(); + } + + [Fact] + public void Should_Not_Throw_If_Repository_Url_Env_Var_Is_Not_Set_And_Parameter_Is_False() + { + // Given + Environment.SetEnvironmentVariable("BUILD_REPOSITORY_URI", null); + Environment.SetEnvironmentVariable("SYSTEM_PULLREQUEST_PULLREQUESTID", "42"); + Environment.SetEnvironmentVariable("SYSTEM_ACCESSTOKEN", "foo"); + + // When + var result = AzureDevOpsPullRequestSettings.UsingAzurePipelinesOAuthToken(false); + + // Then + result.ShouldBeNull(); + } + [Fact] public void Should_Throw_If_Repository_Url_Env_Var_Is_Empty() { @@ -568,6 +598,36 @@ public void Should_Throw_If_Repository_Url_Env_Var_Is_Empty() result.IsInvalidOperationException(); } + [Fact] + public void Should_Throw_If_Repository_Url_Env_Var_Is_Empty_And_Parameter_Is_True() + { + // Given + Environment.SetEnvironmentVariable("BUILD_REPOSITORY_URI", string.Empty); + Environment.SetEnvironmentVariable("SYSTEM_PULLREQUEST_PULLREQUESTID", "42"); + Environment.SetEnvironmentVariable("SYSTEM_ACCESSTOKEN", "foo"); + + // When + var result = Record.Exception(() => AzureDevOpsPullRequestSettings.UsingAzurePipelinesOAuthToken(true)); + + // Then + result.IsInvalidOperationException(); + } + + [Fact] + public void Should_Not_Throw_If_Repository_Url_Env_Var_Is_Empty_And_Parameter_Is_False() + { + // Given + Environment.SetEnvironmentVariable("BUILD_REPOSITORY_URI", string.Empty); + Environment.SetEnvironmentVariable("SYSTEM_PULLREQUEST_PULLREQUESTID", "42"); + Environment.SetEnvironmentVariable("SYSTEM_ACCESSTOKEN", "foo"); + + // When + var result = AzureDevOpsPullRequestSettings.UsingAzurePipelinesOAuthToken(false); + + // Then + result.ShouldBeNull(); + } + [Fact] public void Should_Throw_If_Repository_Url_Env_Var_Is_WhiteSpace() { @@ -583,6 +643,36 @@ public void Should_Throw_If_Repository_Url_Env_Var_Is_WhiteSpace() result.IsInvalidOperationException(); } + [Fact] + public void Should_Throw_If_Repository_Url_Env_Var_Is_WhiteSpace_And_Parameter_Is_True() + { + // Given + Environment.SetEnvironmentVariable("BUILD_REPOSITORY_URI", " "); + Environment.SetEnvironmentVariable("SYSTEM_PULLREQUEST_PULLREQUESTID", "42"); + Environment.SetEnvironmentVariable("SYSTEM_ACCESSTOKEN", "foo"); + + // When + var result = Record.Exception(() => AzureDevOpsPullRequestSettings.UsingAzurePipelinesOAuthToken(true)); + + // Then + result.IsInvalidOperationException(); + } + + [Fact] + public void Should_Not_Throw_If_Repository_Url_Env_Var_Is_WhiteSpace_And_Parameter_Is_False() + { + // Given + Environment.SetEnvironmentVariable("BUILD_REPOSITORY_URI", " "); + Environment.SetEnvironmentVariable("SYSTEM_PULLREQUEST_PULLREQUESTID", "42"); + Environment.SetEnvironmentVariable("SYSTEM_ACCESSTOKEN", "foo"); + + // When + var result = AzureDevOpsPullRequestSettings.UsingAzurePipelinesOAuthToken(false); + + // Then + result.ShouldBeNull(); + } + [Fact] public void Should_Throw_If_Pull_Request_Id_Env_Var_Is_Not_Set() { @@ -598,6 +688,36 @@ public void Should_Throw_If_Pull_Request_Id_Env_Var_Is_Not_Set() result.IsInvalidOperationException(); } + [Fact] + public void Should_Throw_If_Pull_Request_Id_Env_Var_Is_Not_Set_And_Parameter_Is_True() + { + // Given + Environment.SetEnvironmentVariable("BUILD_REPOSITORY_URI", "http://example.com"); + Environment.SetEnvironmentVariable("SYSTEM_PULLREQUEST_PULLREQUESTID", null); + Environment.SetEnvironmentVariable("SYSTEM_ACCESSTOKEN", "foo"); + + // When + var result = Record.Exception(() => AzureDevOpsPullRequestSettings.UsingAzurePipelinesOAuthToken(true)); + + // Then + result.IsInvalidOperationException(); + } + + [Fact] + public void Should_Not_Throw_If_Pull_Request_Id_Env_Var_Is_Not_Set_And_Parameter_Is_False() + { + // Given + Environment.SetEnvironmentVariable("BUILD_REPOSITORY_URI", "http://example.com"); + Environment.SetEnvironmentVariable("SYSTEM_PULLREQUEST_PULLREQUESTID", null); + Environment.SetEnvironmentVariable("SYSTEM_ACCESSTOKEN", "foo"); + + // When + var result = AzureDevOpsPullRequestSettings.UsingAzurePipelinesOAuthToken(false); + + // Then + result.ShouldBeNull(); + } + [Fact] public void Should_Throw_If_Pull_Request_Id_Env_Var_Is_Empty() { @@ -613,6 +733,36 @@ public void Should_Throw_If_Pull_Request_Id_Env_Var_Is_Empty() result.IsInvalidOperationException(); } + [Fact] + public void Should_Throw_If_Pull_Request_Id_Env_Var_Is_Empty_And_Parameter_Is_True() + { + // Given + Environment.SetEnvironmentVariable("BUILD_REPOSITORY_URI", "http://example.com"); + Environment.SetEnvironmentVariable("SYSTEM_PULLREQUEST_PULLREQUESTID", string.Empty); + Environment.SetEnvironmentVariable("SYSTEM_ACCESSTOKEN", "foo"); + + // When + var result = Record.Exception(() => AzureDevOpsPullRequestSettings.UsingAzurePipelinesOAuthToken(true)); + + // Then + result.IsInvalidOperationException(); + } + + [Fact] + public void Should_Not_Throw_If_Pull_Request_Id_Env_Var_Is_Empty_And_Parameter_Is_False() + { + // Given + Environment.SetEnvironmentVariable("BUILD_REPOSITORY_URI", "http://example.com"); + Environment.SetEnvironmentVariable("SYSTEM_PULLREQUEST_PULLREQUESTID", string.Empty); + Environment.SetEnvironmentVariable("SYSTEM_ACCESSTOKEN", "foo"); + + // When + var result = AzureDevOpsPullRequestSettings.UsingAzurePipelinesOAuthToken(false); + + // Then + result.ShouldBeNull(); + } + [Fact] public void Should_Throw_If_Pull_Request_Id_Env_Var_Is_WhiteSpace() { @@ -628,6 +778,36 @@ public void Should_Throw_If_Pull_Request_Id_Env_Var_Is_WhiteSpace() result.IsInvalidOperationException(); } + [Fact] + public void Should_Throw_If_Pull_Request_Id_Env_Var_Is_WhiteSpace_And_Parameter_Is_True() + { + // Given + Environment.SetEnvironmentVariable("BUILD_REPOSITORY_URI", "http://example.com"); + Environment.SetEnvironmentVariable("SYSTEM_PULLREQUEST_PULLREQUESTID", " "); + Environment.SetEnvironmentVariable("SYSTEM_ACCESSTOKEN", "foo"); + + // When + var result = Record.Exception(() => AzureDevOpsPullRequestSettings.UsingAzurePipelinesOAuthToken(true)); + + // Then + result.IsInvalidOperationException(); + } + + [Fact] + public void Should_Not_Throw_If_Pull_Request_Id_Env_Var_Is_WhiteSpace_And_Parameter_Is_False() + { + // Given + Environment.SetEnvironmentVariable("BUILD_REPOSITORY_URI", "http://example.com"); + Environment.SetEnvironmentVariable("SYSTEM_PULLREQUEST_PULLREQUESTID", " "); + Environment.SetEnvironmentVariable("SYSTEM_ACCESSTOKEN", "foo"); + + // When + var result = AzureDevOpsPullRequestSettings.UsingAzurePipelinesOAuthToken(false); + + // Then + result.ShouldBeNull(); + } + [Fact] public void Should_Throw_If_Pull_Request_Id_Env_Var_Is_Not_Integer() { @@ -643,6 +823,36 @@ public void Should_Throw_If_Pull_Request_Id_Env_Var_Is_Not_Integer() result.IsInvalidOperationException(); } + [Fact] + public void Should_Throw_If_Pull_Request_Id_Env_Var_Is_Not_Integer_And_Parameter_Is_True() + { + // Given + Environment.SetEnvironmentVariable("BUILD_REPOSITORY_URI", "http://example.com"); + Environment.SetEnvironmentVariable("SYSTEM_PULLREQUEST_PULLREQUESTID", "foo"); + Environment.SetEnvironmentVariable("SYSTEM_ACCESSTOKEN", "foo"); + + // When + var result = Record.Exception(() => AzureDevOpsPullRequestSettings.UsingAzurePipelinesOAuthToken(true)); + + // Then + result.IsInvalidOperationException(); + } + + [Fact] + public void Should_Not_Throw_If_Pull_Request_Id_Env_Var_Is_Not_Integer_And_Parameter_Is_False() + { + // Given + Environment.SetEnvironmentVariable("BUILD_REPOSITORY_URI", "http://example.com"); + Environment.SetEnvironmentVariable("SYSTEM_PULLREQUEST_PULLREQUESTID", "foo"); + Environment.SetEnvironmentVariable("SYSTEM_ACCESSTOKEN", "foo"); + + // When + var result = AzureDevOpsPullRequestSettings.UsingAzurePipelinesOAuthToken(false); + + // Then + result.ShouldBeNull(); + } + [Fact] public void Should_Throw_If_Pull_Request_Id_Is_Zero() { @@ -658,6 +868,36 @@ public void Should_Throw_If_Pull_Request_Id_Is_Zero() result.IsInvalidOperationException(); } + [Fact] + public void Should_Throw_If_Pull_Request_Id_Is_Zero_And_Parameter_Is_True() + { + // Given + Environment.SetEnvironmentVariable("BUILD_REPOSITORY_URI", "http://example.com"); + Environment.SetEnvironmentVariable("SYSTEM_PULLREQUEST_PULLREQUESTID", "0"); + Environment.SetEnvironmentVariable("SYSTEM_ACCESSTOKEN", "foo"); + + // When + var result = Record.Exception(() => AzureDevOpsPullRequestSettings.UsingAzurePipelinesOAuthToken(true)); + + // Then + result.IsInvalidOperationException(); + } + + [Fact] + public void Should_Not_Throw_If_Pull_Request_Id_Is_Zero_And_Parameter_Is_False() + { + // Given + Environment.SetEnvironmentVariable("BUILD_REPOSITORY_URI", "http://example.com"); + Environment.SetEnvironmentVariable("SYSTEM_PULLREQUEST_PULLREQUESTID", "0"); + Environment.SetEnvironmentVariable("SYSTEM_ACCESSTOKEN", "foo"); + + // When + var result = AzureDevOpsPullRequestSettings.UsingAzurePipelinesOAuthToken(false); + + // Then + result.ShouldBeNull(); + } + [Fact] public void Should_Throw_If_System_Access_Token_Env_Var_Is_Not_Set() { @@ -673,6 +913,36 @@ public void Should_Throw_If_System_Access_Token_Env_Var_Is_Not_Set() result.IsInvalidOperationException(); } + [Fact] + public void Should_Throw_If_System_Access_Token_Env_Var_Is_Not_Set_And_Parameter_Is_True() + { + // Given + Environment.SetEnvironmentVariable("BUILD_REPOSITORY_URI", "http://example.com"); + Environment.SetEnvironmentVariable("SYSTEM_PULLREQUEST_PULLREQUESTID", "42"); + Environment.SetEnvironmentVariable("SYSTEM_ACCESSTOKEN", null); + + // When + var result = Record.Exception(() => AzureDevOpsPullRequestSettings.UsingAzurePipelinesOAuthToken(true)); + + // Then + result.IsInvalidOperationException(); + } + + [Fact] + public void Should_Not_Throw_If_System_Access_Token_Env_Var_Is_Not_Set_And_Parameter_Is_False() + { + // Given + Environment.SetEnvironmentVariable("BUILD_REPOSITORY_URI", "http://example.com"); + Environment.SetEnvironmentVariable("SYSTEM_PULLREQUEST_PULLREQUESTID", "42"); + Environment.SetEnvironmentVariable("SYSTEM_ACCESSTOKEN", null); + + // When + var result = AzureDevOpsPullRequestSettings.UsingAzurePipelinesOAuthToken(false); + + // Then + result.ShouldBeNull(); + } + [Fact] public void Should_Throw_If_System_Access_Token_Env_Var_Is_Empty() { @@ -688,6 +958,36 @@ public void Should_Throw_If_System_Access_Token_Env_Var_Is_Empty() result.IsInvalidOperationException(); } + [Fact] + public void Should_Throw_If_System_Access_Token_Env_Var_Is_Empty_And_Parameter_Is_True() + { + // Given + Environment.SetEnvironmentVariable("BUILD_REPOSITORY_URI", "http://example.com"); + Environment.SetEnvironmentVariable("SYSTEM_PULLREQUEST_PULLREQUESTID", "42"); + Environment.SetEnvironmentVariable("SYSTEM_ACCESSTOKEN", string.Empty); + + // When + var result = Record.Exception(() => AzureDevOpsPullRequestSettings.UsingAzurePipelinesOAuthToken(true)); + + // Then + result.IsInvalidOperationException(); + } + + [Fact] + public void Should_Not_Throw_If_System_Access_Token_Env_Var_Is_Empty_And_Parameter_Is_False() + { + // Given + Environment.SetEnvironmentVariable("BUILD_REPOSITORY_URI", "http://example.com"); + Environment.SetEnvironmentVariable("SYSTEM_PULLREQUEST_PULLREQUESTID", "42"); + Environment.SetEnvironmentVariable("SYSTEM_ACCESSTOKEN", string.Empty); + + // When + var result = AzureDevOpsPullRequestSettings.UsingAzurePipelinesOAuthToken(false); + + // Then + result.ShouldBeNull(); + } + [Fact] public void Should_Throw_If_System_Access_Token_Env_Var_Is_WhiteSpace() { @@ -703,6 +1003,36 @@ public void Should_Throw_If_System_Access_Token_Env_Var_Is_WhiteSpace() result.IsInvalidOperationException(); } + [Fact] + public void Should_Throw_If_System_Access_Token_Env_Var_Is_WhiteSpace_And_Parameter_Is_True() + { + // Given + Environment.SetEnvironmentVariable("BUILD_REPOSITORY_URI", "http://example.com"); + Environment.SetEnvironmentVariable("SYSTEM_PULLREQUEST_PULLREQUESTID", "42"); + Environment.SetEnvironmentVariable("SYSTEM_ACCESSTOKEN", " "); + + // When + var result = Record.Exception(() => AzureDevOpsPullRequestSettings.UsingAzurePipelinesOAuthToken(true)); + + // Then + result.IsInvalidOperationException(); + } + + [Fact] + public void Should_Not_Throw_If_System_Access_Token_Env_Var_Is_WhiteSpace_And_Parameter_Is_False() + { + // Given + Environment.SetEnvironmentVariable("BUILD_REPOSITORY_URI", "http://example.com"); + Environment.SetEnvironmentVariable("SYSTEM_PULLREQUEST_PULLREQUESTID", "42"); + Environment.SetEnvironmentVariable("SYSTEM_ACCESSTOKEN", " "); + + // When + var result = AzureDevOpsPullRequestSettings.UsingAzurePipelinesOAuthToken(false); + + // Then + result.ShouldBeNull(); + } + [Fact] public void Should_Set_Repository_Url() { diff --git a/src/Cake.AzureDevOps/AzureDevOpsAliases.PullRequest.cs b/src/Cake.AzureDevOps/AzureDevOpsAliases.PullRequest.cs index efb93b58..a6a1e986 100644 --- a/src/Cake.AzureDevOps/AzureDevOpsAliases.PullRequest.cs +++ b/src/Cake.AzureDevOps/AzureDevOpsAliases.PullRequest.cs @@ -97,8 +97,8 @@ public static AzureDevOpsPullRequest AzureDevOpsPullRequestUsingAzurePipelinesOA /// Make sure the build has the 'Allow Scripts to access OAuth token' option enabled. /// /// The context. - /// Value indicating whether an exception - /// should be thrown if pull request could not be found. + /// Value indicating whether an exception + /// should be thrown if not running in Azure Pipelines or pull request could not be found. /// /// Get a pull request: /// @@ -109,13 +109,14 @@ public static AzureDevOpsPullRequest AzureDevOpsPullRequestUsingAzurePipelinesOA /// /// /// Description of the pull request. - /// Returns null if pull request could not be found and - /// is set to false. - /// If build is not running in Azure Pipelines, - /// build is not for a pull request or 'Allow Scripts to access OAuth token' option is not enabled - /// on the build definition. - /// If pull request could not be found and - /// is set to true. + /// Returns null if pull request could not be found or if not running in an Azure Pipelines build and + /// is set to false. + /// If + /// is set to true and build is not running in Azure Pipelines, build is not for a pull request or + /// 'Allow Scripts to access OAuth token' option is not enabled on the build definition. + /// If + /// is set to true and pull request + /// could not be found. [CakeMethodAlias] [CakeAliasCategory("Pull Request")] [CakeNamespaceImport("Cake.AzureDevOps.Repos")] @@ -123,18 +124,18 @@ public static AzureDevOpsPullRequest AzureDevOpsPullRequestUsingAzurePipelinesOA [CakeNamespaceImport("Cake.AzureDevOps.Repos.PullRequest.CommentThread")] public static AzureDevOpsPullRequest AzureDevOpsPullRequestUsingAzurePipelinesOAuthToken( this ICakeContext context, - bool throwExceptionIfPullRequestCouldNotBeFound) + bool throwException) { context.NotNull(nameof(context)); - var settings = AzureDevOpsPullRequestSettings.UsingAzurePipelinesOAuthToken(throwExceptionIfPullRequestCouldNotBeFound); + var settings = AzureDevOpsPullRequestSettings.UsingAzurePipelinesOAuthToken(throwException); if (settings == null) { return null; } - settings.ThrowExceptionIfPullRequestCouldNotBeFound = throwExceptionIfPullRequestCouldNotBeFound; + settings.ThrowExceptionIfPullRequestCouldNotBeFound = throwException; return AzureDevOpsPullRequest(context, settings); } diff --git a/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequestSettings.cs b/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequestSettings.cs index df0a7e67..f4805b3c 100644 --- a/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequestSettings.cs +++ b/src/Cake.AzureDevOps/Repos/PullRequest/AzureDevOpsPullRequestSettings.cs @@ -124,7 +124,19 @@ public static AzureDevOpsPullRequestSettings UsingAzurePipelinesOAuthToken(bool return null; } - return new AzureDevOpsPullRequestSettings(new AzureDevOpsOAuthCredentials(accessToken)); + try + { + return new AzureDevOpsPullRequestSettings(new AzureDevOpsOAuthCredentials(accessToken)); + } + catch (InvalidOperationException) + { + if (!throwExceptionIfVariablesDontExist) + { + return null; + } + + throw; + } } /// From a4ced6c3cc957595e9a7b5e1d39d04cf3bd357cf Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Wed, 11 Oct 2023 22:03:50 +0200 Subject: [PATCH 4/5] Make properties init-only (#437) --- .../Pipelines/AzureDevOpsArtifactResource.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsArtifactResource.cs b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsArtifactResource.cs index 1df331a8..516e650e 100644 --- a/src/Cake.AzureDevOps/Pipelines/AzureDevOpsArtifactResource.cs +++ b/src/Cake.AzureDevOps/Pipelines/AzureDevOpsArtifactResource.cs @@ -12,26 +12,26 @@ public class AzureDevOpsArtifactResource /// /// Gets the data of the resource. /// - public string Data { get; internal set; } + public string Data { get; init; } /// /// Gets the download url of the resource. /// - public string DownloadUrl { get; internal set; } + public string DownloadUrl { get; init; } /// /// Gets the type of the resource. /// - public AzurePipelinesArtifactType Type { get; internal set; } + public AzurePipelinesArtifactType Type { get; init; } /// /// Gets the full http link to the resource. /// - public string Url { get; internal set; } + public string Url { get; init; } /// /// Gets the properties for the resource. /// - public Dictionary Properties { get; internal set; } + public Dictionary Properties { get; init; } } } From 6deb559239715a7f3c72220e536cc6dfe3b8a855 Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Wed, 11 Oct 2023 22:18:31 +0200 Subject: [PATCH 5/5] 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 fefbaaea..a9d87b97 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.1 + https://github.com/cake-contrib/Cake.AzureDevOps/releases/tag/3.0.2 true false $(TargetsForTfmSpecificContentInPackage);PackBuildOutputs