Skip to content

Commit dca1b92

Browse files
committed
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 <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent cbfd34f commit dca1b92

9 files changed

+26
-2
lines changed

internal/task/releasevscodego.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,8 @@ func vsixFileName(release releaseVersion, prerelease string) string {
498498
// vscodeGoReleaseData holds data for the "vscode-go" extension release notes
499499
// template.
500500
type vscodeGoReleaseData struct {
501+
Date string
502+
501503
// PreviousTag and CurrentTag are tags used to show the differences between
502504
// the current release and the previous one.
503505
PreviousTag string
@@ -612,6 +614,7 @@ See release https://github.com/golang/vscode-go/releases/tag/%s for details.`
612614

613615
nextStable := releaseVersion{Major: release.Major, Minor: release.Minor + 1, Patch: 0}.String()
614616
data = vscodeGoReleaseData{
617+
Date: time.Now().Format(time.DateOnly),
615618
CurrentTag: current,
616619
PreviousTag: previous,
617620
// 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.`
636639
}
637640

638641
data = vscodeGoReleaseData{
642+
Date: time.Now().Format(time.DateOnly),
639643
CurrentTag: current,
640644
PreviousTag: previous,
641645
Milestone: release.String(),

internal/task/releasevscodego_test.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -688,12 +688,17 @@ CHANGE FOR v0.42.0 LINE 2
688688
Gerrit: gerrit,
689689
}
690690

691-
got, err := tasks.vscodeGoGitHubReleaseBody(ctx, tc.release, tc.prerelease)
691+
gotBody, err := tasks.vscodeGoGitHubReleaseBody(ctx, tc.release, tc.prerelease)
692692
if err != nil {
693693
t.Fatal(err)
694694
}
695695

696-
if diff := cmp.Diff(testdataFile(t, tc.wantContent), got); diff != "" {
696+
697+
re := regexp.MustCompile(`Date: (.*)\n`)
698+
want := re.ReplaceAllString(testdataFile(t, tc.wantContent), "\n")
699+
got := re.ReplaceAllString(string(gotBody), "\n")
700+
701+
if diff := cmp.Diff(want, got); diff != "" {
697702
t.Errorf("body text mismatch (-want +got):\n%s", diff)
698703
}
699704
})

internal/task/template/vscode-go-release-note.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
This is the [pre-release version](https://code.visualstudio.com/api/working-with-extensions/publishing-extension#prerelease-extensions) of {{ .NextStable }}.
33

44
{{ end -}}
5+
6+
Date: {{ .Date }}
7+
58
**Full Changelog**: https://github.com/golang/vscode-go/compare/{{.PreviousTag}}...{{.CurrentTag}}
69
**Milestone**: https://github.com/golang/vscode-go/issues?q=milestone%3A{{.Milestone}}
710
{{- if .Body }}

internal/task/testdata/vscode-go-next-insider-minor.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
This is the [pre-release version](https://code.visualstudio.com/api/working-with-extensions/publishing-extension#prerelease-extensions) of v0.44.0.
22

3+
Date: 2002-01-02
4+
35
**Full Changelog**: https://github.com/golang/vscode-go/compare/v0.42.0-rc.1...v0.43.0
46
**Milestone**: https://github.com/golang/vscode-go/issues?q=milestone%3Av0.44.0
57

internal/task/testdata/vscode-go-next-insider-patch.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
This is the [pre-release version](https://code.visualstudio.com/api/working-with-extensions/publishing-extension#prerelease-extensions) of v0.44.0.
22

3+
Date: 2002-01-02
4+
35
**Full Changelog**: https://github.com/golang/vscode-go/compare/v0.42.0-rc.1...v0.43.4
46
**Milestone**: https://github.com/golang/vscode-go/issues?q=milestone%3Av0.44.0
57

internal/task/testdata/vscode-go-next-stable-minor.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
Date: 2002-01-02
2+
13
**Full Changelog**: https://github.com/golang/vscode-go/compare/v0.42.1...v0.44.0
24
**Milestone**: https://github.com/golang/vscode-go/issues?q=milestone%3Av0.44.0
35

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
Date: 2002-01-02
2+
13
**Full Changelog**: https://github.com/golang/vscode-go/compare/v0.42.1...v0.42.2
24
**Milestone**: https://github.com/golang/vscode-go/issues?q=milestone%3Av0.42.2

internal/task/testdata/vscode-go-rc-next-stable-minor.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
Date: 2002-01-02
2+
13
**Full Changelog**: https://github.com/golang/vscode-go/compare/v0.42.1...v0.44.0-rc.4
24
**Milestone**: https://github.com/golang/vscode-go/issues?q=milestone%3Av0.44.0
35

internal/task/testdata/vscode-go-rc-next-stable-patch.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
Date: 2002-01-02
2+
13
**Full Changelog**: https://github.com/golang/vscode-go/compare/v0.42.1...v0.42.2-rc.3
24
**Milestone**: https://github.com/golang/vscode-go/issues?q=milestone%3Av0.42.2
35

0 commit comments

Comments
 (0)