diff --git a/README.md b/README.md
index 6df9b81..1e64b6e 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
-# TFS / VSTS support for Cake Issues Addin
+# TFS / Azure DevOps support for Cake Issues Addin
This addin for the Cake Build Automation System allows you to write issues found using any code
-analyzer or linter to Team Foundation Server or Visual Studio Team Services pull requests using
+analyzer or linter to Team Foundation Server or Azure DevOps pull requests using
the [Cake Issues addin](https://github.com/cake-contrib/Cake.Issues).
For more information about this add-in see the [Cake.Issues website](https://cake-contrib.github.io/Cake.Issues.Website)
@@ -38,4 +38,4 @@ Come join in the conversation about this addin in our Gitter Chat Room
## Contributing
-Contributions are welcome. See [Contribution Guidelines](CONTRIBUTING.md).
\ No newline at end of file
+Contributions are welcome. See [Contribution Guidelines](CONTRIBUTING.md).
diff --git a/nuspec/nuget/Cake.Issues.PullRequests.Tfs.nuspec b/nuspec/nuget/Cake.Issues.PullRequests.Tfs.nuspec
index 5a66d50..5250b97 100644
--- a/nuspec/nuget/Cake.Issues.PullRequests.Tfs.nuspec
+++ b/nuspec/nuget/Cake.Issues.PullRequests.Tfs.nuspec
@@ -6,24 +6,24 @@
0.0.0
BBT Software AG and contributors
bbtsoftware, pascalberger, cake-contrib
- TFS and VSTS support for the Cake.Issues addin for Cake Build Automation System
+ TFS and Azure DevOps support for the Cake.Issues addin for Cake Build Automation System
-The Team Foundation Server / Visual Studio Team Services support for the Cake.Issues addin for Cake allows you to
-write found issues as comments Team Foundation Server or Visual Studio Team Services pull requests.
+The Team Foundation Server / Azure DevOps support for the Cake.Issues addin for Cake allows you to
+write found issues as comments Team Foundation Server or Azure DevOps pull requests.
-This addin provides the aliases for writing to Team Foundation Server or Visual Studio Team Services pull requests.
+This addin provides the aliases for writing to Team Foundation Server or Azure DevOps pull requests.
It also requires the core Cake.Issues and Cake.Issues.PullRequests addins and one or more issue providers.
See the Project Site for an overview of the whole ecosystem of addins for working with issues in Cake scripts.
https://github.com/cake-contrib/Cake.Issues.PullRequests.Tfs/blob/develop/LICENSE
http://cake-contrib.github.io/Cake.Issues.Website
- https://cdn.rawgit.com/cake-contrib/graphics/a5cf0f881c390650144b2243ae551d5b9f836196/png/cake-contrib-medium.png
+ https://cdn.jsdelivr.net/gh/cake-contrib/graphics@a5cf0f881c390650144b2243ae551d5b9f836196/png/cake-contrib-medium.png
false
Copyright © BBT Software AG and contributors
- Cake Script Cake-Issues Cake-PullRequestSystem Issues PullRequest TFS VSTS
- https://github.com/cake-contrib/Cake.Issues.PullRequests.Tfs/releases/tag/0.6.2
+ Cake Script Cake-Issues Cake-PullRequestSystem Issues PullRequest TFS Azure-DevOps
+ https://github.com/cake-contrib/Cake.Issues.PullRequests.Tfs/releases/tag/0.6.3
diff --git a/src/Cake.Issues.PullRequests.Tfs.Tests/TfsPullRequestSystemSettingsTests.cs b/src/Cake.Issues.PullRequests.Tfs.Tests/TfsPullRequestSystemSettingsTests.cs
index dfdcf16..1d0becc 100644
--- a/src/Cake.Issues.PullRequests.Tfs.Tests/TfsPullRequestSystemSettingsTests.cs
+++ b/src/Cake.Issues.PullRequests.Tfs.Tests/TfsPullRequestSystemSettingsTests.cs
@@ -57,6 +57,26 @@ public void Should_Throw_If_RepositoryUrl_For_PullRequestId_Is_Null()
// Then
result.IsArgumentNullException("repositoryUrl");
}
+
+ [Fact]
+ public void Should_Throw_If_Credentials_For_PullRequestId_Are_Null()
+ {
+ // Given / When
+ var result = Record.Exception(() => new TfsPullRequestSystemSettings(new Uri("http://example.com"), 42, null));
+
+ // Then
+ result.IsArgumentNullException("credentials");
+ }
+
+ [Fact]
+ public void Should_Throw_If_Credentials_For_SourceBranch_Are_Null()
+ {
+ // Given / When
+ var result = Record.Exception(() => new TfsPullRequestSystemSettings(new Uri("http://example.com"), "feature/foo", null));
+
+ // Then
+ result.IsArgumentNullException("credentials");
+ }
}
}
}
diff --git a/src/Cake.Issues.PullRequests.Tfs/Cake.Issues.PullRequests.Tfs.csproj b/src/Cake.Issues.PullRequests.Tfs/Cake.Issues.PullRequests.Tfs.csproj
index bb8d66b..bcead28 100644
--- a/src/Cake.Issues.PullRequests.Tfs/Cake.Issues.PullRequests.Tfs.csproj
+++ b/src/Cake.Issues.PullRequests.Tfs/Cake.Issues.PullRequests.Tfs.csproj
@@ -41,7 +41,7 @@
- 0.2.1
+ 0.2.2
3.1.0
diff --git a/src/Cake.Issues.PullRequests.Tfs/ITfsPullRequestSystem.cs b/src/Cake.Issues.PullRequests.Tfs/ITfsPullRequestSystem.cs
index 66b45f8..2b0c4ff 100644
--- a/src/Cake.Issues.PullRequests.Tfs/ITfsPullRequestSystem.cs
+++ b/src/Cake.Issues.PullRequests.Tfs/ITfsPullRequestSystem.cs
@@ -4,7 +4,7 @@
using Microsoft.TeamFoundation.SourceControl.WebApi;
///
- /// Interface for writing issues to Team Foundation Server or Visual Studio Team Services pull requests.
+ /// Interface for writing issues to Team Foundation Server or Azure DevOps pull requests.
///
internal interface ITfsPullRequestSystem : IPullRequestSystem
{
diff --git a/src/Cake.Issues.PullRequests.Tfs/Properties/AssemblyInfo.cs b/src/Cake.Issues.PullRequests.Tfs/Properties/AssemblyInfo.cs
index 4e8aded..13251be 100644
--- a/src/Cake.Issues.PullRequests.Tfs/Properties/AssemblyInfo.cs
+++ b/src/Cake.Issues.PullRequests.Tfs/Properties/AssemblyInfo.cs
@@ -7,7 +7,7 @@
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Cake.Issues.PullRequests.Tfs")]
-[assembly: AssemblyDescription("TFS and VSTS support for the Cake.Issues addin for Cake Build Automation System")]
+[assembly: AssemblyDescription("TFS and Azure DevOps support for the Cake.Issues addin for Cake Build Automation System")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("BBT Software AG")]
[assembly: AssemblyProduct("Cake.Issues")]
diff --git a/src/Cake.Issues.PullRequests.Tfs/TfsPullRequestSystem.cs b/src/Cake.Issues.PullRequests.Tfs/TfsPullRequestSystem.cs
index 2b5a463..17172ee 100644
--- a/src/Cake.Issues.PullRequests.Tfs/TfsPullRequestSystem.cs
+++ b/src/Cake.Issues.PullRequests.Tfs/TfsPullRequestSystem.cs
@@ -14,7 +14,7 @@
using Microsoft.VisualStudio.Services.WebApi;
///
- /// Class for writing issues to Team Foundation Server or Visual Studio Team Services pull requests.
+ /// Class for writing issues to Team Foundation Server or Azure DevOps pull requests.
///
internal sealed class TfsPullRequestSystem : BasePullRequestSystem, ITfsPullRequestSystem
{
@@ -277,7 +277,7 @@ private bool AddThreadProperties(
}
}
- // A VSTS UI extension will recognize this and format the comments differently.
+ // An Azure DevOps UI extension will recognize this and format the comments differently.
properties.Add("CodeAnalysisThreadType", "CodeAnalysisIssue");
thread.Properties = properties;
diff --git a/src/Cake.Issues.PullRequests.Tfs/TfsPullRequestSystemAliases.PullRequestSystem.cs b/src/Cake.Issues.PullRequests.Tfs/TfsPullRequestSystemAliases.PullRequestSystem.cs
index 7064610..da69a61 100644
--- a/src/Cake.Issues.PullRequests.Tfs/TfsPullRequestSystemAliases.PullRequestSystem.cs
+++ b/src/Cake.Issues.PullRequests.Tfs/TfsPullRequestSystemAliases.PullRequestSystem.cs
@@ -11,7 +11,7 @@
public static partial class TfsPullRequestSystemAliases
{
///
- /// Gets an object for writing issues to Team Foundation Server or Visual Studio Team Services pull request
+ /// Gets an object for writing issues to Team Foundation Server or Azure DevOps pull request
/// in a specific repository and for a specific source branch.
///
/// The context.
@@ -21,8 +21,8 @@ public static partial class TfsPullRequestSystemAliases
/// URLs using SSH scheme are converted to HTTPS.
/// Branch for which the pull request is made.
/// Credentials to use to authenticate against Team Foundation Server or
- /// Visual Studio Team Services.
- /// Object for writing issues to Team Foundation Server or Visual Studio Team Services pull request.
+ /// Azure DevOps.
+ /// Object for writing issues to Team Foundation Server or Azure DevOps pull request.
///
/// Report code analysis issues reported as MsBuild warnings to a TFS pull request:
///
@@ -56,7 +56,7 @@ public static IPullRequestSystem TfsPullRequests(
}
///
- /// Gets an object for writing issues to Team Foundation Server or Visual Studio Team Services pull request
+ /// Gets an object for writing issues to Team Foundation Server or Azure DevOps pull request
/// in a specific repository and with a specific ID.
///
/// The context.
@@ -66,8 +66,8 @@ public static IPullRequestSystem TfsPullRequests(
/// URLs using SSH scheme are converted to HTTPS.
/// ID of the pull request.
/// Credentials to use to authenticate against Team Foundation Server or
- /// Visual Studio Team Services.
- /// Object for writing issues to Team Foundation Server or Visual Studio Team Services pull request.
+ /// Azure DevOps.
+ /// Object for writing issues to Team Foundation Server or Azure DevOps pull request.
///
/// Report code analysis issues reported as MsBuild warnings to a TFS pull request:
///
@@ -99,13 +99,76 @@ public static IPullRequestSystem TfsPullRequests(
return context.TfsPullRequests(new TfsPullRequestSystemSettings(repositoryUrl, pullRequestId, credentials));
}
+ ///
+ /// Gets an object for writing issues to Team Foundation Server or Azure DevOps pull request
+ /// where all required data is taken from the environment variables set by the Azure Pipelines / TFS build.
+ ///
+ /// The context.
+ /// Credentials to use to authenticate against Team Foundation Server or
+ /// Azure DevOps.
+ /// Object for writing issues to Team Foundation Server or Azure DevOps pull request.
+ ///
+ /// Report code analysis issues reported as MsBuild warnings to a TFS pull request:
+ ///
+ ///
+ ///
+ ///
+ [CakeMethodAlias]
+ [CakeAliasCategory(PullRequestsAliasConstants.PullRequestSystemCakeAliasCategory)]
+ public static IPullRequestSystem TfsPullRequests(
+ this ICakeContext context,
+ ITfsCredentials credentials)
+ {
+ context.NotNull(nameof(context));
+ credentials.NotNull(nameof(credentials));
+
+ return context.TfsPullRequests(new TfsPullRequestSystemSettings(credentials));
+ }
+
+ ///
+ /// Gets an object for writing issues to Team Foundation Server or Azure DevOps pull request
+ /// where all required data (including authentication token) is taken from the environment variables set by the Azure Pipelines / TFS build.
+ ///
+ /// The context.
+ /// Object for writing issues to Team Foundation Server or Azure DevOps pull request.
+ ///
+ /// Report code analysis issues reported as MsBuild warnings to a TFS pull request:
+ ///
+ ///
+ ///
+ ///
+ [CakeMethodAlias]
+ [CakeAliasCategory(PullRequestsAliasConstants.PullRequestSystemCakeAliasCategory)]
+ public static IPullRequestSystem TfsPullRequests(
+ this ICakeContext context)
+ {
+ context.NotNull(nameof(context));
+
+ return context.TfsPullRequests(new TfsPullRequestSystemSettings());
+ }
+
///
/// Gets an object for writing issues to Team Foundation Server or Visual Studio Team Services pull request
/// using the specified settings.
///
/// The context.
/// Settings for accessing the pull request system.
- /// Object for writing issues to Team Foundation Server or Visual Studio Team Services pull request.
+ /// Object for writing issues to Team Foundation Server or Azure DevOps pull request.
///
/// Report code analysis issues reported as MsBuild warnings to a TFS pull request:
///
diff --git a/src/Cake.Issues.PullRequests.Tfs/TfsPullRequestSystemAliases.cs b/src/Cake.Issues.PullRequests.Tfs/TfsPullRequestSystemAliases.cs
index 3cb3172..518c7d3 100644
--- a/src/Cake.Issues.PullRequests.Tfs/TfsPullRequestSystemAliases.cs
+++ b/src/Cake.Issues.PullRequests.Tfs/TfsPullRequestSystemAliases.cs
@@ -4,7 +4,7 @@
///
/// Contains functionality related to writing code analysis issues to Team Foundation Server or
- /// Visual Studio Team Services pull requests.
+ /// Azure DevOps pull requests.
///
[CakeAliasCategory(IssuesAliasConstants.MainCakeAliasCategory)]
public static partial class TfsPullRequestSystemAliases
diff --git a/src/Cake.Issues.PullRequests.Tfs/TfsPullRequestSystemSettings.cs b/src/Cake.Issues.PullRequests.Tfs/TfsPullRequestSystemSettings.cs
index 53007cc..12ebd5d 100644
--- a/src/Cake.Issues.PullRequests.Tfs/TfsPullRequestSystemSettings.cs
+++ b/src/Cake.Issues.PullRequests.Tfs/TfsPullRequestSystemSettings.cs
@@ -18,7 +18,7 @@ public class TfsPullRequestSystemSettings : TfsPullRequestSettings
/// URLs using SSH scheme are converted to HTTPS.
/// Branch for which the pull request is made.
/// Credentials to use to authenticate against Team Foundation Server or
- /// Visual Studio Team Services.
+ /// Azure DevOps.
public TfsPullRequestSystemSettings(Uri repositoryUrl, string sourceBranch, ITfsCredentials credentials)
: base(repositoryUrl, sourceBranch, credentials)
{
@@ -33,7 +33,7 @@ public TfsPullRequestSystemSettings(Uri repositoryUrl, string sourceBranch, ITfs
/// URLs using SSH scheme are converted to HTTPS.
/// ID of the pull request.
/// Credentials to use to authenticate against Team Foundation Server or
- /// Visual Studio Team Services.
+ /// Azure DevOps.
public TfsPullRequestSystemSettings(Uri repositoryUrl, int pullRequestId, ITfsCredentials credentials)
: base(repositoryUrl, pullRequestId, credentials)
{
@@ -49,6 +49,27 @@ public TfsPullRequestSystemSettings(TfsPullRequestSettings settings)
{
}
+ ///
+ /// Initializes a new instance of the class
+ /// based on the environment variables set by the Azure Pipelines / TFS build.
+ ///
+ /// Credentials to use to authenticate against Team Foundation Server or
+ /// Azure DevOps.
+ public TfsPullRequestSystemSettings(ITfsCredentials credentials)
+ : base(credentials)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the class
+ /// based on the environment variables set by the Azure Pipelines / TFS build
+ /// using the build authentication token.
+ ///
+ public TfsPullRequestSystemSettings()
+ : base(UsingTfsBuildOAuthToken())
+ {
+ }
+
///
/// Gets or sets a value indicating whether pull request system should check if commit Id
/// is still up to date before posting comments.
diff --git a/tools/packages.config b/tools/packages.config
index 227ecd9..0501888 100644
--- a/tools/packages.config
+++ b/tools/packages.config
@@ -1,4 +1,4 @@
-
+