diff --git a/web/src/containers/build/Buildset.jsx b/web/src/containers/build/Buildset.jsx
index 2ca70549dc..0dd78eaf96 100644
--- a/web/src/containers/build/Buildset.jsx
+++ b/web/src/containers/build/Buildset.jsx
@@ -179,9 +179,8 @@ function Buildset({ buildset, timezone, tenant, user }) {
function enqueueConfirm() {
setShowEnqueueModal(false)
if (buildset.change === null) {
- const oldrev = '0000000000000000000000000000000000000000'
- const newrev = buildset.newrev ? buildset.newrev : '0000000000000000000000000000000000000000'
- enqueue_ref(tenant.apiPrefix, buildset.project, buildset.pipeline, buildset.ref, oldrev, newrev)
+ enqueue_ref(tenant.apiPrefix, buildset.project, buildset.pipeline,
+ buildset.ref, buildset.oldrev, buildset.newrev)
.then(() => {
dispatch(addNotification(
{
@@ -234,6 +233,32 @@ function Buildset({ buildset, timezone, tenant, user }) {
)
}
+ function renderRefInfo(buildset) {
+ const refinfo = buildset.branch ? (
+ <>
+ Branch {buildset.branch}
+ >
+ ) : (
+ <>
+ Ref {buildset.ref}
+ >
+ )
+ const oldrev = buildset.oldrev ? (
+ <>
Old {buildset.oldrev}>
+ ) : ( <>> )
+ const newrev = buildset.newrev ? (
+ <>
New {buildset.newrev}>
+ ) : ( <>> )
+
+ return (
+ <>
+ {refinfo}
+ {oldrev}
+ {newrev}
+ >
+ )
+ }
+
return (
<>
@@ -275,18 +300,7 @@ function Buildset({ buildset, timezone, tenant, user }) {
}
- value={
- buildset.branch ? (
- <>
- Branch {buildset.branch}
- >
- ) : (
- <>
- Ref {buildset.ref}
- >
- )
- }
- />
+ value={renderRefInfo(buildset)}/>
}
diff --git a/web/src/containers/status/Change.jsx b/web/src/containers/status/Change.jsx
index ac0a4e6e84..5105718b8c 100644
--- a/web/src/containers/status/Change.jsx
+++ b/web/src/containers/status/Change.jsx
@@ -64,16 +64,7 @@ class Change extends React.Component {
let changeRef = change.ref
this.setState(() => ({ showDequeueModal: false }))
// post-merge
- if (/^[0-9a-f]{40}$/.test(changeId)) {
- dequeue_ref(tenant.apiPrefix, projectName, pipeline.name, changeRef)
- .then(() => {
- this.props.dispatch(fetchStatusIfNeeded(tenant))
- })
- .catch(error => {
- this.props.dispatch(addDequeueError(error))
- })
- // pre-merge, ie we have a change id
- } else if (changeId !== 'N/A') {
+ if (changeId !== 'N/A') {
dequeue(tenant.apiPrefix, projectName, pipeline.name, changeId)
.then(() => {
this.props.dispatch(fetchStatusIfNeeded(tenant))
@@ -82,12 +73,13 @@ class Change extends React.Component {
this.props.dispatch(addDequeueError(error))
})
} else {
- this.props.dispatch(addNotification({
- url: null,
- status: 'Invalid change ' + changeRef + ' on project ' + projectName,
- text: '',
- type: 'error',
- }))
+ dequeue_ref(tenant.apiPrefix, projectName, pipeline.name, changeRef)
+ .then(() => {
+ this.props.dispatch(fetchStatusIfNeeded(tenant))
+ })
+ .catch(error => {
+ this.props.dispatch(addDequeueError(error))
+ })
}
}
diff --git a/zuul/model.py b/zuul/model.py
index c2da4f65cf..53a2666eec 100644
--- a/zuul/model.py
+++ b/zuul/model.py
@@ -6450,8 +6450,8 @@ class ChangeManagementEvent(ManagementEvent):
else:
self.change_number, self.patch_number = (None, None)
self.ref = ref
- self.oldrev = oldrev or '0000000000000000000000000000000000000000'
- self.newrev = newrev or '0000000000000000000000000000000000000000'
+ self.oldrev = oldrev
+ self.newrev = newrev
self.timestamp = time.time()
span = trace.get_current_span()
self.span_context = tracing.getSpanContext(span)
diff --git a/zuul/web/__init__.py b/zuul/web/__init__.py
index de8e91c2c7..626defe923 100755
--- a/zuul/web/__init__.py
+++ b/zuul/web/__init__.py
@@ -1391,6 +1391,7 @@ class ZuulWebAPI(object):
'change': buildset.change,
'patchset': buildset.patchset,
'ref': buildset.ref,
+ 'oldrev': buildset.oldrev,
'newrev': buildset.newrev,
'ref_url': buildset.ref_url,
'event_id': buildset.event_id,
@@ -1487,6 +1488,7 @@ class ZuulWebAPI(object):
'change': buildset.change,
'patchset': buildset.patchset,
'ref': buildset.ref,
+ 'oldrev': buildset.oldrev,
'newrev': buildset.newrev,
'ref_url': buildset.ref_url,
'event_id': buildset.event_id,