Anthony-Nolan / Atlas

A free & open-source Donor Search Algorithm Service
GNU General Public License v3.0
9 stars 5 forks source link

Add property to FailureInfo containing failure message #1033

Closed daria-sorokina-da closed 1 year ago

daria-sorokina-da commented 1 year ago

Currently if match prediction stage of the algorithm does not fail, and failure happens at a later stage, FailureInfo does not contain a failure message, see example:

{
"FailureMessage": "Search failed at stage: PersistSearchResults. See Application Insights for failure details.",
"FailureInfo": {
   "StageReached": "PersistSearchResults",
   "MatchingAlgorithmFailureInfo": null,
   "WillRetry": false
},
"MatchingAlgorithmTime": "00:00:00",
"MatchPredictionTime": "00:00:00",
"OverallSearchTime": "00:00:00",
"SearchRequestId": "2fdbf2e0-7001-4ae1-b3a7-b37ad713c26e",
"WasSuccessful": false,
"RepeatSearchRequestId": null,
"BlobStorageContainerName": null,
"ResultsFileName": null,
"NumberOfResults": null,
"MatchingAlgorithmHlaNomenclatureVersion": null,
"ResultsBatched": false,
"BatchFolderName": null
}

Here MatchingAlgorithmFailureInfo is null, because the failure happened on a later stage.

Let's add a property FailureMessage / Message to FailureInfo to cover that, i.e. it should contain "Search failed at stage: PersistSearchResults" in this case.

Please note that FailureMessage in the root of this JSON is obsolete, and should be removed in the upcoming releases, as all failure info should be in FailureInfo property.

zabeen commented 1 year ago

Design suggestion: new prop, FailureInfo.Message could be a function of the other props by copying this code into the model.

zabeen commented 1 year ago

Testing

Regression testing

zabeen commented 1 year ago

Test Results

zabeen commented 1 year ago

@WMDAJesse FYI, this the new prop containing the failure message, and here is the changeset for more context.