From 28800a8c274b96ee21eef779e720553c7ebfca19 Mon Sep 17 00:00:00 2001 From: Jeremy Lewi Date: Mon, 23 Oct 2017 20:19:39 -0700 Subject: [PATCH] Another attempt to fix periodic jobs. * GCS output for periodic jobs appears to be in kubernetes-jenkins/logs/mlkube-build-periodic * Don't set PULL in started.json if its an empty string; this is causing the parse errors. --- test-infra/runner.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/test-infra/runner.py b/test-infra/runner.py index 669845c065..e5abfbd499 100644 --- a/test-infra/runner.py +++ b/test-infra/runner.py @@ -253,16 +253,20 @@ def get_gcs_output(): job=job_name, build=os.getenv("BUILD_NUMBER")) return output - else: - # It is a periodic or postsubmit job + elif os.getenv("REPO_OWNER"): + # It is a postsubmit job output = ("gs://kubernetes-jenkins/logs/{owner}_{repo}/" "{job}/{build}").format( owner=GO_REPO_OWNER, repo=GO_REPO_NAME, - pull_number=pull_number, job=job_name, build=os.getenv("BUILD_NUMBER")) return output - + else: + # Its a periodic job + output = ("gs://kubernetes-jenkins/logs/{job}/{build}").format( + job=job_name, + build=os.getenv("BUILD_NUMBER")) + return output def create_started(gcs_client, output_dir, sha): """Create the started output in GCS. @@ -277,13 +281,16 @@ def create_started(gcs_client, output_dir, sha): # For a list of fields expected by gubernator started = { "timestamp": int(time.time()), - "pull": os.getenv("PULL_REFS", ""), "repos": { # List all repos used and their versions. GO_REPO_OWNER + "/" + GO_REPO_NAME: sha, }, } + PULL_REFS = os.getenv("PULL_REFS", "") + if started: + started["pull"] = PULL_REFS + m = GCS_REGEX.match(output_dir) bucket = m.group(1) path = m.group(2)