summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorJamie Lennox <jamielennox@gmail.com>2017-02-10 11:33:44 +1100
committerJesse Keating <omgjlk@us.ibm.com>2017-05-23 21:47:49 -0700
commita6b33baadec28e09782f3e5879bcb62269b18b75 (patch)
tree6660aec07443ec3da10735b2dd3bdf659bfd9c67 /etc
parentd81dd7646f98b454eb088a516607cc77316a5a18 (diff)
downloadzuul-a6b33baadec28e09782f3e5879bcb62269b18b75.tar.gz
Represent github change ID in status page by PR number
The change.id given to the status.json output for github PRs is a full "PR#,SHA" combo. This gives it uniqueness when we can have multiple commits and versions of commits per PR. When we display this in the status page though i think all we care about is the PR number, so trim it out and just display that. Change-Id: I73385a6b0743a6764fdfdd51cd1d8ee02b71c53c Signed-off-by: Jamie Lennox <jamielennox@gmail.com>
Diffstat (limited to 'etc')
-rw-r--r--etc/status/public_html/jquery.zuul.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/etc/status/public_html/jquery.zuul.js b/etc/status/public_html/jquery.zuul.js
index c7e23b20a..aec7a4655 100644
--- a/etc/status/public_html/jquery.zuul.js
+++ b/etc/status/public_html/jquery.zuul.js
@@ -279,7 +279,16 @@
var $change_link = $('<small />');
if (change.url !== null) {
- if (/^[0-9a-f]{40}$/.test(change.id)) {
+ var github_id = change.id.match(/^([0-9]+),([0-9a-f]{40})$/);
+ if (github_id) {
+ $change_link.append(
+ $('<a />').attr('href', change.url).append(
+ $('<abbr />')
+ .attr('title', change.id)
+ .text('#' + github_id[1])
+ )
+ );
+ } else if (/^[0-9a-f]{40}$/.test(change.id)) {
var change_id_short = change.id.slice(0, 7);
$change_link.append(
$('<a />').attr('href', change.url).append(