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

Only use last full release when drafting #1240

Merged
merged 1 commit into from Jan 2, 2023

Conversation

ssbarnea
Copy link
Contributor

@ssbarnea ssbarnea commented Oct 2, 2022

Also disregards pre-releases in addition to drafts when drafting.

Fixes: #1135

@ssbarnea
Copy link
Contributor Author

ssbarnea commented Oct 3, 2022

On the other hand, I think I got something wrong because I switched to use release-drafter from the for and the changelog was still based on the last pre-release instead of taking only releases under consideration: https://github.com/ansible/ansible-lint/releases

My change was based on 9c77184

@jetersen
Copy link
Member

jetersen commented Oct 4, 2022

This should be || and not &&?
Cause your last prerelease is a not draft but it is a prerelease and then it is not filtered.

If you want both draft and prerelease filtered it should be ||

@jetersen
Copy link
Member

jetersen commented Oct 4, 2022

@ssbarnea does that solve your problem, with my suggested change?

@ssbarnea
Copy link
Contributor Author

ssbarnea commented Oct 4, 2022

@jetersen Testing it right now... I will reply with result.

@ssbarnea
Copy link
Contributor Author

ssbarnea commented Oct 4, 2022

@jetersen Sadly something does not work even with this new setting. I would have expected to add the new merged change on top of the already existing ones, not to start from zero.

lib/releases.js Outdated
@@ -57,7 +57,7 @@ const findReleases = async ({
? commitishFilteredReleases.filter((r) => r.tag_name.startsWith(tagPrefix))
: commitishFilteredReleases
const sortedPublishedReleases = sortReleases(
filteredReleases.filter((r) => !r.draft)
filteredReleases.filter((r) => !r.draft || !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.

I can't see how this could be anything but &&, unless it was filterNot

draft prerelease candidate
false false true
true false true
false true true
true true false

Only in the case that what's being evaluated is a draft for a prerelease does it not factor in. Presumably we want to only consider that which are not draft AND not prerelease.

I am on mobile though, so perhaps missing context, but && seems like it would work, you're saying it didn't?

Also disregards pre-releases in addition to drafts when drafting.

Fixes: release-drafter#1135
@ssbarnea
Copy link
Contributor Author

@jetersen I can confirm that with the new changes it works exactly as expected. Maybe we can get it in now?

@jetersen jetersen merged commit 7ef15e2 into release-drafter:master Jan 2, 2023
@jetersen jetersen added the type: feature New feature or request label Jan 2, 2023
@didix21
Copy link

didix21 commented Jan 4, 2023

Wondering, how can we use the previous behavior to this change? Is configurable?

@ssbarnea
Copy link
Contributor Author

ssbarnea commented Jan 4, 2023

AFAIK, Is not configurable and I personally do not think it should. A full release is always relative to previous full release. You cannot ask users of reeased version to read prerelease notes.

@didix21
Copy link

didix21 commented Jan 4, 2023

Well, I think it depends on the platform, in our case we use release drafter for generating new iOS releases. The thing is we create a prerelease and we upload it to Apple Store. While we're waiting to the Apple reviewers verdict, we still want to keep developing + when you set the release up as prerelease, the tag is already generated. So the next tag is release-drafter computing is the same because now it can't detect prereleases. (At least is the behaviour that I'm seeing now.)

@robbinjanssen
Copy link
Contributor

This has broken our release flow as well.. I think we do need to make this configurable.

@robbinjanssen
Copy link
Contributor

robbinjanssen commented Jan 28, 2023

I've created a pull request #1302 where you can config this behaviour. The default functionality will be the same as introduced by this PR.

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.

Release drafter should ignore prerelease releases when drafting changelog
5 participants