internal/task: include date in vscode-go github release note

For golang/vscode-go#3500

Change-Id: I24844b96621d641cbb50378ea7a4adbdd38975f4
Reviewed-on: https://go-review.googlesource.com/c/build/+/617477
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
Hongxiang Jiang 2024-10-02 20:55:10 +00:00
Родитель cbfd34f99b
Коммит dca1b92380
9 изменённых файлов: 26 добавлений и 2 удалений

Просмотреть файл

@ -498,6 +498,8 @@ func vsixFileName(release releaseVersion, prerelease string) string {
// vscodeGoReleaseData holds data for the "vscode-go" extension release notes
// template.
type vscodeGoReleaseData struct {
Date string
// PreviousTag and CurrentTag are tags used to show the differences between
// the current release and the previous one.
PreviousTag string
@ -612,6 +614,7 @@ See release https://github.com/golang/vscode-go/releases/tag/%s for details.`
nextStable := releaseVersion{Major: release.Major, Minor: release.Minor + 1, Patch: 0}.String()
data = vscodeGoReleaseData{
Date: time.Now().Format(time.DateOnly),
CurrentTag: current,
PreviousTag: previous,
// For insider version, the milestone will point to the next stable minor.
@ -636,6 +639,7 @@ See release https://github.com/golang/vscode-go/releases/tag/%s for details.`
}
data = vscodeGoReleaseData{
Date: time.Now().Format(time.DateOnly),
CurrentTag: current,
PreviousTag: previous,
Milestone: release.String(),

Просмотреть файл

@ -688,12 +688,17 @@ CHANGE FOR v0.42.0 LINE 2
Gerrit: gerrit,
}
got, err := tasks.vscodeGoGitHubReleaseBody(ctx, tc.release, tc.prerelease)
gotBody, err := tasks.vscodeGoGitHubReleaseBody(ctx, tc.release, tc.prerelease)
if err != nil {
t.Fatal(err)
}
if diff := cmp.Diff(testdataFile(t, tc.wantContent), got); diff != "" {
re := regexp.MustCompile(`Date: (.*)\n`)
want := re.ReplaceAllString(testdataFile(t, tc.wantContent), "\n")
got := re.ReplaceAllString(string(gotBody), "\n")
if diff := cmp.Diff(want, got); diff != "" {
t.Errorf("body text mismatch (-want +got):\n%s", diff)
}
})

Просмотреть файл

@ -2,6 +2,9 @@
This is the [pre-release version](https://code.visualstudio.com/api/working-with-extensions/publishing-extension#prerelease-extensions) of {{ .NextStable }}.
{{ end -}}
Date: {{ .Date }}
**Full Changelog**: https://github.com/golang/vscode-go/compare/{{.PreviousTag}}...{{.CurrentTag}}
**Milestone**: https://github.com/golang/vscode-go/issues?q=milestone%3A{{.Milestone}}
{{- if .Body }}

Просмотреть файл

@ -1,5 +1,7 @@
This is the [pre-release version](https://code.visualstudio.com/api/working-with-extensions/publishing-extension#prerelease-extensions) of v0.44.0.
Date: 2002-01-02
**Full Changelog**: https://github.com/golang/vscode-go/compare/v0.42.0-rc.1...v0.43.0
**Milestone**: https://github.com/golang/vscode-go/issues?q=milestone%3Av0.44.0

Просмотреть файл

@ -1,5 +1,7 @@
This is the [pre-release version](https://code.visualstudio.com/api/working-with-extensions/publishing-extension#prerelease-extensions) of v0.44.0.
Date: 2002-01-02
**Full Changelog**: https://github.com/golang/vscode-go/compare/v0.42.0-rc.1...v0.43.4
**Milestone**: https://github.com/golang/vscode-go/issues?q=milestone%3Av0.44.0

Просмотреть файл

@ -1,3 +1,5 @@
Date: 2002-01-02
**Full Changelog**: https://github.com/golang/vscode-go/compare/v0.42.1...v0.44.0
**Milestone**: https://github.com/golang/vscode-go/issues?q=milestone%3Av0.44.0

Просмотреть файл

@ -1,2 +1,4 @@
Date: 2002-01-02
**Full Changelog**: https://github.com/golang/vscode-go/compare/v0.42.1...v0.42.2
**Milestone**: https://github.com/golang/vscode-go/issues?q=milestone%3Av0.42.2

Просмотреть файл

@ -1,3 +1,5 @@
Date: 2002-01-02
**Full Changelog**: https://github.com/golang/vscode-go/compare/v0.42.1...v0.44.0-rc.4
**Milestone**: https://github.com/golang/vscode-go/issues?q=milestone%3Av0.44.0

Просмотреть файл

@ -1,3 +1,5 @@
Date: 2002-01-02
**Full Changelog**: https://github.com/golang/vscode-go/compare/v0.42.1...v0.42.2-rc.3
**Milestone**: https://github.com/golang/vscode-go/issues?q=milestone%3Av0.42.2