summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-11-27 22:34:32 +0000
committerGerrit Code Review <review@openstack.org>2018-11-27 22:34:32 +0000
commit1ac3eb9fb719600e82b67e645db10b45ae28373c (patch)
tree586825e6c5ff47dce544ee1181b6727baa4cd95e
parentccbe7b10df77adaf587e2b45cd764927f8f03d24 (diff)
parent6e940f0b72da5ba79f5c8714005e4725fbe8d562 (diff)
Merge "Display ref instead of NA for time triggered items"
-rw-r--r--tests/unit/test_scheduler.py11
-rw-r--r--web/src/containers/status/ChangePanel.jsx4
-rw-r--r--zuul/model.py4
3 files changed, 19 insertions, 0 deletions
diff --git a/tests/unit/test_scheduler.py b/tests/unit/test_scheduler.py
index a07c259..d47b408 100644
--- a/tests/unit/test_scheduler.py
+++ b/tests/unit/test_scheduler.py
@@ -3532,6 +3532,17 @@ class TestScheduler(ZuulTestCase):
3532 # second to settle. 3532 # second to settle.
3533 time.sleep(1) 3533 time.sleep(1)
3534 self.waitUntilSettled() 3534 self.waitUntilSettled()
3535
3536 # Ensure that the status json has the ref so we can render it in the
3537 # web ui.
3538 data = json.loads(self.sched.formatStatusJSON('tenant-one'))
3539 pipeline = [x for x in data['pipelines'] if x['name'] == 'periodic'][0]
3540 first = pipeline['change_queues'][0]['heads'][0][0]
3541 second = pipeline['change_queues'][1]['heads'][0][0]
3542 self.assertIn(first['ref'], ['refs/heads/master', 'refs/heads/stable'])
3543 self.assertIn(second['ref'],
3544 ['refs/heads/master', 'refs/heads/stable'])
3545
3535 self.executor_server.release() 3546 self.executor_server.release()
3536 self.waitUntilSettled() 3547 self.waitUntilSettled()
3537 3548
diff --git a/web/src/containers/status/ChangePanel.jsx b/web/src/containers/status/ChangePanel.jsx
index e2e53af..f2a8c8b 100644
--- a/web/src/containers/status/ChangePanel.jsx
+++ b/web/src/containers/status/ChangePanel.jsx
@@ -94,6 +94,10 @@ class ChangePanel extends React.Component {
94 renderChangeLink (change) { 94 renderChangeLink (change) {
95 let changeId = change.id || 'NA' 95 let changeId = change.id || 'NA'
96 let changeTitle = changeId 96 let changeTitle = changeId
97 // Fall back to display the ref if there is no change id
98 if (changeId === 'NA' && change.ref) {
99 changeTitle = change.ref
100 }
97 let changeText = '' 101 let changeText = ''
98 if (change.url !== null) { 102 if (change.url !== null) {
99 let githubId = changeId.match(/^([0-9]+),([0-9a-f]{40})$/) 103 let githubId = changeId.match(/^([0-9]+),([0-9a-f]{40})$/)
diff --git a/zuul/model.py b/zuul/model.py
index d938b4a..85b5a54 100644
--- a/zuul/model.py
+++ b/zuul/model.py
@@ -2348,6 +2348,10 @@ class QueueItem(object):
2348 ret['url'] = self.change.url 2348 ret['url'] = self.change.url
2349 else: 2349 else:
2350 ret['url'] = None 2350 ret['url'] = None
2351 if hasattr(self.change, 'ref') and self.change.ref is not None:
2352 ret['ref'] = self.change.ref
2353 else:
2354 ret['ref'] = None
2351 ret['id'] = self.change._id() 2355 ret['id'] = self.change._id()
2352 if self.item_ahead: 2356 if self.item_ahead:
2353 ret['item_ahead'] = self.item_ahead.change._id() 2357 ret['item_ahead'] = self.item_ahead.change._id()