@@ -47,7 +47,6 @@ import (
4747 "golang.org/x/net/context/ctxhttp"
4848 "golang.org/x/vulndb/report"
4949 "google.golang.org/protobuf/types/known/structpb"
50- yaml "gopkg.in/yaml.v3"
5150)
5251
5352// DefinitionHolder holds workflow definitions.
@@ -1016,19 +1015,10 @@ func (b *BuildReleaseTasks) fetchSecurityMilestone(ctx *wf.TaskContext, mileston
10161015 ctx .Printf ("No security milestone specified, no security milestone to fetch." )
10171016 return nil , nil
10181017 }
1019- const project = "security-metadata"
1020- head , err := b .PrivateGerritClient .ReadBranchHead (ctx , project , "main" )
1018+ rm , err := task .FetchReleaseMilestone (ctx , b .PrivateGerritClient , milestoneNum )
10211019 if err != nil {
10221020 return nil , err
10231021 }
1024- raw , err := b .PrivateGerritClient .ReadFile (ctx , project , head , path .Join ("data" , "milestones" , milestoneNum + ".yaml" ))
1025- if err != nil {
1026- return nil , err
1027- }
1028- var rm relmeta.ReleaseMilestone
1029- if err := yaml .Unmarshal (raw , & rm ); err != nil {
1030- return nil , fmt .Errorf ("cannot YAML unmarshal the milestone: %v" , err )
1031- }
10321022 return & rm , nil
10331023}
10341024
@@ -1233,9 +1223,9 @@ func (b *BuildReleaseTasks) createInternalReleaseBranches(ctx *wf.TaskContext, b
12331223 return internalBranches , nil
12341224}
12351225
1236- func (b * BuildReleaseTasks ) createSecurityCherryPicks (ctx * wf.TaskContext , releaseBranches []string , cls []* gerrit.ChangeInfo ) ([]* gerrit.ChangeInfo , error ) {
1226+ func (b * BuildReleaseTasks ) createSecurityCherryPicks (ctx * wf.TaskContext , releaseBranches []string , changes []* gerrit.ChangeInfo ) ([]* gerrit.ChangeInfo , error ) {
12371227 var cherryPicks []* gerrit.ChangeInfo
1238- for _ , ci := range cls {
1228+ for _ , ci := range changes {
12391229 for _ , releaseBranch := range releaseBranches {
12401230 // Check whether a non-abandoned cherry-pick of this
12411231 // change already exists on the target branch (e.g. from
@@ -1315,12 +1305,9 @@ func (b *BuildReleaseTasks) submitCherryPicks(ctx *wf.TaskContext, cherryPicks [
13151305 return submitted , nil
13161306}
13171307
1318- // majorFromMinor converts a release branch name from its minor version form to
1319- // its major version form (i.e., release-branch.go1.2.3 to release-branch.go1.2).
13201308func majorFromMinor (branch string ) string {
13211309 stripped := strings .TrimPrefix (branch , "release-branch." )
1322- major := goversion .Lang (stripped )
1323- return "release-branch." + major
1310+ return "release-branch." + goversion .Lang (stripped )
13241311}
13251312
13261313func privateChangeURL [T int | string ](clNum T ) string {
0 commit comments