Skip to content

Commit 59e7eb5

Browse files
committed
More logging to debug Peter Gheogan issue
1 parent 68419d6 commit 59e7eb5

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

cfbot_patch.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -390,17 +390,21 @@ def process_submission(conn, commitfest_id, submission_id):
390390
output, rcode = patchburner_ctl("apply", want_rcode=True)
391391
# write the patch output to a public log file
392392
log_file = f"patch_{submission_id}.log"
393+
log_content = (
394+
"=== Applying patches on top of PostgreSQL commit ID %s ===\n" % (commit_id,)
395+
+ output
396+
)
393397
with open(os.path.join(cfbot_config.WEB_ROOT, log_file), "w+") as f:
394-
f.write(
395-
"=== Applying patches on top of PostgreSQL commit ID %s ===\n"
396-
% (commit_id,)
397-
)
398-
f.write(output)
398+
f.write(log_content)
399399
log_url = cfbot_config.CFBOT_APPLY_URL % log_file
400400
# did "patch" actually succeed?
401401
if rcode != 0:
402402
# we failed to apply the patches
403-
logging.info("failed to apply (%s, %s)" % (commitfest_id, submission_id))
403+
logging.info("failed to apply (%s, %s) rcode=%s" % (commitfest_id, submission_id, rcode))
404+
with open("apply_failures.log", "a") as f:
405+
f.write(f"=== Failed to apply submission {submission_id} (commitfest {commitfest_id}) at {time.strftime('%Y-%m-%d %H:%M:%S')} rcode={rcode} ===\n")
406+
f.write(log_content)
407+
f.write("\n")
404408
cursor.execute(
405409
"""INSERT INTO branch (commitfest_id, submission_id, status, url, created, modified) VALUES (%s, %s, 'failed', %s, now(), now()) RETURNING id""",
406410
(commitfest_id, submission_id, log_url),

0 commit comments

Comments
 (0)