Page MenuHomePhabricator

Create a plugin that makes ci comments pretty
Closed, DeclinedPublic

Description

using commentlinks html field does not work in PolyGerrit so lets create a plugin that searches and replaces for us :)

(reported upstream by @thcipriani here https://bugs.chromium.org/p/gerrit/issues/detail?id=10455)

Event Timeline

I've managed to do this by doing:

var strMessage1 = document.getElementsByClassName("style-scope gr-linked-text");
for(var i=0; i<strMessage1.length; i++) {
    strMessage1[i].innerHTML = strMessage1[i].innerHTML
    .replace(/(.+)\s(<a href="https:\/\/gerrit-jenkins\.wmflabs\.org\/[a-zA-Z0-9/_.-]+" target="_blank" rel="noopener" class="style-scope gr-linked-text">)[^<]+<\/a> : ([a-zA-Z_]+)([^<]*)/g,
     '<li class=\"ci_comment_test\"><span class=\"ci_comment_test_name\">$2$1</a></span> <span class=\"ci_comment_test_result\"><span class=\"ci_result_$3\">$3</span>$4</span></li>');
}

Change 489397 had a related patch set uploaded (by Paladox; owner: Paladox):
[operations/puppet@production] gerrit: Make ci comments pretty under PolyGerrit

https://gerrit.wikimedia.org/r/489397

Paladox renamed this task from Create a plugin that add <span></span> (custom html classes) in polygerrit for ci comments to Create a plugin that makes ci comments pretty.Feb 9 2019, 10:55 PM

Change 489397 abandoned by Paladox:
gerrit: Make ci comments pretty under PolyGerrit

Reason:
Done in https://gerrit.wikimedia.org/r/#/c/operations/software/gerrit/plugins/wikimedia/ /489483/

https://gerrit.wikimedia.org/r/489397

Paladox triaged this task as Medium priority.Feb 12 2019, 5:21 PM

Change 489483 had a related patch set uploaded (by Paladox; owner: Paladox):
[operations/software/gerrit/plugins/wikimedia@master] Introduce gr-wikimedia-prettify-ci-comments

https://gerrit.wikimedia.org/r/489483

Change 489483 abandoned by Hashar:

[operations/software/gerrit/plugins/wikimedia@master] Introduce gr-wikimedia-prettify-ci-comments

Reason:

https://gerrit.wikimedia.org/r/489483