Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add include-pre-releases configuration option #1302

Merged
merged 11 commits into from Feb 21, 2023

Conversation

robbinjanssen
Copy link
Contributor

@robbinjanssen robbinjanssen commented Jan 20, 2023

The change introduced in #1240 broke the release flow for some people. By adding a configuration option to include-pre-releases we can make this work for everybody :-) The default is false so the behaviour introduced in #1240 will be the default behaviour.

tl;dr - If you want to allow pre-releases to count as releases, add include-pre-releases: true to your config

Closes #1291
Closes #1293


When merging, please squash :-)

@robbinjanssen robbinjanssen marked this pull request as draft January 20, 2023 13:29
@robbinjanssen robbinjanssen changed the title Add exclude pre release configuration option feat: Add exclude-pre-releases configuration option Jan 28, 2023
@robbinjanssen robbinjanssen marked this pull request as ready for review January 28, 2023 13:02
@robbinjanssen
Copy link
Contributor Author

@jetersen ready for review :)

@robbinjanssen robbinjanssen changed the title feat: Add exclude-pre-releases configuration option feat: Add exclude-pre-releases configuration option Jan 28, 2023
Copy link
Contributor

@blast-hardcheese blast-hardcheese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two maintainability considerations, but lgtm other than that

lib/releases.js Outdated Show resolved Hide resolved
lib/releases.js Outdated
@@ -57,7 +58,9 @@ const findReleases = async ({
? commitishFilteredReleases.filter((r) => r.tag_name.startsWith(tagPrefix))
: commitishFilteredReleases
const sortedPublishedReleases = sortReleases(
filteredReleases.filter((r) => !r.draft && !r.prerelease)
filteredReleases.filter(
(r) => !r.draft && (!excludePreReleases || !r.prerelease)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logic checks out, but it doesn't read right.

!r.draft && (!r.prerelease || includePreReleases)

would be preferable.

I'm quite concerned about the amount of boolean logic in this function already which is why I'm even giving this a comment. It probably needs to get reflowed entirely, but that's out of scope here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed the configuration to include-pre-releases which makes more sense :) Thanks for your input!

@robbinjanssen robbinjanssen changed the title feat: Add exclude-pre-releases configuration option feat: Add include-pre-releases configuration option Feb 4, 2023
Copy link
Contributor

@blast-hardcheese blast-hardcheese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thank you!

@robbinjanssen
Copy link
Contributor Author

@jetersen sorry to poke you, but can you have a look at this PR and decide whether or not you want this at all?

Copy link
Member

@jetersen jetersen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jetersen jetersen added the type: feature New feature or request label Feb 21, 2023
@jetersen jetersen changed the title feat: Add include-pre-releases configuration option Add include-pre-releases configuration option Feb 21, 2023
@jetersen jetersen merged commit e11806d into release-drafter:master Feb 21, 2023
@jetersen
Copy link
Member

@robbinjanssen Thanks for the PR, sorry for not getting back to you sooner.
@blast-hardcheese Thanks for the review, greatly appreciated 👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature New feature or request
Projects
None yet
3 participants