From 59f36113ee97b3d2d2c872e23841eda592a4201d Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sun, 17 Feb 2019 15:46:16 +0100 Subject: syz-ci: don't extract fixing commits if no report email There can be no ReportEmail is email reporting is not used, don't poll fixing commits in such case. --- syz-ci/jobs.go | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/syz-ci/jobs.go b/syz-ci/jobs.go index c74e7b2be..8998ce0fd 100644 --- a/syz-ci/jobs.go +++ b/syz-ci/jobs.go @@ -107,21 +107,23 @@ func (jp *JobProcessor) pollManagerCommits(mgr *Manager) error { if brokenRepo(repo.URL) { continue } - commits1, err := jp.pollRepo(mgr, repo.URL, repo.Branch, resp.ReportEmail) - if err != nil { - jp.Errorf("failed to poll %v %v: %v", repo.URL, repo.Branch, err) - continue - } - log.Logf(1, "got %v commits from %v/%v repo", len(commits1), repo.URL, repo.Branch) - for _, com := range commits1 { - // Only the "main" repo is the source of true hashes. - if i != 0 { - com.Hash = "" + if resp.ReportEmail != "" { + commits1, err := jp.pollRepo(mgr, repo.URL, repo.Branch, resp.ReportEmail) + if err != nil { + jp.Errorf("failed to poll %v %v: %v", repo.URL, repo.Branch, err) + continue } - // Not overwrite existing commits, in particular commit from the main repo with hash. - if _, ok := commits[com.Title]; !ok && !jp.knownCommits[com.Title] && len(commits) < 100 { - commits[com.Title] = com - jp.knownCommits[com.Title] = true + log.Logf(1, "got %v commits from %v/%v repo", len(commits1), repo.URL, repo.Branch) + for _, com := range commits1 { + // Only the "main" repo is the source of true hashes. + if i != 0 { + com.Hash = "" + } + // Not overwrite existing commits, in particular commit from the main repo with hash. + if _, ok := commits[com.Title]; !ok && !jp.knownCommits[com.Title] && len(commits) < 100 { + commits[com.Title] = com + jp.knownCommits[com.Title] = true + } } } if i == 0 && len(resp.Commits) != 0 { -- cgit mrf-deployment