Skip to content
This repository has been archived by the owner on Feb 16, 2021. It is now read-only.

Commit

Permalink
Merge branch 'release/0.8.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalberger committed Oct 17, 2019
2 parents 7a61c49 + 8bbc65e commit 02cd744
Show file tree
Hide file tree
Showing 19 changed files with 67 additions and 107 deletions.
6 changes: 5 additions & 1 deletion .appveyor.yml
Expand Up @@ -6,6 +6,10 @@ image: Visual Studio 2017
#---------------------------------#
# Build Script #
#---------------------------------#
install:
# Update to latest NuGet version since we require 5.3.0 for embedded icon
- ps: nuget update -self

build_script:
- ps: .\build.ps1 -Target AppVeyor

Expand All @@ -27,4 +31,4 @@ branches:
# Build Cache #
#---------------------------------#
cache:
- tools -> setup.cake
- tools -> recipe.cake
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
@@ -0,0 +1,3 @@
# These owners will be the default owners for everything in the repo and
# will be requested for review when someone opens a pull request.
* @pascalberger @christianbumann @x-jokay @silanosa @georgesgoetz
12 changes: 6 additions & 6 deletions README.md
Expand Up @@ -2,8 +2,8 @@

This addin for the Cake build automation system allows you to write issues from any code analyzer or linter as comments to pull requests.

For more information about this addin see the [Cake.Issues website](https://cake-contrib.github.io/Cake.Issues.Website)
and for general information about the Cake build automation system see the [Cake website](http://cakebuild.net)
For more information about this addin see the [Cake.Issues website](https://cakeissues.net)
and for general information about the Cake build automation system see the [Cake website](http://cakebuild.net).

[![License](http://img.shields.io/:license-mit-blue.svg)](https://github.com/cake-contrib/Cake.Issues.PullRequests/blob/develop/LICENSE)

Expand All @@ -19,22 +19,22 @@ and for general information about the Cake build automation system see the [Cake
| | Develop | Master |
|:--:|:--:|:--:|
|AppVeyor Windows|[![Build status](https://ci.appveyor.com/api/projects/status/w2gfo8792r6bxfia/branch/develop?svg=true)](https://ci.appveyor.com/project/cakecontrib/cake-issues-pullrequests/branch/develop)|[![Build status](https://ci.appveyor.com/api/projects/status/w2gfo8792r6bxfia/branch/master?svg=true)](https://ci.appveyor.com/project/cakecontrib/cake-issues-pullrequests/branch/master)|
|Azure DevOps Windows|[![Build Status](https://dev.azure.com/cake-contrib/Cake.Issues.PullRequests/_apis/build/status/cake-contrib.Cake.Issues.PullRequests?branchName=develop&jobName=Windows)](https://dev.azure.com/cake-contrib/Cake.Issues.PullRequests/_build/latest?definitionId=7?branchName=develop)|[![Build Status](https://dev.azure.com/cake-contrib/Cake.Issues.PullRequests/_apis/build/status/cake-contrib.Cake.Issues.PullRequests?branchName=master&jobName=Windows)](https://dev.azure.com/cake-contrib/Cake.Issues.PullRequests/_build/latest?definitionId=7?branchName=master)|
|Azure DevOps Windows|[![Build Status](https://dev.azure.com/cake-contrib/Cake.Issues.PullRequests/_apis/build/status/cake-contrib.Cake.Issues.PullRequests?branchName=develop&jobName=Windows)](https://dev.azure.com/cake-contrib/Cake.Issues.PullRequests/_build/latest?definitionId=7&branchName=develop)|[![Build Status](https://dev.azure.com/cake-contrib/Cake.Issues.PullRequests/_apis/build/status/cake-contrib.Cake.Issues.PullRequests?branchName=master&jobName=Windows)](https://dev.azure.com/cake-contrib/Cake.Issues.PullRequests/_build/latest?definitionId=7&branchName=master)|

## Code Coverage

[![Coverage Status](https://coveralls.io/repos/github/cake-contrib/Cake.Issues.PullRequests/badge.svg?branch=develop)](https://coveralls.io/github/cake-contrib/Cake.Issues.PullRequests?branch=develop)

## Quick Links

- [Documentation](https://cake-contrib.github.io/Cake.Issues.Website)
- [Documentation](https://cakeissues.net)

## Chat Room

Come join in the conversation about this addin in our Gitter Chat Room
Come join in the conversation about this addin in our Gitter Chat Room.

[![Join the chat at https://gitter.im/cake-contrib/Lobby](https://badges.gitter.im/cake-contrib/Lobby.svg)](https://gitter.im/cake-contrib/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

## Contributing

Contributions are welcome. See [Contribution Guidelines](CONTRIBUTING.md)
Contributions are welcome. See [Contribution Guidelines](CONTRIBUTING.md).
2 changes: 2 additions & 0 deletions azure-pipelines.yml
Expand Up @@ -6,6 +6,8 @@ trigger:

pr:
- develop
- release/*
- hotfix/*

jobs:
- job: Windows
Expand Down
4 changes: 2 additions & 2 deletions build.ps1
Expand Up @@ -35,7 +35,7 @@ http://cakebuild.net

[CmdletBinding()]
Param(
[string]$Script = "setup.cake",
[string]$Script = "recipe.cake",
[string]$Target = "Default",
[ValidateSet("Release", "Debug")]
[string]$Configuration = "Release",
Expand Down Expand Up @@ -181,4 +181,4 @@ if (!(Test-Path $CAKE_EXE)) {
# Start Cake
Write-Host "Running build script..."
Invoke-Expression "& `"$CAKE_EXE`" `"$Script`" -target=`"$Target`" -configuration=`"$Configuration`" -verbosity=`"$Verbosity`" $UseMono $UseDryRun $UseExperimental $ScriptArgs"
exit $LASTEXITCODE
exit $LASTEXITCODE
2 changes: 1 addition & 1 deletion build.sh 100644 → 100755
Expand Up @@ -11,7 +11,7 @@ NUGET_EXE=$TOOLS_DIR/nuget.exe
CAKE_EXE=$TOOLS_DIR/Cake/Cake.exe

# Define default arguments.
SCRIPT="setup.cake"
SCRIPT="recipe.cake"
TARGET="Default"
CONFIGURATION="Release"
VERBOSITY="verbose"
Expand Down
7 changes: 4 additions & 3 deletions nuspec/nuget/Cake.Issues.PullRequests.nuspec
Expand Up @@ -16,15 +16,16 @@ It requires the core Cake.Issues addin, addins for reading issues and an addin f
See the Project Site for an overview of the whole ecosystem of addins for working with issues in Cake scripts.
</description>
<license type="expression">MIT</license>
<projectUrl>http://cake-contrib.github.io/Cake.Issues.Website/</projectUrl>
<iconUrl>https://cdn.jsdelivr.net/gh/cake-contrib/graphics@a5cf0f881c390650144b2243ae551d5b9f836196/png/cake-contrib-medium.png</iconUrl>
<projectUrl>https://cakeissues.net</projectUrl>
<icon>icon.png</icon>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<repository type="git" url="https://github.com/cake-contrib/Cake.Issues.PullRequests.git"/>
<copyright>Copyright © BBT Software AG and contributors</copyright>
<tags>Cake Script Cake-Issues CodeAnalysis Linting Issues Pull-Requests</tags>
<releaseNotes>https://github.com/cake-contrib/Cake.Issues.PullRequests/releases/tag/0.7.0</releaseNotes>
<releaseNotes>https://github.com/cake-contrib/Cake.Issues.PullRequests/releases/tag/0.8.0</releaseNotes>
</metadata>
<files>
<file src="..\..\..\..\nuspec\nuget\icon.png" target="" />
<file src="netstandard2.0\Cake.Issues.PullRequests.dll" target="lib\netstandard2.0" />
<file src="netstandard2.0\Cake.Issues.PullRequests.pdb" target="lib\netstandard2.0" />
<file src="netstandard2.0\Cake.Issues.PullRequests.xml" target="lib\netstandard2.0" />
Expand Down
Binary file added nuspec/nuget/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions setup.cake → recipe.cake
Expand Up @@ -3,14 +3,15 @@
Environment.SetVariableNames();

BuildParameters.SetParameters(
context: Context,
context: Context,
buildSystem: BuildSystem,
sourceDirectoryPath: "./src",
title: "Cake.Issues.PullRequests",
repositoryOwner: "cake-contrib",
repositoryName: "Cake.Issues.PullRequests",
appVeyorAccountName: "cakecontrib",
shouldRunCodecov: false);
shouldRunCodecov: false,
shouldRunGitVersion: true);

BuildParameters.PrintParameters(Context);

Expand Down
16 changes: 0 additions & 16 deletions src/Cake.Issues.PullRequests.Tests/BasePullRequestSystemTests.cs
Expand Up @@ -139,22 +139,6 @@ public void Should_Return_Null_If_Capability_Does_Not_Exist()
}
}

public sealed class TheGetPreferredCommentFormatMethod
{
[Fact]
public void Should_Return_PlainText()
{
// Given
var pullRequestSystem = new FakePullRequestSystem(new FakeLog());

// When
var result = pullRequestSystem.GetPreferredCommentFormat();

// Then
result.ShouldBe(IssueCommentFormat.PlainText);
}
}

public sealed class ThePostDiscussionThreadsMethod
{
[Fact]
Expand Down
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.0</TargetFrameworks>
<TargetFrameworks>netcoreapp2.1</TargetFrameworks>
<IsPackable>false</IsPackable>
<Product>Cake.Issues</Product>
<Copyright>Copyright © BBT Software AG and contributors</Copyright>
Expand All @@ -10,13 +10,13 @@
<CodeAnalysisRuleSet>..\Cake.Issues.PullRequests.Tests.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
<PackageReference Include="Cake.Core" Version="0.33.0" />
<PackageReference Include="Cake.Testing" Version="0.33.0" />
<PackageReference Include="Cake.Issues" Version="0.7.0" />
<PackageReference Include="Cake.Issues.Testing" Version="0.7.0" />
<PackageReference Include="Cake.Issues" Version="0.8.0" />
<PackageReference Include="Cake.Issues.Testing" Version="0.8.0" />
<PackageReference Include="Shouldly" Version="3.0.2" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.0-beta009" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
</ItemGroup>
Expand Down
17 changes: 0 additions & 17 deletions src/Cake.Issues.PullRequests.Tests/FakePullRequestSystem.cs
Expand Up @@ -17,7 +17,6 @@ public class FakePullRequestSystem : BasePullRequestSystem
public FakePullRequestSystem(ICakeLog log)
: base(log)
{
this.Initialize();
}

/// <summary>
Expand Down Expand Up @@ -53,22 +52,11 @@ public FakePullRequestSystem(ICakeLog log)
/// </summary>
public IEnumerable<IIssue> PostedIssues => this.postedIssues;

/// <summary>
/// Gets or sets the preferred comment format returned with <see cref="GetPreferredCommentFormat"/>.
/// </summary>
public IssueCommentFormat CommentFormat { get; set; }

/// <summary>
/// Gets or sets a value indicating whether the pull request system should return false during <see cref="Initialize"/>.
/// </summary>
public bool ShouldFailOnInitialization { get; set; } = false;

/// <inheritdoc />
public override IssueCommentFormat GetPreferredCommentFormat()
{
return this.CommentFormat;
}

/// <inheritdoc />
public override bool Initialize(ReportIssuesToPullRequestSettings settings)
{
Expand All @@ -86,10 +74,5 @@ protected override void InternalPostDiscussionThreads(IEnumerable<IIssue> issues
// ReSharper disable once PossibleMultipleEnumeration
this.postedIssues.AddRange(issues);
}

private void Initialize()
{
this.CommentFormat = base.GetPreferredCommentFormat();
}
}
}
20 changes: 1 addition & 19 deletions src/Cake.Issues.PullRequests.Tests/OrchestratorTests.cs
Expand Up @@ -98,7 +98,7 @@ public void Should_Initialize_Pull_Request_System()
var issues = new List<IIssue>();

// When
var result = fixture.RunOrchestratorForIssues(issues);
fixture.RunOrchestratorForIssues(issues);

// Then
fixture.PullRequestSystem.Settings.ShouldBe(fixture.Settings);
Expand Down Expand Up @@ -215,24 +215,6 @@ public void Should_Throw_If_Settings_Are_Null()
result.IsArgumentNullException("settings");
}

[Theory]
[InlineData(IssueCommentFormat.Undefined)]
[InlineData(IssueCommentFormat.Html)]
[InlineData(IssueCommentFormat.Markdown)]
[InlineData(IssueCommentFormat.PlainText)]
public void Should_Use_The_Correct_Comment_Format(IssueCommentFormat format)
{
// Given
var fixture = new PullRequestsFixture();
fixture.PullRequestSystem.CommentFormat = format;

// When
fixture.RunOrchestratorForIssueProviders();

// Then
fixture.IssueProviders.ShouldAllBe(x => x.Format == format);
}

[Fact]
public void Should_Initialize_Pull_Request_System()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Cake.Issues.PullRequests.sln
Expand Up @@ -9,7 +9,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cake.Issues.PullRequests.Te
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{CE5FCC88-C4DE-4619-8DD7-9AC88A34F50B}"
ProjectSection(SolutionItems) = preProject
..\setup.cake = ..\setup.cake
..\recipe.cake = ..\recipe.cake
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "nuspec", "nuspec", "{9A8F9A5E-B006-4D55-9F84-BE8C47951BCE}"
Expand Down
6 changes: 0 additions & 6 deletions src/Cake.Issues.PullRequests/BasePullRequestSystem.cs
Expand Up @@ -43,12 +43,6 @@ public T GetCapability<T>()
return this.capabilities.OfType<T>().FirstOrDefault();
}

/// <inheritdoc/>
public virtual IssueCommentFormat GetPreferredCommentFormat()
{
return IssueCommentFormat.PlainText;
}

/// <inheritdoc/>
public void PostDiscussionThreads(IEnumerable<IIssue> issues, string commentSource)
{
Expand Down
6 changes: 3 additions & 3 deletions src/Cake.Issues.PullRequests/Cake.Issues.PullRequests.csproj
Expand Up @@ -26,8 +26,8 @@

<ItemGroup>
<PackageReference Include="Cake.Core" Version="0.33.0" />
<PackageReference Include="Cake.Issues" Version="0.7.0" />
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.2" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.0-beta009" />
<PackageReference Include="Cake.Issues" Version="0.8.0" />
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.6" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" />
</ItemGroup>
</Project>
6 changes: 0 additions & 6 deletions src/Cake.Issues.PullRequests/IPullRequestSystem.cs
Expand Up @@ -29,12 +29,6 @@ bool HasCapability<T>()
T GetCapability<T>()
where T : IPullRequestSystemCapability;

/// <summary>
/// Returns the preferred format for pull request comments.
/// </summary>
/// <returns>The preferred format for pull request comments.</returns>
IssueCommentFormat GetPreferredCommentFormat();

/// <summary>
/// Posts discussion threads for all issues which need to be posted.
/// </summary>
Expand Down

0 comments on commit 02cd744

Please sign in to comment.