Skip to content

Commit

Permalink
TP: do not mark DSR (ds request) complete if ds update fails due to v…
Browse files Browse the repository at this point in the history
…alidation error (apache#5198)

* do not mark dsr complete is ds update fails due to validation error

* adds CHANGELOG.md entry

* updates comment
  • Loading branch information
mitchell852 authored Oct 26, 2020
1 parent 5940129 commit eff7c18
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Added default sort logic to GET API calls using Read()

### Fixed
- Fixed #5188 - DSR (delivery service request) incorrectly marked as complete and error message not displaying when DSR fulfilled and DS update fails in Traffic Portal. [Related Github issues](https://github.com/apache/trafficcontrol/issues/5188)
- Fixed #3455 - Alphabetically sorting CDN Read API call [Related Github issues](https://github.com/apache/trafficcontrol/issues/3455)
- Fixed #5010 - Fixed Reference urls for Cache Config on Delivery service pages (HTTP, DNS) in Traffic Portal. [Related Github issues](https://github.com/apache/trafficcontrol/issues/5010)
- Fixed #5147 - GET /servers?dsId={id} should only return mid servers (in addition to edge servers) for the cdn of the delivery service if the mid tier is employed. [Related github issues](https://github.com/apache/trafficcontrol/issues/5147)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ var FormEditDeliveryServiceController = function(deliveryService, origin, topolo
if (autoFulfilled) {
// assign the ds request
promises.push(deliveryServiceRequestService.assignDeliveryServiceRequest(response.id, userModel.user.id));
// set the status to 'complete'
promises.push(deliveryServiceRequestService.updateDeliveryServiceRequestStatus(response.id, 'complete'));
// set the status to 'submitted'
promises.push(deliveryServiceRequestService.updateDeliveryServiceRequestStatus(response.id, 'submitted'));
}
}
);
Expand Down Expand Up @@ -234,13 +234,20 @@ var FormEditDeliveryServiceController = function(deliveryService, origin, topolo
deliveryServiceService.updateDeliveryService(deliveryService).
then(
function() {
// upon successful update of ds, set the dsr to 'complete'
deliveryServiceRequestService.getDeliveryServiceRequests({ xmlId: deliveryService.xmlId, status: 'submitted' }).then(
function(response) {
deliveryServiceRequestService.updateDeliveryServiceRequestStatus(response[0].id, 'complete');
}
);
$state.reload(); // reloads all the resolves for the view
messageModel.setMessages([ { level: 'success', text: 'Delivery Service [ ' + deliveryService.xmlId + ' ] updated' } ], false);
}
).catch(function(fault) {
$anchorScroll(); // scrolls window to top
messageModel.setMessages(fault.data.alerts, false);
});
// if the ds update fails, send to dsr view w/ error message
locationUtils.navigateToPath('/delivery-service-requests');
messageModel.setMessages(fault.data.alerts, true);
});
}).catch(function(fault) {
$anchorScroll(); // scrolls window to top
messageModel.setMessages(fault.data.alerts, false);
Expand Down

0 comments on commit eff7c18

Please sign in to comment.