Fix latest tag retrieval for krel changelog #1135
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
/kind bug
What this PR does / why we need it:
The issue fixed with this commit is that we cannot say if the target tag
to be built already exists in the local repository, which made it
impossible to krel to behave in an expected way. If a tag during
changelog generation already locally exists (but not remotely) seems to
differ in
anago
, which is the reason we now use a different approach:remote as end SHA because we cannot know which branch is currently
checked out.
git.LatestGitHubTagsPerBranch
whichfetches the latest GitHub tags for each release branch and the
master. This follows the logic that
alpha
releases are only on themaster branch, whereas all other releases except the final tag are
available only on
release-x.y
branches. The latest tag for therelease branch (or master) will be our start commit for the release
notes generation.
Which issue(s) this PR fixes:
Refers to kubernetes/sig-release#999
Special notes for your reviewer:
The original relnotes script used this implementation to achieve the same goal:
release/lib/gitlib.sh
Lines 163 to 186 in cadfbd5
The general implementation has the drawback that we cannot generate changelogs for old releases any more, because we now rely on the latest tag from GitHub.
Does this PR introduce a user-facing change?: