Add highlight Jenkins +1 functionality
Currently ciwatch highlights Jenkins -1 votes, but many third party CIs pick up Gerrit events only when Jenkins has voted +1. Hence it is important to highlight vendor CI failures when Jenkins has verified the change set. Closes-Bug: #1516110 Change-Id: I5635d344404c21206d7cae049f81fb1f2067ec09
This commit is contained in:
parent
68f1910e77
commit
f52b39f483
|
@ -48,7 +48,7 @@ def _process_event(event):
|
||||||
|
|
||||||
|
|
||||||
def _is_ci_user(name):
|
def _is_ci_user(name):
|
||||||
return 'CI' in name or 'Jenkins' in name
|
return 'CI' in name or 'Jenkins' in name or 'Bot' in name
|
||||||
|
|
||||||
|
|
||||||
# Check if this is a third party CI event
|
# Check if this is a third party CI event
|
||||||
|
@ -139,7 +139,7 @@ def add_event_to_db(event, commit_=True):
|
||||||
trusted = (event["author"]["username"] == "jenkins")
|
trusted = (event["author"]["username"] == "jenkins")
|
||||||
|
|
||||||
if trusted and "approvals" in event:
|
if trusted and "approvals" in event:
|
||||||
if event["approvals"][0]["value"] in ("+1", "+2"):
|
if event["approvals"][0]["value"] in ("1", "2"):
|
||||||
patch_set.verified = True
|
patch_set.verified = True
|
||||||
elif event["approvals"][0]["value"] in ("-1", "-2"):
|
elif event["approvals"][0]["value"] in ("-1", "-2"):
|
||||||
patch_set.verified = False
|
patch_set.verified = False
|
||||||
|
|
|
@ -13,21 +13,31 @@
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var toggle1 = function () {
|
var toggle_verified_plus = function () {
|
||||||
$(".verified-1").css("background-color", "#FAA");
|
var color = "#BFA";
|
||||||
$(this).one("click", toggle2);
|
if ($(this).hasClass("active")){
|
||||||
|
color = "";
|
||||||
|
}
|
||||||
|
$(".verified1").css("background-color", color);
|
||||||
}
|
}
|
||||||
|
|
||||||
var toggle2 = function () {
|
var toggle_verified_minus = function () {
|
||||||
$(".verified-1").css("background-color", "");
|
var color = "#FAA";
|
||||||
$(this).one("click", toggle1);
|
if ($(this).hasClass("active")){
|
||||||
|
color = "";
|
||||||
|
}
|
||||||
|
$(".verified-1").css("background-color", color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
$("colgroup").each(function (i, elem) {
|
$("colgroup").each(function (i, elem) {
|
||||||
if ($(elem).hasClass("verified-1")) {
|
if ($(elem).hasClass("verified-1")) {
|
||||||
$("#results").find("td").filter(":nth-child(" + (i + 1) + ")").addClass("verified-1");
|
$("#results").find("td").filter(":nth-child(" + (i + 1) + ")").addClass("verified-1");
|
||||||
|
} else if ($(elem).hasClass("verified1")) {
|
||||||
|
$("#results").find("td").filter(":nth-child(" + (i + 1) + ")").addClass("verified1");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$("#verified-1-button").one("click", toggle1);
|
$("#verified1-button").on("click", toggle_verified_plus);
|
||||||
|
$("#verified-1-button").on("click", toggle_verified_minus);
|
||||||
});
|
});
|
||||||
|
|
|
@ -39,16 +39,17 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button id="verified-1-button" class="btn btn-default" type="button" data-toggle="button">Highlight Jenkins -1 votes</button>
|
<button id="verified-1-button" class="btn btn-default" type="button" data-toggle="button">Highlight Jenkins -1 votes</button>
|
||||||
|
<button id="verified1-button" class="btn btn-default" type="button" data-toggle="button">Highlight Jenkins +1 votes</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<br>
|
|
||||||
|
|
||||||
<div class="table">
|
<div class="table">
|
||||||
<table id="results" class="table table-bordered table-condensed">
|
<table id="results" class="table table-bordered table-condensed">
|
||||||
|
|
||||||
<colgroup></colgroup>
|
<colgroup></colgroup>
|
||||||
{% for patch_set in patch_sets %}
|
{% for patch_set in patch_sets %}
|
||||||
{% if patch_set.verified is not none and not patch_set.verfied %}
|
{% if patch_set.verified %}
|
||||||
|
<colgroup class="verified1"></colgroup>
|
||||||
|
{% elif patch_set.verified is not none and not patch_set.verfied %}
|
||||||
<colgroup class="verified-1"></colgroup>
|
<colgroup class="verified-1"></colgroup>
|
||||||
{% else %}
|
{% else %}
|
||||||
<colgroup></colgroup>
|
<colgroup></colgroup>
|
||||||
|
|
Loading…
Reference in New Issue