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 config to override GitHub's target_commitish values #1061
Comments
This is specially useful if you there are beta and/or RC releases but still want to include all pull requests in the final release. commitish_overrides = [
{
"tag_name": "v1.2.0-RC*",
"target_commitish": "foo"
}
]; This way these releases are skipped by release drafter, still including all their merged pull requests in the release notes. I really like this feature. |
I am adding release drafter to more than 20 repos and I already have problems which this feature definitely would solve. |
@jetersen If you give me green light I will try to come up with a pull request the next days. |
@mkurz IMO the "easy" path of not setting
No |
@mikeroll should we consider removing |
@jetersen I think it still kinda makes sense if someone wants this for whatever reason (
|
Sorry for adding to the confusion - this has nothing to do with my PR. The actual problem is that release search and commit search are completely independent, with release search being rather dumb - just sort by version/date and take the latest. |
I will have a look this week again, I am a bit busy today. |
This is fixed by #1065 |
I think I found a solution to various problems people have been reporting.
First, let's imagine following use case (A-G are merge commits, X are tags):
We have a default
main
branch. At some point, after merging A,B and C we release versionv1.0.0
. So thetarget_commitish
for this tag ismain
. Nothing special so far.Now we continue developing on the main branch and release (or plan to release) a
v2.0.0
release. At some point we branch off a1.x
branch frommain
to release hotfix versionv1.0.1
which only contains E.We configure a release drafter workflow for that
1.x
branch to get nice release notes for thatv1.0.1
we plan to release, however the problem is, the last release it recognizes isv2.0.0
. OK, no problem, lets just setfilter-by-commitish: true
, so it filters:release-drafter/lib/releases.js
Lines 32 to 34 in 2f7ebf8
The problem here is that, like mentioned, the
target_commitish
for thev1.0.0
tag ismain
(and not1.x
), that means release drafter does not recognizev1.0.0
as previous release and includes A, B and C (in addition to E) in the release notes forv1.0.1
(but it should contain only E). I could of course change thetarget_commitish
value forv1.0.0
withcurl
and the GitHub api to1.x
, however this is not a good idea, because now, if we haven't releasedv2.0.0
yet, the release notes for the default branch will be wrong.After thinking a while how to solve that problem I think the solution for it (and other problems) is that we need to be able to override the
target_commitish
values reported by the GitHub api. If we do that for the workflow for the1.x
branch, we could make release drafter believe that thetarget_commitish
forv1.0.0
is1.x
instead ofmain
and everything works perfectly.My idea is a config like:
The patch should be very simple, it needs to be places just before the above filtering happens, like in this line and will look something like this (not tested yet):
commitish_overrides
should be an array, so we can override multipletarget_commitish
, we could even make it support regex, likeThis config makes release drafter very flexible, like what you can do as well is:
If you you want to skip a release, like you have a release
v1.1.0
now you releasev1.2.0
, but made a mistake because it contains a regression and want to releasev1.3.0
with a fix, but want to have all PR of the 1.2.0 release in the 1.3.0 release notes as well, you can just "exclude" thev1.2.0
release by setting its target_commitish tofoo
or whatever so it won't be recognised and release drafter will thinkv1.1.0
was the last release.This would actually work for #422 as well.
(BTW: Everything I wrote here assume
filter-by-commitish: true
is set)@jetersen What do you think? After thinking about this for a while I think it makes a lot of sense. If you agree I will provide a pull request including tests.
The text was updated successfully, but these errors were encountered: