From e9f6b468988a3a10fe8c322a76f6e35a2e721735 Mon Sep 17 00:00:00 2001 From: Bastien Abadie Date: Thu, 31 Oct 2019 11:10:37 +0100 Subject: [PATCH] bot: Publish revision once repo is known --- bot/code_review_bot/workflow.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bot/code_review_bot/workflow.py b/bot/code_review_bot/workflow.py index 5c12b7414..390d65905 100644 --- a/bot/code_review_bot/workflow.py +++ b/bot/code_review_bot/workflow.py @@ -85,9 +85,6 @@ def run(self, revision): # Analyze revision patch to get files/lines data revision.analyze_patch() - # Store the revision in the backend - self.backend_api.publish_revision(revision) - # Find issues on remote tasks issues = self.find_issues(revision) if not issues: @@ -221,6 +218,10 @@ def find_issues(self, revision): # Update the local revision with tasks revision.setup_try(tasks) + # Store the revision in the backend + # It needs to be after setup_try to have a repository value + self.backend_api.publish_revision(revision) + # Load task description task = tasks.get(settings.try_task_id) assert task is not None, "Missing task {}".format(settings.try_task_id)