From b880656e32f7f22b951629d4491a726cfa9307f1 Mon Sep 17 00:00:00 2001 From: Evgeny Antyshev Date: Thu, 21 Jan 2016 09:29:25 +0000 Subject: [PATCH] Fix "verified" attribute assignment Current version incorrectly parses pipeline, which leads to un-modified event["author"]["name"], which leads to unassigned "verified" attribute. Usual Jenkins comment starts as: "Patch Set 12: Verified-1\n\nBuild failed (check pipeline)." This means, pipeline info is on line 2, not 0. Also, removed unneeded code from projects jinja template Change-Id: Id1143f2980a3a09ee6ab0e35342a3512525b852c --- ciwatch/events.py | 2 +- ciwatch/templates/project.html.jinja | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ciwatch/events.py b/ciwatch/events.py index b2f2dc2..aebe7ba 100644 --- a/ciwatch/events.py +++ b/ciwatch/events.py @@ -45,7 +45,7 @@ def _process_event(event): # Find all the CIs voting in this comment lines = comment.splitlines() event['ci-status'] = {} - pipeline = is_jenkins_pipeline(lines[0]) + pipeline = is_jenkins_pipeline(lines[2]) if pipeline is not None: event["author"]["name"] = event["author"]["name"] + ' ' + pipeline for line in lines: diff --git a/ciwatch/templates/project.html.jinja b/ciwatch/templates/project.html.jinja index 96a0cc6..fed371f 100644 --- a/ciwatch/templates/project.html.jinja +++ b/ciwatch/templates/project.html.jinja @@ -49,7 +49,7 @@ {% for patch_set in patch_sets %} {% if patch_set.verified %} - {% elif patch_set.verified is not none and not patch_set.verfied %} + {% elif patch_set.verified is not none %} {% else %}