• Home
  • Raw
  • Download

Lines Matching refs:bug

54 	for _, bug := range bugs {
55 rep, err := handleReportBug(c, typ, state, bug)
57 log.Errorf(c, "%v: failed to report bug %v: %v", bug.Namespace, bug.Title, err)
71 func handleReportBug(c context.Context, typ string, state *ReportingState, bug *Bug) (*dashapi.BugR…
72 reporting, bugReporting, crash, crashKey, _, _, _, err := needReport(c, typ, state, bug)
76 rep, err := createBugReport(c, bug, crash, crashKey, bugReporting, reporting.Config)
80 log.Infof(c, "bug %q: reporting to %v", bug.Title, reporting.Name)
84 func needReport(c context.Context, typ string, state *ReportingState, bug *Bug) (
87 reporting, bugReporting, reportingIdx, status, err = currentReporting(c, bug)
97 if !bugReporting.Reported.IsZero() && bugReporting.ReproLevel >= bug.ReproLevel {
104 ent := state.getEntry(timeNow(c), bug.Namespace, reporting.Name)
105 cfg := config.Namespaces[bug.Namespace]
106 if timeSince(c, bug.FirstTime) < cfg.ReportingDelay {
111 if bug.ReproLevel < ReproLevelC && timeSince(c, bug.FirstTime) < cfg.WaitForRepro {
116 if !cfg.MailWithoutReport && !bug.HasReport {
122 crash, crashKey, err = findCrashForBug(c, bug)
157 func currentReporting(c context.Context, bug *Bug) (*Reporting, *BugReporting, int, string, error) {
158 for i := range bug.Reporting {
159 bugReporting := &bug.Reporting[i]
163 reporting := config.Namespaces[bug.Namespace].ReportingByName(bugReporting.Name)
167 switch reporting.Filter(bug) {
193 func createBugReport(c context.Context, bug *Bug, crash *Crash, crashKey *datastore.Key,
230 build, err := loadBuild(c, bug.Namespace, crash.BuildID)
240 Namespace: bug.Namespace,
245 Title: bug.displayTitle(),
268 NumCrashes: bug.NumCrashes,
269 HappenedOn: managersToRepos(c, bug.Namespace, bug.HappenedOn),
307 for _, bug := range bugs {
308 for i := range bug.Reporting {
309 bugMap[bug.Reporting[i].ID] = bug
314 bug := bugMap[id]
315 if bug == nil {
318 bugReporting, _ := bugReportingByID(bug, id)
319 bug, err = canonicalBug(c, bug)
324 if bug.Status >= BugStatusFixed || !bugReporting.Closed.IsZero() {
353 bug, bugKey, err := findBugByReportingID(c, cmd.ID)
360 bugReporting, _ := bugReportingByID(bug, cmd.ID)
364 dup, dupKey, err = findDupByTitle(c, bug.Namespace, cmd.DupOf)
387 if bug.Namespace != dup.Namespace {
390 bug.Namespace, dup.Namespace), nil
428 bug := new(Bug)
429 if err := datastore.Get(c, bugKey, bug); err != nil {
432 bugReporting, final := bugReportingByID(bug, cmd.ID)
436 if ok, reply, err := checkBugStatus(c, cmd, bug, bugReporting); !ok {
443 stateEnt := state.getEntry(now, bug.Namespace, bugReporting.Name)
444 …if ok, reply, err := incomingCommandCmd(c, now, cmd, bug, bugReporting, final, dupHash, stateEnt);…
447 if len(cmd.FixCommits) != 0 && (bug.Status == BugStatusOpen || bug.Status == BugStatusDup) {
449 if !reflect.DeepEqual(bug.Commits, cmd.FixCommits) {
450 bug.Commits = cmd.FixCommits
451 bug.PatchedOn = nil
482 if bug.Status != BugStatusDup {
483 bug.DupOf = ""
485 if _, err := datastore.Put(c, bugKey, bug); err != nil {
495 bug *Bug, bugReporting *BugReporting, final bool, dupHash string,
499 bug.Status = BugStatusOpen
500 bug.Closed = time.Time{}
507 for i := range bug.Reporting {
508 if bugReporting == &bug.Reporting[i] {
511 if bug.Reporting[i].Closed.IsZero() {
512 bug.Reporting[i].Closed = now
515 if bug.ReproLevel < cmd.ReproLevel {
518 bug.ReproLevel, cmd.ReproLevel)
524 if len(bug.Commits) != 0 {
529 bug.Status = BugStatusOpen
530 bug.Closed = time.Time{}
534 bug.Closed = now
535 bug.Status = BugStatusInvalid
537 bug.Status = BugStatusDup
538 bug.Closed = now
539 bug.DupOf = dupHash
548 func checkBugStatus(c context.Context, cmd *dashapi.BugUpdate, bug *Bug, bugReporting *BugReporting…
550 switch bug.Status {
553 canon, err := canonicalBug(c, bug)
576 return false, internalError, fmt.Errorf("unknown bug status %v", bug.Status)
612 bug := new(Bug)
613 if err := datastore.Get(c, bugKey, bug); err != nil {
616 return bug, bugKey, nil
619 func bugReportingByID(bug *Bug, id string) (*BugReporting, bool) {
620 for i := range bug.Reporting {
621 if bug.Reporting[i].ID == id {
622 return &bug.Reporting[i], i == len(bug.Reporting)-1
628 func bugReportingByName(bug *Bug, name string) *BugReporting {
629 for i := range bug.Reporting {
630 if bug.Reporting[i].Name == name {
631 return &bug.Reporting[i]
653 func findCrashForBug(c context.Context, bug *Bug) (*Crash, *datastore.Key, error) {
654 bugKey := datastore.NewKey(c, "Bug", bugKeyHash(bug.Namespace, bug.Title, bug.Seq), 0, nil)
663 if bug.ReproLevel == ReproLevelC {
665 log.Errorf(c, "bug '%v': has C repro, but crash without C repro", bug.Title)
667 } else if bug.ReproLevel == ReproLevelSyz {
669 log.Errorf(c, "bug '%v': has syz repro, but crash without syz repro", bug.Title)
671 } else if bug.HasReport {
673 log.Errorf(c, "bug '%v': has report, but crash without report", bug.Title)