| OLD | NEW |
| 1 package repo_manager | 1 package repo_manager |
| 2 | 2 |
| 3 import ( | 3 import ( |
| 4 "fmt" | 4 "fmt" |
| 5 "os" | 5 "os" |
| 6 "path" | 6 "path" |
| 7 "regexp" | 7 "regexp" |
| 8 "strconv" | 8 "strconv" |
| 9 "strings" | 9 "strings" |
| 10 "sync" | 10 "sync" |
| 11 "time" | 11 "time" |
| 12 | 12 |
| 13 "github.com/skia-dev/glog" |
| 14 |
| 13 "go.skia.org/infra/go/autoroll" | 15 "go.skia.org/infra/go/autoroll" |
| 14 "go.skia.org/infra/go/exec" | 16 "go.skia.org/infra/go/exec" |
| 15 "go.skia.org/infra/go/gitinfo" | 17 "go.skia.org/infra/go/gitinfo" |
| 16 "go.skia.org/infra/go/util" | 18 "go.skia.org/infra/go/util" |
| 17 ) | 19 ) |
| 18 | 20 |
| 19 const ( | 21 const ( |
| 20 DEPS_ROLL_BRANCH = "roll_branch" | 22 DEPS_ROLL_BRANCH = "roll_branch" |
| 21 | 23 |
| 22 GCLIENT = "gclient" | 24 GCLIENT = "gclient" |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 if err != nil { | 300 if err != nil { |
| 299 return 0, fmt.Errorf("Failed to obtain commit details: %
s", err) | 301 return 0, fmt.Errorf("Failed to obtain commit details: %
s", err) |
| 300 } | 302 } |
| 301 b := util.BugsFromCommitMsg(d.Body) | 303 b := util.BugsFromCommitMsg(d.Body) |
| 302 for _, bug := range b[util.PROJECT_CHROMIUM] { | 304 for _, bug := range b[util.PROJECT_CHROMIUM] { |
| 303 bugs = append(bugs, bug) | 305 bugs = append(bugs, bug) |
| 304 } | 306 } |
| 305 } | 307 } |
| 306 | 308 |
| 307 args := []string{r.childPath, r.childHead} | 309 args := []string{r.childPath, r.childHead} |
| 308 » for _, bug := range bugs { | 310 » if len(bugs) > 0 { |
| 309 » » args = append(args, "--bug", bug) | 311 » » args = append(args, "--bug", strings.Join(bugs, ",")) |
| 310 } | 312 } |
| 313 glog.Infof("Running command: roll-dep %s", strings.Join(args, " ")) |
| 311 if _, err := exec.RunCommand(&exec.Command{ | 314 if _, err := exec.RunCommand(&exec.Command{ |
| 312 Dir: r.chromiumDir, | 315 Dir: r.chromiumDir, |
| 313 Env: []string{fmt.Sprintf("PATH=%s:%s", r.depot_tools, os.Geten
v("PATH"))}, | 316 Env: []string{fmt.Sprintf("PATH=%s:%s", r.depot_tools, os.Geten
v("PATH"))}, |
| 314 Name: r.rollDep, | 317 Name: r.rollDep, |
| 315 » » Args: []string{r.childPath, r.childHead}, | 318 » » Args: args, |
| 316 }); err != nil { | 319 }); err != nil { |
| 317 return 0, err | 320 return 0, err |
| 318 } | 321 } |
| 319 // Build the commit message, starting with the message provided by roll-
dep. | 322 // Build the commit message, starting with the message provided by roll-
dep. |
| 320 commitMsg, err := exec.RunCwd(r.chromiumDir, "git", "log", "-n1", "--for
mat=%B", "HEAD") | 323 commitMsg, err := exec.RunCwd(r.chromiumDir, "git", "log", "-n1", "--for
mat=%B", "HEAD") |
| 321 if err != nil { | 324 if err != nil { |
| 322 return 0, err | 325 return 0, err |
| 323 } | 326 } |
| 324 if cqExtraTrybots != "" { | 327 if cqExtraTrybots != "" { |
| 325 commitMsg += "\n" + fmt.Sprintf(TMPL_CQ_INCLUDE_TRYBOTS, cqExtra
Trybots) | 328 commitMsg += "\n" + fmt.Sprintf(TMPL_CQ_INCLUDE_TRYBOTS, cqExtra
Trybots) |
| (...skipping 26 matching lines...) Expand all Loading... |
| 352 issues := ISSUE_CREATED_REGEX.FindStringSubmatch(uploadOutput) | 355 issues := ISSUE_CREATED_REGEX.FindStringSubmatch(uploadOutput) |
| 353 if len(issues) != 2 { | 356 if len(issues) != 2 { |
| 354 return 0, fmt.Errorf("Failed to find newly-uploaded issue number
!") | 357 return 0, fmt.Errorf("Failed to find newly-uploaded issue number
!") |
| 355 } | 358 } |
| 356 return strconv.ParseInt(issues[1], 10, 64) | 359 return strconv.ParseInt(issues[1], 10, 64) |
| 357 } | 360 } |
| 358 | 361 |
| 359 func (r *repoManager) User() string { | 362 func (r *repoManager) User() string { |
| 360 return r.user | 363 return r.user |
| 361 } | 364 } |
| OLD | NEW |