@@ -61,8 +61,8 @@ func (r *ReleaseGoplsTasks) NewPrereleaseDefinition() *wf.Definition {
6161 prereleaseVerified := wf .Action1 (wd , "verify installing latest gopls using release branch pre-release version" , r .verifyGoplsInstallation , prereleaseVersion )
6262 wf .Action4 (wd , "mail announcement" , r .mailAnnouncement , semv , prereleaseVersion , dependencyCommit , issue , wf .After (prereleaseVerified ))
6363
64- vsCodeGoChanges := wf .Task3 (wd , "update gopls version in vscode-go project" , r .updateGoplsVersionInVSCodeGo , reviewers , issue , prereleaseVersion , wf .After (prereleaseVerified ))
65- _ = wf .Task1 (wd , "await gopls version update CL submission in vscode-go project" , clAwaiter {r .Gerrit }.awaitSubmissions , vsCodeGoChanges )
64+ vscodeGoChange := wf .Task4 (wd , "update gopls version in vscode-go project" , r .updateGoplsVersionInVSCodeGo , reviewers , issue , prereleaseVersion , wf . Const ( "master" ) , wf .After (prereleaseVerified ))
65+ _ = wf .Task1 (wd , "await gopls version update CL submission in vscode-go project" , clAwaiter {r .Gerrit }.awaitSubmission , vscodeGoChange )
6666
6767 wf .Output (wd , "version" , prereleaseVersion )
6868
@@ -470,51 +470,38 @@ func (r *ReleaseGoplsTasks) mailAnnouncement(ctx *wf.TaskContext, semv semversio
470470 return r .SendMail (r .AnnounceMailHeader , content )
471471}
472472
473- func (r * ReleaseGoplsTasks ) updateGoplsVersionInVSCodeGo (ctx * wf.TaskContext , reviewers []string , issue int64 , version string ) ([]string , error ) {
474- releaseBranch , err := vsCodeGoActiveReleaseBranch (ctx , r .Gerrit )
473+ func (r * ReleaseGoplsTasks ) updateGoplsVersionInVSCodeGo (ctx * wf.TaskContext , reviewers []string , issue int64 , version , branch string ) (string , error ) {
474+ clTitle := fmt .Sprintf (`extension/src/goToolsInformation: update gopls version %s` , version )
475+ if branch != "master" {
476+ clTitle = "[" + branch + "] " + clTitle
477+ }
478+ openCL , err := openCL (ctx , r .Gerrit , "vscode-go" , branch , clTitle )
475479 if err != nil {
476- return nil , err
480+ return "" , fmt .Errorf ("failed to find the open CL of title %q in branch %q: %w" , clTitle , branch , err )
481+ }
482+ if openCL != "" {
483+ ctx .Printf ("not creating CL: found existing CL %s" , openCL )
484+ return openCL , nil
485+ }
486+ const script = `go run -C extension tools/generate.go -tools`
487+ changedFiles , err := executeAndMonitorChange (ctx , r .CloudBuild , "vscode-go" , branch , script , []string {"extension/src/goToolsInformation.ts" })
488+ if err != nil {
489+ return "" , err
477490 }
478- var changes []string
479- for _ , branch := range []string {"master" , releaseBranch } {
480- clTitle := fmt .Sprintf (`extension/src/goToolsInformation: update gopls version %s` , version )
481- if branch != "master" {
482- clTitle = "[" + branch + "] " + clTitle
483- }
484- openCL , err := openCL (ctx , r .Gerrit , "vscode-go" , branch , clTitle )
485- if err != nil {
486- return nil , fmt .Errorf ("failed to find the open CL of title %q in branch %q: %w" , clTitle , branch , err )
487- }
488- if openCL != "" {
489- ctx .Printf ("not creating CL: found existing CL %s" , openCL )
490- changes = append (changes , openCL )
491- continue
492- }
493- const script = `go run -C extension tools/generate.go -tools`
494- changedFiles , err := executeAndMonitorChange (ctx , r .CloudBuild , "vscode-go" , branch , script , []string {"extension/src/goToolsInformation.ts" })
495- if err != nil {
496- return nil , err
497- }
498-
499- // Skip CL creation as nothing changed.
500- if len (changedFiles ) == 0 {
501- return nil , nil
502- }
503491
504- changeInput := gerrit.ChangeInput {
505- Project : "vscode-go" ,
506- Branch : branch ,
507- Subject : fmt .Sprintf ("%s\n \n This is an automated CL which updates the gopls version.\n \n For golang/go#%v" , clTitle , issue ),
508- }
492+ // Skip CL creation as nothing changed.
493+ if len (changedFiles ) == 0 {
494+ return "" , nil
495+ }
509496
510- ctx .Printf ("creating auto-submit change under branch %q in vscode-go repo." , branch )
511- changeID , err := r .Gerrit .CreateAutoSubmitChange (ctx , changeInput , reviewers , changedFiles )
512- if err != nil {
513- return nil , err
514- }
515- changes = append (changes , changeID )
497+ changeInput := gerrit.ChangeInput {
498+ Project : "vscode-go" ,
499+ Branch : branch ,
500+ Subject : fmt .Sprintf ("%s\n \n This is an automated CL which updates the gopls version.\n \n For golang/go#%v" , clTitle , issue ),
516501 }
517- return changes , nil
502+
503+ ctx .Printf ("creating auto-submit change under branch %q in vscode-go repo." , branch )
504+ return r .Gerrit .CreateAutoSubmitChange (ctx , changeInput , reviewers , changedFiles )
518505}
519506
520507func (r * ReleaseGoplsTasks ) isValidReleaseVersion (ctx * wf.TaskContext , ver string ) error {
0 commit comments