From aaa485e2fc619e39e78411db857c7e02ae7dd001 Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Tue, 23 Jan 2024 16:09:15 +0100 Subject: [PATCH] Send messages to ISMAS for checking/repairing the customer repository --- worker.h | 72 ++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 62 insertions(+), 10 deletions(-) diff --git a/worker.h b/worker.h index 582cc3a..f86c94c 100644 --- a/worker.h +++ b/worker.h @@ -714,21 +714,73 @@ private: case UPDATE_STEP::CHECK_REPOSITORY: ismasClient.setProgressInPercent(_CHECK_REPOSITORY); break; - case UPDATE_STEP::CHECK_REPOSITORY_SUCCESS: + case UPDATE_STEP::CHECK_REPOSITORY_SUCCESS: { ismasClient.setProgressInPercent(_CHECK_REPOSITORY_SUCCESS); - break; - case UPDATE_STEP::CHECK_REPOSITORY_FAILURE: + QString const &ismasUpdateNews = + QString("#M=APISM#C=CMD_EVENT#J=") + + ismasClient.updateNewsToIsmas( + "U0010", + _CHECKOUT_REPOSITORY_SUCCESS, + IsmasClient::RESULT_CODE::SUCCESS, + smap[UPDATE_STEP::CHECK_REPOSITORY], + QString("REPOSITORY %1 AND BRANCH %2 OK") + .arg(instance->m_customerRepository) + .arg(instance->m_gc.branchName()).toStdString().c_str(), + instance->m_versionInfo.size() >= 1 ? instance->m_versionInfo.at(0).toUtf8().constData() : "N/A"); + ismasClient.sendRequestReceiveResponse( + IsmasClient::APISM::DB_PORT, ismasUpdateNews); + } break; + case UPDATE_STEP::CHECK_REPOSITORY_FAILURE: { ismasClient.setProgressInPercent(_CHECK_REPOSITORY_FAILURE); - break; - case UPDATE_STEP::CHECK_SANITY: + QString const &ismasUpdateNews = + QString("#M=APISM#C=CMD_EVENT#J=") + + ismasClient.updateNewsToIsmas( + "U0010", + _CHECKOUT_REPOSITORY_FAILURE, + IsmasClient::RESULT_CODE::INSTALL_ERROR, + smap[UPDATE_STEP::CHECKOUT_REPOSITORY], + QString("REPOSITORY %1 and BRANCH %2 ***NOT OK***") + .arg(instance->m_customerRepository) + .arg(instance->m_gc.branchName()).toStdString().c_str(), + instance->m_versionInfo.size() >= 1 ? instance->m_versionInfo.at(0).toUtf8().constData() : "N/A"); + ismasClient.sendRequestReceiveResponse( + IsmasClient::APISM::DB_PORT, ismasUpdateNews); + } break; + case UPDATE_STEP::CHECK_SANITY: { ismasClient.setProgressInPercent(_CHECK_SANITY); - break; - case UPDATE_STEP::CHECK_SANITY_SUCCESS: + } break; + case UPDATE_STEP::CHECK_SANITY_SUCCESS: { ismasClient.setProgressInPercent(_CHECK_SANITY_SUCCESS); - break; - case UPDATE_STEP::CHECK_SANITY_FAILURE: + QString const &ismasUpdateNews = + QString("#M=APISM#C=CMD_EVENT#J=") + + ismasClient.updateNewsToIsmas( + "U0010", + _CHECK_SANITY_SUCCESS, + IsmasClient::RESULT_CODE::SUCCESS, + smap[UPDATE_STEP::CHECK_SANITY], + QString("SANITY OF %1 (BRANCH %2) OK") + .arg(instance->m_customerRepository) + .arg(instance->m_gc.branchName()).toStdString().c_str(), + instance->m_versionInfo.size() >= 1 ? instance->m_versionInfo.at(0).toUtf8().constData() : "N/A"); + ismasClient.sendRequestReceiveResponse( + IsmasClient::APISM::DB_PORT, ismasUpdateNews); + } break; + case UPDATE_STEP::CHECK_SANITY_FAILURE: { ismasClient.setProgressInPercent(_CHECK_SANITY_FAILURE); - break; + QString const &ismasUpdateNews = + QString("#M=APISM#C=CMD_EVENT#J=") + + ismasClient.updateNewsToIsmas( + "U0010", + _CHECK_SANITY_FAILURE, + IsmasClient::RESULT_CODE::INSTALL_ERROR, + smap[UPDATE_STEP::CHECK_SANITY], + QString("SANITY OF %1 and BRANCH %2 ***NOT*** OK") + .arg(instance->m_customerRepository) + .arg(instance->m_gc.branchName()).toStdString().c_str(), + instance->m_versionInfo.size() >= 1 ? instance->m_versionInfo.at(0).toUtf8().constData() : "N/A"); + ismasClient.sendRequestReceiveResponse( + IsmasClient::APISM::DB_PORT, ismasUpdateNews); + } break; case UPDATE_STEP::REPOSITORY_RECOVERED_SUCCESS: ismasClient.setProgressInPercent(_REPOSITORY_RECOVERED_SUCCESS); break;