From 0d0140fad59dd549da7ab68dd3c76624a58be185 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Thu, 20 Sep 2018 16:42:35 +0200 Subject: [PATCH] [IMP] runbot_merge: staging delay Continuation of fa94b269de1912c0e3d808978f3dd640a77ec718 which is apparently not sufficient: 1. log the staging event so we can check that we're staging in the correct order 2. add a delay after each staging in case there's some sort of race in the updating of codependent repositories --- runbot_merge/models/pull_requests.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/runbot_merge/models/pull_requests.py b/runbot_merge/models/pull_requests.py index 393ba72e..f0ec3783 100644 --- a/runbot_merge/models/pull_requests.py +++ b/runbot_merge/models/pull_requests.py @@ -6,6 +6,7 @@ import logging import os import pprint import re +import time from itertools import takewhile @@ -204,7 +205,16 @@ class Project(models.Model): # create staging branch from tmp for r in project.repo_ids: it = meta[r] + _logger.info( + "%s: create staging for %s:%s at %s", + project.name, r.name, branch.name, + heads[r.name] + ) it['gh'].set_ref('staging.{}'.format(branch.name), heads[r.name]) + # temp hack: add a delay between staging repositories + # in case there's a race when quickly pushing a repo + # then its dependency + time.sleep(20) # creating the staging doesn't trigger a write on the prs # and thus the ->staging taggings, so do that by hand