Skip to content

Add filter option for project-specific entries to SetReleaseNotesProperty task #48

@ermshiperete

Description

@ermshiperete

Summary

This new feature adds a filter option to the SetReleaseNotesProperty task which allows to filter out any entries that don't belong to a specific nuget package. To achieve this we add a new property FilterEntries that controls whether or not the new feature is enabled for a project.

Specification

  • the user can set the FilterEntries property in his .csproj file. If the property value evaluates true, the new filter option is
    enabled. If it evaluates to false or the property is not set, the filter option is disabled. This is the behavior that's implemented
    in version<= 2.5.0.
  • if the filter option is enabled, only entries without a tag or with a tag matching the current project are output. The tag itself is stripped off.
  • if the filter option is disabled, all entries are output.

Examples

CHANGELOG.md file

Given the following snippet of a CHANGELOG.md file:

...
## [Unreleased]

## [2.5.0] - 2021-02-22

### Added

- [MyProject1] Add `DoSomething()` method to `Foo`
- `ReadMe.md` Lorem ipsem

### Fixed

- [Some.OtherProject] Fix crash in `FooBar`

## [2.4.0] - 2021-01-22
...

Filter option enabled

If MyProject1.csproj sets the FilterEntries property:

<Project Sdk="Microsoft.NET.Sdk">
	<PropertyGroup>
            ...
		<FilterEntries>true</FilterEntries>
            ...
	</PropertyGroup>
        ...
</Project>

then the ReleaseNotesProperty will contain the following when building version 2.4.0 of MyProject1:

Changes since version 2.4.0

Added:
- Add `DoSomething()` method to `Foo`
- `ReadMe.md` Lorem ipsem

If likewise Some.Project.csproj sets FilterEntries and creates a nuget package Some.OtherProject (PackageId property):

<Project Sdk="Microsoft.NET.Sdk">
	<PropertyGroup>
            ...
		<FilterEntries>true</FilterEntries>
		<PackageId>Some.OtherProject</PackageId>
            ...
	</PropertyGroup>
        ...
</Project>

The output would be for Some.OtherProject:

Changes since version 2.4.0

Added:
- `ReadMe.md` Lorem ipsem

Fixed:
- Fix crash in `FooBar`

Filter option disabled

If neither project sets the FilterEntries property, the output would be identical for both projects:

Changes since version 2.4.0

Added:
- [MyProject1] Add `DoSomething()` method to `Foo`
- `ReadMe.md` Lorem ipsem

Fixed:
- [Some.OtherProject] Fix crash in `FooBar`

ToDo

  • implement filter option
  • add unit tests
  • update documentation
  • update changelog
  • mention +semver:minor in commit message

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions