aboutsummaryrefslogtreecommitdiff
path: root/infra
diff options
context:
space:
mode:
authorOliver Chang <oliverchang@users.noreply.github.com>2020-12-04 17:51:31 +1100
committerGitHub <noreply@github.com>2020-12-04 17:51:31 +1100
commit8bd567697d2f36589ca315971f6fff47af4e9e2b (patch)
treef01984bd7673e40d49bb91597a5d006fe0d53f53 /infra
parentb1c77d1fa2f905a41a5062f98c874d030c4abdb1 (diff)
downloadoss-fuzz-8bd567697d2f36589ca315971f6fff47af4e9e2b.tar.gz
build_specified_commit: fallback to oldest integration commit. (#4779)
When we fail a build, we attempt to identify the first OSS-Fuzz commit prior to the upstream commit date. If this does not exist, we bailed out. This commit changes it such that we at least try on the oldest integration commit.
Diffstat (limited to 'infra')
-rw-r--r--infra/build_specified_commit.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/infra/build_specified_commit.py b/infra/build_specified_commit.py
index 9a0af01ee..6c3e3cc23 100644
--- a/infra/build_specified_commit.py
+++ b/infra/build_specified_commit.py
@@ -246,7 +246,18 @@ def build_fuzzers_from_commit(commit,
check_result=True)
oss_fuzz_commit = oss_fuzz_commit.strip()
if not oss_fuzz_commit:
- logging.warning('No suitable earlier OSS-Fuzz commit found.')
+ logging.info(
+ 'Could not find first OSS-Fuzz commit prior to upstream commit. '
+ 'Falling back to oldest integration commit.')
+
+ # Find the oldest commit.
+ oss_fuzz_commit, _, _ = oss_fuzz_repo_manager.git(
+ ['log', '--reverse', '--format=%H', projects_dir], check_result=True)
+
+ oss_fuzz_commit = oss_fuzz_commit.splitlines()[0].strip()
+
+ if not oss_fuzz_commit:
+ logging.error('Failed to get oldest integration commit.')
break
logging.info('Build failed. Retrying on earlier OSS-Fuzz commit %s.',