Skip to content

Commit e2866b9

Browse files
h9jianggopherbot
authored andcommitted
internal/task: remove unused log and improve on release note
- The go run release.go package command is not being executed in the publish execution step so the log is empty. - For insider release, the github release will now mention the insider release is a prerelease version of the next stable version. For golang/vscode-go#3500 Change-Id: I20f3aa9bea53fd25b06129fb702a907f62b6bffe Reviewed-on: https://go-review.googlesource.com/c/build/+/615977 Auto-Submit: Hongxiang Jiang <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Hyang-Ah Hana Kim <[email protected]>
1 parent 522b316 commit e2866b9

File tree

4 files changed

+41
-21
lines changed

4 files changed

+41
-21
lines changed

internal/task/releasevscodego.go

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -443,9 +443,7 @@ cat go-publish-output.log
443443
}
444444

445445
ctx.Printf("the output from npm ci:\n%s\n", outputs["npm-output.log"])
446-
ctx.Printf("the output from package generation:\n%s\n", outputs["go-package-output.log"])
447446
ctx.Printf("the output from package publication:\n%s\n", outputs["go-publish-output.log"])
448-
449447
return nil
450448
}
451449

@@ -509,6 +507,10 @@ type vscodeGoReleaseData struct {
509507
// Milestone is the tag containing issues for the current release.
510508
Milestone string
511509

510+
// NextStable is the next stable version. Only used if the current release is
511+
// insider release.
512+
NextStable string
513+
512514
// Body is the main content of the GitHub release notes after
513515
// the Git diff and milestone sections.
514516
Body string
@@ -585,17 +587,11 @@ func (r *ReleaseVSCodeGoTasks) vscodeGoGitHubReleaseBody(ctx context.Context, re
585587
}
586588
}
587589

590+
var data vscodeGoReleaseData
588591
current, previous := versionString(release, prerelease), versionString(previousRelease, previousPrerelease)
589-
data := vscodeGoReleaseData{
590-
CurrentTag: current,
591-
PreviousTag: previous,
592-
}
593592
// Insider version.
594593
if isVSCodeGoInsiderVersion(release, prerelease) {
595-
// For insider version, the milestone will point to the next stable minor.
596-
// If the insider version is vX.ODD.Z, the milestone will be vX.ODD+1.0.
597-
data.Milestone = releaseVersion{Major: release.Major, Minor: release.Minor + 1, Patch: 0}.String()
598-
594+
var body string
599595
if release.Patch == 0 {
600596
// An insider minor version release (vX.ODD.0) is normally a dummy release
601597
// immediately after a stable minor version release (vX.ODD-1.0).
@@ -604,35 +600,49 @@ func (r *ReleaseVSCodeGoTasks) vscodeGoGitHubReleaseBody(ctx context.Context, re
604600
const vscodeGoMinorInsiderFmt = `%s is a pre-release version identical to the official release %s, incorporating all the same bug fixes and improvements. This may include additional, experimental features that are not yet ready for general release. These features are still under development and may be subject to change or removal.
605601
606602
See release https://github.com/golang/vscode-go/releases/tag/%s for details.`
607-
data.Body = fmt.Sprintf(vscodeGoMinorInsiderFmt, current, previousRelease, previousRelease)
603+
body = fmt.Sprintf(vscodeGoMinorInsiderFmt, current, previousRelease, previousRelease)
608604
} else {
609605
// An insider patch version release (vX.ODD.Z Z > 0) is built from master
610606
// branch. The GitHub release body will be copied from the CHANGELOG.md
611607
// in master branch under heading ## Unreleased.
612-
data.Body, err = r.readChangeLogHeading(ctx, "Unreleased")
608+
body, err = r.readChangeLogHeading(ctx, "Unreleased")
613609
if err != nil {
614610
return "", err
615611
}
616612
}
613+
614+
nextStable := releaseVersion{Major: release.Major, Minor: release.Minor + 1, Patch: 0}.String()
615+
data = vscodeGoReleaseData{
616+
CurrentTag: current,
617+
PreviousTag: previous,
618+
// For insider version, the milestone will point to the next stable minor.
619+
// If the insider version is vX.ODD.Z, the milestone will be vX.ODD+1.0.
620+
Milestone: nextStable,
621+
NextStable: nextStable,
622+
Body: strings.TrimSpace(body),
623+
}
617624
} else {
618-
data.Milestone = release.String()
619-
// Stable version prerelease.
625+
var body string
620626
if prerelease != "" {
621627
// For prerelease, the main body of the release will contain the
622628
// instructions of installation.
623-
data.Body = vscodeGoPrereleaseInstallationInstructions
629+
body = vscodeGoPrereleaseInstallationInstructions
624630
} else if release.Patch == 0 {
625631
// The main body of the release will be copied from the CHANGELOG.md in
626632
// master branch under heading ## Unreleased.
627-
data.Body, err = r.readChangeLogHeading(ctx, "Unreleased")
633+
body, err = r.readChangeLogHeading(ctx, "Unreleased")
628634
if err != nil {
629635
return "", err
630636
}
631637
}
632-
}
633638

634-
// Remove any trailing spaces.
635-
data.Body = strings.TrimSpace(data.Body)
639+
data = vscodeGoReleaseData{
640+
CurrentTag: current,
641+
PreviousTag: previous,
642+
Milestone: release.String(),
643+
Body: strings.TrimSpace(body),
644+
}
645+
}
636646

637647
tmpl, err := template.New("vscode release").Parse(vscodeGoReleaseNoteTmpl)
638648
if err != nil {
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1+
{{- if .NextStable -}}
2+
This is the [pre-release version](https://code.visualstudio.com/api/working-with-extensions/publishing-extension#prerelease-extensions) of {{ .NextStable }}.
3+
4+
{{ end -}}
15
**Full Changelog**: https://github.com/golang/vscode-go/compare/{{.PreviousTag}}...{{.CurrentTag}}
2-
**Milestone**: https://github.com/golang/vscode-go/issues?q=milestone%3A{{.Milestone}}{{ if .Body }}
6+
**Milestone**: https://github.com/golang/vscode-go/issues?q=milestone%3A{{.Milestone}}
7+
{{- if .Body }}
38

4-
{{.Body}}{{ end }}
9+
{{.Body}}
10+
{{- end }}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
This is the [pre-release version](https://code.visualstudio.com/api/working-with-extensions/publishing-extension#prerelease-extensions) of v0.44.0.
2+
13
**Full Changelog**: https://github.com/golang/vscode-go/compare/v0.42.0-rc.1...v0.43.0
24
**Milestone**: https://github.com/golang/vscode-go/issues?q=milestone%3Av0.44.0
35

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
This is the [pre-release version](https://code.visualstudio.com/api/working-with-extensions/publishing-extension#prerelease-extensions) of v0.44.0.
2+
13
**Full Changelog**: https://github.com/golang/vscode-go/compare/v0.42.0-rc.1...v0.43.4
24
**Milestone**: https://github.com/golang/vscode-go/issues?q=milestone%3Av0.44.0
35

0 commit comments

Comments
 (0)