Visitar URL original
Add `include-pre-releases` configuration option by robbinjanssen · Pull Request #1302 · release-drafter/release-drafter · GitHub
Skip to content

Add include-pre-releases configuration option - #1302

Merged
jetersen merged 11 commits into
release-drafter:masterfrom
robbinjanssen:master
Feb 21, 2023
Merged

jetersen merged 11 commits into
release-drafter:masterfrom
robbinjanssen:master

Conversation

@robbinjanssen

@robbinjanssen robbinjanssen commented Jan 20, 2023 •

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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

@blast-hardcheese blast-hardcheese left a comment

Copy link
Copy Markdown

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

Comment thread lib/releases.js Outdated
Comment thread lib/releases.js Outdated
const sortedPublishedReleases = sortReleases(
filteredReleases.filter((r) => !r.draft && !r.prerelease)
filteredReleases.filter(
(r) => !r.draft && (!excludePreReleases || !r.prerelease)

Copy link
Copy Markdown

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
Copy Markdown
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

@blast-hardcheese blast-hardcheese left a comment

Copy link
Copy Markdown

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
Copy Markdown
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?

@jetersen jetersen left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
Member

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

christopherklint97 pushed a commit to christopherklint97/release-drafter that referenced this pull request Mar 7, 2026
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

Development

Successfully merging this pull request may close these issues.

Introduce flag to consider pre-release version when drafting new release Pre-Release Changelogs - New Draft Releases has the same stuff like the pre release changelog

3 participants