Skip to content

Commit

Permalink
internal/task: fix a bug to show diff against last stable version
Browse files Browse the repository at this point in the history
Only the stable version (Y is even) have release candidate, when
releasing a stable minor version (vX.EVEN.0), the release note should
show the diff between current version (vX.EVEN.0) and the latest patch
of the last stable version(vX.EVEN-2.LATEST).

For golang/vscode-go#3500

Change-Id: Ia1ed84d2b2da0789a3e3410f96ad7b6db007174b
Reviewed-on: https://go-review.googlesource.com/c/build/+/613598
Reviewed-by: Hyang-Ah Hana Kim <[email protected]>
Auto-Submit: Hongxiang Jiang <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
  • Loading branch information
h9jiang authored and gopherbot committed Sep 17, 2024
1 parent 31c4176 commit c0af794
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/task/releasevscodego.go
Original file line number Diff line number Diff line change
Expand Up @@ -420,12 +420,12 @@ func (r *ReleaseVSCodeGoTasks) createGitHubReleaseAsDraft(ctx *wf.TaskContext, r
// The release notes will display the differences between the current release
// and the appropriate previous release.
// - For minor versions (vX.Y.0), the diff is shown against the latest patch
// of the previous minor version (vX.Y-1.Z).
// of the previous stable minor version (vX.Y-2.Z).
// - For patch versions (vX.Y.Z), the diff is shown against the previous
// patch version (vX.Y.Z-1).
var previous releaseVersion
if release.Patch == 0 {
previous, _ = latestVersion(tags, isSameMajorMinor(release.Major, release.Minor-1), isReleaseVersion)
previous, _ = latestVersion(tags, isSameMajorMinor(release.Major, release.Minor-2), isReleaseVersion)
} else {
previous, _ = latestVersion(tags, isSameMajorMinor(release.Major, release.Minor), isReleaseVersion)
}
Expand Down

0 comments on commit c0af794

Please sign in to comment.