Skip to content

Commit e48f991

Browse files
committed
Merge branch 'release/0.5.0'
2 parents cbe119e + a1b11e9 commit e48f991

23 files changed

+459
-13
lines changed

BuildScripts/default.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ Task -Name __InstallChocolatey -Description $private -Action {
264264
}
265265

266266
exec {
267-
Invoke-Expression "$script:chocolateyCommand upgrade chocolatey -y";
267+
Invoke-Expression "$script:chocolateyCommand upgrade chocolatey -y -pre";
268268
}
269269

270270
Write-Output "Latest Chocolatey installed."

Source/GitReleaseManager.Cli/Options/PublishSubOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace GitReleaseManager.Cli.Options
88
{
99
using CommandLine;
1010

11-
[Verb("publish", HelpText = "Publishes the release notes and closes the milestone.")]
11+
[Verb("publish", HelpText = "Publishes the GitHub Release.")]
1212
public class PublishSubOptions : BaseGitHubSubOptions
1313
{
1414
[Option('t', "tagName", HelpText = "The name of the release (Typically this is the generated SemVer Version Number).", Required = true)]
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
//-----------------------------------------------------------------------
2+
// <copyright file="ConfigurationTests.cs" company="GitTools Contributors">
3+
// Copyright (c) 2015 - Present - GitTools Contributors
4+
// </copyright>
5+
//-----------------------------------------------------------------------
6+
7+
namespace GitReleaseManager.Tests
8+
{
9+
using System.IO;
10+
using GitReleaseManager.Core.Configuration;
11+
using NUnit.Framework;
12+
13+
[TestFixture]
14+
public class ConfigurationTests
15+
{
16+
[Test]
17+
public void Should_Read_Label_Aliases()
18+
{
19+
// Given
20+
var text = Resources.Default_Configuration_Yaml;
21+
22+
// When
23+
var config = ConfigSerializer.Read(new StringReader(text));
24+
25+
// Then
26+
Assert.AreEqual(2, config.LabelAliases.Count);
27+
Assert.AreEqual("Bug", config.LabelAliases[0].Name);
28+
Assert.AreEqual("Foo", config.LabelAliases[0].Header);
29+
Assert.AreEqual("Bar", config.LabelAliases[0].Plural);
30+
Assert.AreEqual("Improvement", config.LabelAliases[1].Name);
31+
Assert.AreEqual("Baz", config.LabelAliases[1].Header);
32+
Assert.AreEqual("Qux", config.LabelAliases[1].Plural);
33+
}
34+
}
35+
}

Source/GitReleaseManager.Tests/GitReleaseManager.Tests.csproj

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,18 @@
6868
<Compile Include="ApprovalTestConfig.cs" />
6969
<Compile Include="AssemblyInfo.cs" />
7070
<Compile Include="ClipBoardHelper.cs" />
71+
<Compile Include="ConfigurationTests.cs" />
7172
<Compile Include="FakeGitHubClient.cs" />
7273
<Compile Include="Helper.cs" />
7374
<Compile Include="ReleaseNotesBuilderIntegrationTests.cs" />
7475
<Compile Include="ClientBuilder.cs" />
7576
<Compile Include="ReleaseNotesBuilderTests.cs" />
7677
<Compile Include="ReleaseNotesExporterTests.cs" />
78+
<Compile Include="Resources.Designer.cs">
79+
<AutoGen>True</AutoGen>
80+
<DesignTime>True</DesignTime>
81+
<DependentUpon>Resources.resx</DependentUpon>
82+
</Compile>
7783
</ItemGroup>
7884
<ItemGroup>
7985
<None Include="packages.config">
@@ -86,6 +92,12 @@
8692
<Name>GitReleaseManager.Core</Name>
8793
</ProjectReference>
8894
</ItemGroup>
95+
<ItemGroup>
96+
<EmbeddedResource Include="Resources.resx">
97+
<Generator>ResXFileCodeGenerator</Generator>
98+
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
99+
</EmbeddedResource>
100+
</ItemGroup>
89101
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
90102
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
91103
<PropertyGroup>

Source/GitReleaseManager.Tests/ReleaseNotesBuilderIntegrationTests.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
// </copyright>
55
//-----------------------------------------------------------------------
66

7+
using System.Threading.Tasks;
8+
79
namespace GitReleaseManager.Tests
810
{
911
using System;
@@ -18,7 +20,7 @@ public class ReleaseNotesBuilderIntegrationTests
1820
{
1921
[Test]
2022
[Explicit]
21-
public async void SingleMilestone()
23+
public async Task SingleMilestone()
2224
{
2325
var gitHubClient = ClientBuilder.Build();
2426
var fileSystem = new FileSystem();
@@ -33,7 +35,7 @@ public async void SingleMilestone()
3335

3436
[Test]
3537
[Explicit]
36-
public async void SingleMilestone3()
38+
public async Task SingleMilestone3()
3739
{
3840
var gitHubClient = ClientBuilder.Build();
3941
var fileSystem = new FileSystem();
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
As part of this release we had [5 commits](https://github.com/TestUser/FakeRepository/commits/1.2.3) which resulted in [2 issues](https://github.com/FakeRepository/issues/issues?milestone=0&state=closed) being closed.
2+
3+
4+
__Bug__
5+
6+
- [__#2__](http://example.com/2) Issue 2
7+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
As part of this release we had [1 commit](https://github.com/TestUser/FakeRepository/commits/1.2.3) which resulted in [1 issue](https://github.com/FakeRepository/issues/issues?milestone=0&state=closed) being closed.
2+
3+
4+
__Foo__
5+
6+
- [__#1__](http://example.com/1) Issue 1
7+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
As part of this release we had [5 commits](https://github.com/TestUser/FakeRepository/commits/1.2.3) which resulted in [1 issue](https://github.com/FakeRepository/issues/issues?milestone=0&state=closed) being closed.
2+
3+
4+
__Help Wanted__
5+
6+
- [__#1__](http://example.com/1) Issue 1
7+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
As part of this release we had [5 commits](https://github.com/TestUser/FakeRepository/commits/1.2.3) which resulted in [2 issues](https://github.com/FakeRepository/issues/issues?milestone=0&state=closed) being closed.
2+
3+
4+
__Bar__
5+
6+
- [__#1__](http://example.com/1) Issue 1
7+
- [__#2__](http://example.com/2) Issue 2
8+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
As part of this release we had [5 commits](https://github.com/TestUser/FakeRepository/commits/1.2.3) which resulted in [2 issues](https://github.com/FakeRepository/issues/issues?milestone=0&state=closed) being closed.
2+
3+
4+
__Help Wanteds__
5+
6+
- [__#1__](http://example.com/1) Issue 1
7+
- [__#2__](http://example.com/2) Issue 2
8+

Source/GitReleaseManager.Tests/ReleaseNotesBuilderTests.cs

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,38 @@ public void SomeCommitsSingularIssues()
7272
AcceptTest(5, CreateIssue(1, "Bug"));
7373
}
7474

75+
[Test]
76+
public void SingularCommitsWithHeaderLabelAlias()
77+
{
78+
var config = new Config();
79+
config.LabelAliases.Add(new LabelAlias
80+
{
81+
Name = "Bug",
82+
Header = "Foo"
83+
});
84+
85+
AcceptTest(1, config, CreateIssue(1, "Bug"));
86+
}
87+
88+
[Test]
89+
public void SomeCommitsWithPluralizedLabelAlias()
90+
{
91+
var config = new Config();
92+
config.LabelAliases.Add(new LabelAlias
93+
{
94+
Name = "Help Wanted",
95+
Plural = "Bar",
96+
});
97+
98+
AcceptTest(5, config, CreateIssue(1, "Help Wanted"), CreateIssue(2, "Help Wanted"));
99+
}
100+
101+
[Test]
102+
public void SomeCommitsWithoutPluralizedLabelAlias()
103+
{
104+
AcceptTest(5, CreateIssue(1, "Help Wanted"), CreateIssue(2, "Help Wanted"));
105+
}
106+
75107
[Test]
76108
public void NoCommitsWrongIssueLabel()
77109
{
@@ -84,12 +116,23 @@ public void SomeCommitsWrongIssueLabel()
84116
Assert.Throws<AggregateException>(() => AcceptTest(5, CreateIssue(1, "Test")));
85117
}
86118

119+
[Test]
120+
public void CorrectlyExcludeIssues()
121+
{
122+
AcceptTest(5, CreateIssue(1, "Internal Refactoring"), CreateIssue(2, "Bug"));
123+
}
124+
87125
private static void AcceptTest(int commits, params Issue[] issues)
126+
{
127+
AcceptTest(commits, null, issues);
128+
}
129+
130+
private static void AcceptTest(int commits, Config config, params Issue[] issues)
88131
{
89132
var fakeClient = new FakeGitHubClient();
90133
var fileSystem = new FileSystem();
91134
var currentDirectory = Environment.CurrentDirectory;
92-
var configuration = ConfigurationProvider.Provide(currentDirectory, fileSystem);
135+
var configuration = config ?? ConfigurationProvider.Provide(currentDirectory, fileSystem);
93136

94137
fakeClient.Milestones.Add(CreateMilestone("1.2.3"));
95138

Source/GitReleaseManager.Tests/Resources.Designer.cs

Lines changed: 99 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)