Skip to content

Commit

Permalink
Merge branch 'release/0.18.0'
Browse files Browse the repository at this point in the history
* release/0.18.0:
  (#580) Mark the integration test as "inconclusive"
  (test) Remove usage of Assert.AreEqual
  Bump NUnit from 3.14.0 to 4.1.0 in /src
  (test) Introduce NUnit.Analyzers
  Bump NGitLab from 6.39.0 to 6.51.1 in /src
  Bump Serilog.Sinks.Console and Serilog in /src
  Bump Microsoft.Extensions.DependencyInjection in /src
  Bump Microsoft.SourceLink.GitHub from 1.1.1 to 8.0.0 in /src
  Bump ApprovalTests from 5.9.0 to 6.0.0 in /src
  Bump Scriban from 5.9.0 to 5.10.0 in /src
  Bump Destructurama.Attributed and Serilog in /src
  Bump Microsoft.CodeAnalysis.NetAnalyzers from 7.0.4 to 8.0.0 in /src
  Bump Roslynator.Analyzers from 4.6.2 to 4.12.4 in /src
  (build) Skip running Codecov
  (#598) Upgrade Octokit reference
  • Loading branch information
gep13 committed Jul 10, 2024
2 parents 98dca9b + 8987ebd commit e467873
Show file tree
Hide file tree
Showing 15 changed files with 105 additions and 90 deletions.
3 changes: 2 additions & 1 deletion recipe.cake
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ BuildParameters.SetParameters(context: Context,
integrationTestScriptPath: "./tests/integration/tests.cake",
twitterMessage: standardNotificationMessage,
preferredBuildProviderType: BuildProviderType.GitHubActions,
gitterMessage: "@/all " + standardNotificationMessage);
gitterMessage: "@/all " + standardNotificationMessage,
shouldRunCodecov: false);

BuildParameters.PackageSources.Add(new PackageSourceData(Context, "GPR", "https://nuget.pkg.github.com/GitTools/index.json", FeedType.NuGet, false));

Expand Down
6 changes: 3 additions & 3 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.4">
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Serilog" Version="3.0.1" />
<PackageReference Include="Serilog" Version="4.0.0" />
<PackageReference Include="IDisposableAnalyzers" Version="4.0.7">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand All @@ -27,7 +27,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Roslynator.Analyzers" Version="4.6.2">
<PackageReference Include="Roslynator.Analyzers" Version="4.12.4">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>
Expand Down
10 changes: 5 additions & 5 deletions src/GitReleaseManager.Cli/GitReleaseManager.Cli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.9.1" />
<PackageReference Include="Destructurama.Attributed" Version="3.1.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PackageReference Include="Destructurama.Attributed" Version="4.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Octokit" Version="10.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.1.0" />
<PackageReference Include="Octokit" Version="12.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
<PackageReference Include="Serilog.Sinks.Debug" Version="2.0.0" PrivateAssets="All" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="seriloganalyzer" Version="0.15.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,19 @@
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="ApprovalTests" Version="5.9.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PackageReference Include="ApprovalTests" Version="6.0.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="NSubstitute" Version="5.1.0" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit" Version="4.1.0" />
<PackageReference Include="NUnit.Analyzers" Version="4.2.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="Octokit" Version="10.0.0" />
<PackageReference Include="Octokit" Version="12.0.0" />
<PackageReference Include="Shouldly" Version="4.2.1" />
</ItemGroup>
</Project>
10 changes: 5 additions & 5 deletions src/GitReleaseManager.Core/GitReleaseManager.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@

<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.9.1" />
<PackageReference Include="Destructurama.Attributed" Version="3.1.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PackageReference Include="Destructurama.Attributed" Version="4.0.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="NGitLab" Version="6.39.0" />
<PackageReference Include="Octokit" Version="10.0.0" />
<PackageReference Include="Scriban" Version="5.9.0" />
<PackageReference Include="NGitLab" Version="6.51.1" />
<PackageReference Include="Octokit" Version="12.0.0" />
<PackageReference Include="Scriban" Version="5.10.0" />
<PackageReference Include="seriloganalyzer" Version="0.15.0" />
<PackageReference Include="YamlDotNet" Version="13.7.1" />
<PackageReference Include="AutoMapper" Version="12.0.1" />
Expand Down
2 changes: 1 addition & 1 deletion src/GitReleaseManager.Core/Model/IssueComment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ public class IssueComment
/// <summary>
/// Gets or sets the issue comment Id.
/// </summary>
public int Id { get; set; }
public long Id { get; set; }

/// <summary>
/// Gets or sets details about the issue comment.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ public class GitLabProviderIntegrationTests
private GitLabProvider _gitLabProvider;
private IGitLabClient _gitLabClient;
private IMapper _mapper;
#pragma warning disable NUnit1032 // An IDisposable field/property should be Disposed in a TearDown method
private ILogger _logger;
#pragma warning restore NUnit1032 // An IDisposable field/property should be Disposed in a TearDown method

private string _token;
private string _releaseBaseTag;
Expand All @@ -48,6 +50,12 @@ public void OneTimeSetUp()
_gitLabProvider = new GitLabProvider(_gitLabClient, _mapper, _logger);
}

[OneTimeTearDown]
public void OneTimeTearDown()
{
(_logger as IDisposable)?.Dispose();
}

[Test]
[Order(1)]
public async Task Should_Get_Milestones()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,19 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="nunit" Version="3.14.0" />
<PackageReference Include="NUnit" Version="4.1.0" />
<PackageReference Include="NUnit.Analyzers" Version="4.2.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Shouldly" Version="4.2.1" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
<PackageReference Include="TextCopy" Version="6.2.1" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ namespace GitReleaseManager.IntegrationTests
public class ReleaseNotesBuilderIntegrationTests
{
private IGitHubClient _gitHubClient;
#pragma warning disable NUnit1032 // An IDisposable field/property should be Disposed in a TearDown method
private ILogger _logger;
#pragma warning restore NUnit1032 // An IDisposable field/property should be Disposed in a TearDown method
private IMapper _mapper;
private string _token;

Expand All @@ -34,57 +36,49 @@ public void Configure()
Log.Logger = _logger;

_token = Environment.GetEnvironmentVariable("GITTOOLS_GITHUB_TOKEN");
if (string.IsNullOrWhiteSpace(_token))
{
Assert.Inconclusive("Unable to locate credentials for accessing GitHub API");
}

_gitHubClient = new GitHubClient(new ProductHeaderValue("GitReleaseManager")) { Credentials = new Credentials(_token) };
}

[OneTimeTearDown]
public void TearDown()
{
Log.CloseAndFlush();
(_logger as IDisposable)?.Dispose();
}

[Test]
[Explicit]
public async Task SingleMilestone()
{
if (string.IsNullOrWhiteSpace(_token))
{
Assert.Inconclusive("Unable to locate credentials for accessing GitHub API");
}
else
{
var fileSystem = new FileSystem(new CreateSubOptions());
var currentDirectory = Environment.CurrentDirectory;
var configuration = ConfigurationProvider.Provide(currentDirectory, fileSystem);
var fileSystem = new FileSystem(new CreateSubOptions());
var currentDirectory = Environment.CurrentDirectory;
var configuration = ConfigurationProvider.Provide(currentDirectory, fileSystem);

var vcsProvider = new GitHubProvider(_gitHubClient, _mapper);
var releaseNotesBuilder = new ReleaseNotesBuilder(vcsProvider, _logger, fileSystem, configuration, new TemplateFactory(fileSystem, configuration, TemplateKind.Create));
var result = await releaseNotesBuilder.BuildReleaseNotesAsync("Chocolatey", "ChocolateyGUI", "0.12.4", ReleaseTemplates.DEFAULT_NAME).ConfigureAwait(false);
Debug.WriteLine(result);
ClipBoardHelper.SetClipboard(result);
}
var vcsProvider = new GitHubProvider(_gitHubClient, _mapper);
var releaseNotesBuilder = new ReleaseNotesBuilder(vcsProvider, _logger, fileSystem, configuration, new TemplateFactory(fileSystem, configuration, TemplateKind.Create));
var result = await releaseNotesBuilder.BuildReleaseNotesAsync("Chocolatey", "ChocolateyGUI", "0.12.4", ReleaseTemplates.DEFAULT_NAME).ConfigureAwait(false);
Debug.WriteLine(result);
ClipBoardHelper.SetClipboard(result);
}

[Test]
[Explicit]
public async Task SingleMilestone3()
{
if (string.IsNullOrWhiteSpace(_token))
{
Assert.Inconclusive("Unable to locate credentials for accessing GitHub API");
}
else
{
var fileSystem = new FileSystem(new CreateSubOptions());
var currentDirectory = Environment.CurrentDirectory;
var configuration = ConfigurationProvider.Provide(currentDirectory, fileSystem);
var fileSystem = new FileSystem(new CreateSubOptions());
var currentDirectory = Environment.CurrentDirectory;
var configuration = ConfigurationProvider.Provide(currentDirectory, fileSystem);

var vcsProvider = new GitHubProvider(_gitHubClient, _mapper);
var releaseNotesBuilder = new ReleaseNotesBuilder(vcsProvider, _logger, fileSystem, configuration, new TemplateFactory(fileSystem, configuration, TemplateKind.Create));
var result = await releaseNotesBuilder.BuildReleaseNotesAsync("Chocolatey", "ChocolateyGUI", "0.13.0", ReleaseTemplates.DEFAULT_NAME).ConfigureAwait(false);
Debug.WriteLine(result);
ClipBoardHelper.SetClipboard(result);
}
var vcsProvider = new GitHubProvider(_gitHubClient, _mapper);
var releaseNotesBuilder = new ReleaseNotesBuilder(vcsProvider, _logger, fileSystem, configuration, new TemplateFactory(fileSystem, configuration, TemplateKind.Create));
var result = await releaseNotesBuilder.BuildReleaseNotesAsync("Chocolatey", "ChocolateyGUI", "0.13.0", ReleaseTemplates.DEFAULT_NAME).ConfigureAwait(false);
Debug.WriteLine(result);
ClipBoardHelper.SetClipboard(result);
}

[Test]
Expand Down
14 changes: 7 additions & 7 deletions src/GitReleaseManager.Tests/ConfigurationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ public void Should_Read_Label_Aliases()
var config = ConfigSerializer.Read(stringReader);

// Then
Assert.AreEqual(2, config.LabelAliases.Count);
Assert.AreEqual("Bug", config.LabelAliases[0].Name);
Assert.AreEqual("Foo", config.LabelAliases[0].Header);
Assert.AreEqual("Bar", config.LabelAliases[0].Plural);
Assert.AreEqual("Improvement", config.LabelAliases[1].Name);
Assert.AreEqual("Baz", config.LabelAliases[1].Header);
Assert.AreEqual("Qux", config.LabelAliases[1].Plural);
Assert.That(2, Is.EqualTo(config.LabelAliases.Count));
Assert.That("Bug", Is.EqualTo(config.LabelAliases[0].Name));
Assert.That("Foo", Is.EqualTo(config.LabelAliases[0].Header));
Assert.That("Bar", Is.EqualTo(config.LabelAliases[0].Plural));
Assert.That("Improvement", Is.EqualTo(config.LabelAliases[1].Name));
Assert.That("Baz", Is.EqualTo(config.LabelAliases[1].Header));
Assert.That("Qux", Is.EqualTo(config.LabelAliases[1].Plural));
}
}

Expand Down
12 changes: 8 additions & 4 deletions src/GitReleaseManager.Tests/GitReleaseManager.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,18 @@
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="ApprovalTests" Version="5.9.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PackageReference Include="ApprovalTests" Version="6.0.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="NSubstitute" Version="5.1.0" />
<PackageReference Include="NUnit" Version="3.14.0" />
<PackageReference Include="NUnit" Version="4.1.0" />
<PackageReference Include="NUnit.Analyzers" Version="4.2.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="Octokit" Version="10.0.0" />
<PackageReference Include="Octokit" Version="12.0.0" />
</ItemGroup>
</Project>
Loading

0 comments on commit e467873

Please sign in to comment.