Chromium Code Reviews| Index: alertserver/go/alertserver/alertroutines.go |
| diff --git a/alertserver/go/alertserver/alertroutines.go b/alertserver/go/alertserver/alertroutines.go |
| index d512c3303c2293230c4d2328397f804507545696..13ed4ca01ed5a6295d6866baab8b33f680cfcb4f 100644 |
| --- a/alertserver/go/alertserver/alertroutines.go |
| +++ b/alertserver/go/alertserver/alertroutines.go |
| @@ -10,6 +10,7 @@ import ( |
| "github.com/skia-dev/glog" |
| "github.com/skia-dev/influxdb/client" |
| "go.skia.org/infra/alertserver/go/alerting" |
| + "go.skia.org/infra/go/autoroll" |
| "go.skia.org/infra/go/buildbot" |
| "go.skia.org/infra/go/util" |
| ) |
| @@ -191,4 +192,30 @@ func StartAlertRoutines(am *alerting.AlertManager, tickInterval time.Duration, c |
| } |
| } |
| }() |
| + |
| + // AutoRoll failure. |
| + go func() { |
| + lastSearch := time.Now() |
| + for now := range time.Tick(time.Minute) { |
| + glog.Infof("Searching for DEPS rolls.") |
| + results, err := autoroll.GetRecentRolls(lastSearch) |
| + if err != nil { |
| + glog.Errorf("Failed to search for DEPS rolls: %v", err) |
| + continue |
| + } |
| + lastSearch = now |
| + for _, issue := range results { |
| + if issue.Closed && !issue.Committed { |
| + if err := am.AddAlert(&alerting.Alert{ |
| + Name: "AutoRoll Failed", |
| + Message: fmt.Sprintf("DEPS roll failed: https://codereview.chromium.org/%d", issue.Issue), |
|
rmistry
2015/06/10 20:20:54
Use the const from autoroll.go for codereview.chro
borenet
2015/06/11 11:40:10
Done.
|
| + Nag: int64(3 * time.Hour), |
| + Actions: actions, |
| + }); err != nil { |
| + glog.Error(err) |
| + } |
| + } |
| + } |
| + } |
| + }() |
| } |