Merge "Display ref instead of NA for time triggered items"
This commit is contained in:
commit
1ac3eb9fb7
|
@ -3532,6 +3532,17 @@ class TestScheduler(ZuulTestCase):
|
|||
# second to settle.
|
||||
time.sleep(1)
|
||||
self.waitUntilSettled()
|
||||
|
||||
# Ensure that the status json has the ref so we can render it in the
|
||||
# web ui.
|
||||
data = json.loads(self.sched.formatStatusJSON('tenant-one'))
|
||||
pipeline = [x for x in data['pipelines'] if x['name'] == 'periodic'][0]
|
||||
first = pipeline['change_queues'][0]['heads'][0][0]
|
||||
second = pipeline['change_queues'][1]['heads'][0][0]
|
||||
self.assertIn(first['ref'], ['refs/heads/master', 'refs/heads/stable'])
|
||||
self.assertIn(second['ref'],
|
||||
['refs/heads/master', 'refs/heads/stable'])
|
||||
|
||||
self.executor_server.release()
|
||||
self.waitUntilSettled()
|
||||
|
||||
|
|
|
@ -94,6 +94,10 @@ class ChangePanel extends React.Component {
|
|||
renderChangeLink (change) {
|
||||
let changeId = change.id || 'NA'
|
||||
let changeTitle = changeId
|
||||
// Fall back to display the ref if there is no change id
|
||||
if (changeId === 'NA' && change.ref) {
|
||||
changeTitle = change.ref
|
||||
}
|
||||
let changeText = ''
|
||||
if (change.url !== null) {
|
||||
let githubId = changeId.match(/^([0-9]+),([0-9a-f]{40})$/)
|
||||
|
|
|
@ -2348,6 +2348,10 @@ class QueueItem(object):
|
|||
ret['url'] = self.change.url
|
||||
else:
|
||||
ret['url'] = None
|
||||
if hasattr(self.change, 'ref') and self.change.ref is not None:
|
||||
ret['ref'] = self.change.ref
|
||||
else:
|
||||
ret['ref'] = None
|
||||
ret['id'] = self.change._id()
|
||||
if self.item_ahead:
|
||||
ret['item_ahead'] = self.item_ahead.change._id()
|
||||
|
|
Loading…
Reference in New Issue