Lines Matching refs:bug
185 for _, bug := range bugs {
187 if len(bug.Commits) == 0 {
190 for _, mgr := range bug.PatchedOn {
195 for _, com := range bug.Commits {
350 for _, bug := range bugs {
351 switch bug.Status {
356 return fmt.Errorf("addCommitsToBugs: unknown bug status %v", bug.Status)
359 for i := range bug.Reporting {
360 fixCommits = append(fixCommits, bugFixedBy[bug.Reporting[i].ID]...)
363 if err := addCommitsToBug(c, bug, manager, managers, fixCommits, presentCommits); err != nil {
366 if bug.Status == BugStatusDup {
367 canon, err := canonicalBug(c, bug)
371 if canon.Status == BugStatusOpen && len(bug.Commits) == 0 {
382 func addCommitsToBug(c context.Context, bug *Bug, manager string, managers []string,
384 if !bugNeedsCommitUpdate(c, bug, manager, fixCommits, presentCommits, true) {
388 bugKey := datastore.NewKey(c, "Bug", bugKeyHash(bug.Namespace, bug.Title, bug.Seq), 0, nil)
390 bug := new(Bug)
391 if err := datastore.Get(c, bugKey, bug); err != nil {
394 if !bugNeedsCommitUpdate(c, bug, manager, fixCommits, presentCommits, false) {
397 if len(fixCommits) != 0 && !reflect.DeepEqual(bug.Commits, fixCommits) {
398 bug.Commits = fixCommits
399 bug.PatchedOn = nil
401 bug.PatchedOn = append(bug.PatchedOn, manager)
402 if bug.Status == BugStatusOpen {
405 if !stringInList(bug.PatchedOn, mgr) {
411 bug.Status = BugStatusFixed
412 bug.Closed = now
415 if _, err := datastore.Put(c, bugKey, bug); err != nil {
444 func bugNeedsCommitUpdate(c context.Context, bug *Bug, manager string, fixCommits []string,
446 if len(fixCommits) != 0 && !reflect.DeepEqual(bug.Commits, fixCommits) {
448 log.Infof(c, "bug %q is fixed with %q", bug.Title, fixCommits)
452 if len(bug.Commits) == 0 || stringInList(bug.PatchedOn, manager) {
455 for _, com := range bug.Commits {
491 bug, err := reportCrash(c, ns, &req.Crash)
496 mgr.FailedBuildBug = bugKeyHash(bug.Namespace, bug.Title, bug.Seq)
510 bug, err := reportCrash(c, ns, req)
515 NeedRepro: needRepro(c, bug),
530 bug, bugKey, err := findBugForCrash(c, ns, req.Title)
534 if active, err := isActiveBug(c, bug); err != nil {
537 bug, bugKey, err = createBugForCrash(c, ns, req)
555 bug.NumCrashes < maxCrashes ||
556 now.Sub(bug.LastSavedCrash) > time.Hour ||
557 bug.NumCrashes%20 == 0
563 log.Infof(c, "not saving crash for %q", bug.Title)
567 bug = new(Bug)
568 if err := datastore.Get(c, bugKey, bug); err != nil {
571 bug.NumCrashes++
572 bug.LastTime = now
574 bug.LastSavedCrash = now
577 bug.NumRepro++
578 bug.LastReproTime = now
580 if bug.ReproLevel < reproLevel {
581 bug.ReproLevel = reproLevel
584 bug.HasReport = true
586 if !stringInList(bug.HappenedOn, build.Manager) {
587 bug.HappenedOn = append(bug.HappenedOn, build.Manager)
589 if _, err = datastore.Put(c, bugKey, bug); err != nil {
598 purgeOldCrashes(c, bug, bugKey)
600 return bug, nil
642 func purgeOldCrashes(c context.Context, bug *Bug, bugKey *datastore.Key) {
643 if bug.NumCrashes <= maxCrashes || (bug.NumCrashes-1)%10 != 0 {
703 log.Infof(c, "deleted %v crashes for bug %q", len(crashes), bug.Title)
713 bug, bugKey, err := findBugForCrash(c, ns, req.Title)
717 if bug == nil {
722 bug := new(Bug)
723 if err := datastore.Get(c, bugKey, bug); err != nil {
726 bug.NumRepro++
727 bug.LastReproTime = now
728 if _, err := datastore.Put(c, bugKey, bug); err != nil {
753 bug, _, err := findBugForCrash(c, ns, req.Title)
757 if bug == nil {
761 NeedRepro: needRepro(c, bug),
807 var bug *Bug
812 bug = new(Bug)
815 if err := datastore.Get(c, bugKey, bug); err != nil {
819 bug = &Bug{
832 bug.Reporting = append(bug.Reporting, BugReporting{
837 if bugKey, err = datastore.Put(c, bugKey, bug); err != nil {
842 canon, err := canonicalBug(c, bug)
858 return bug, bugKey, nil
861 func isActiveBug(c context.Context, bug *Bug) (bool, error) {
862 if bug == nil {
865 canon, err := canonicalBug(c, bug)
872 func needRepro(c context.Context, bug *Bug) bool {
873 if !needReproForBug(c, bug) {
876 canon, err := canonicalBug(c, bug)
884 func needReproForBug(c context.Context, bug *Bug) bool {
885 return bug.ReproLevel < ReproLevelC &&
886 len(bug.Commits) == 0 &&
887 bug.Title != corruptedReportTitle &&
888 (bug.NumRepro < maxReproPerBug ||
889 bug.ReproLevel == ReproLevelNone && timeSince(c, bug.LastReproTime) > reproRetryPeriod)