Skip to content

Commit 6edc54f

Browse files
authored
[projmgr] Extend PLM status messages with parent component ID
1 parent bbe461d commit 6edc54f

4 files changed

Lines changed: 23 additions & 11 deletions

File tree

libs/rtemodel/include/RteInstance.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1589,10 +1589,17 @@ class RteFileInstance : public RteItemInstance
15891589
*/
15901590
std::string GetComponentUniqueID() const override;
15911591

1592+
/**
1593+
* @brief get partial component ID (without vendor)
1594+
* @param withBundle flag to include bundle in the ID
1595+
* @return partial component ID
1596+
*/
1597+
std::string GetPartialComponentID(bool withBundle) const override;
1598+
15921599
/**
15931600
* @brief get component aggregate ID
15941601
* @param withVersion
1595-
* @return
1602+
* @return component aggregate ID
15961603
*/
15971604
std::string GetComponentAggregateID() const override;
15981605

libs/rtemodel/src/RteInstance.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -853,6 +853,10 @@ string RteFileInstance::GetComponentID(bool withVersion) const
853853
return m_componentAttributes.GetComponentID(withVersion);
854854
}
855855

856+
string RteFileInstance::GetPartialComponentID(bool withBundle) const
857+
{
858+
return m_componentAttributes.GetPartialComponentID(withBundle);
859+
}
856860

857861
string RteFileInstance::GetComponentAggregateID() const
858862
{

tools/projmgr/src/ProjMgrWorker.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2344,10 +2344,11 @@ bool ProjMgrWorker::CheckConfigPLMFiles(ContextItem& context) {
23442344
regex_match(baseVersion, base, regEx);
23452345
regex_match(updateVersion, update, regEx);
23462346
if (base.size() == 4 && update.size() == 4) {
2347+
const string componentId = fi.second->GetPartialComponentID(true).empty() ? "" : " from component '" + fi.second->GetPartialComponentID(true) + "'";
23472348
auto GetUpdateMsg = [&](const string& severity) {
2348-
return "file '" + file + "' " + severity +
2349+
return severity + " for file '" + file + "'" + componentId +
23492350
(!RteFsUtils::Exists(file + '.' + RteUtils::UPDATE_STRING + '@' + updateVersion) ? "; use --update-rte" :
2350-
"; merge content from update file, rename update file to base file and remove previous base file");
2351+
".\nMerge content from update file, rename update file to base file and remove previous base file");
23512352
};
23522353
if (base[1] != update[1]) {
23532354
// major

tools/projmgr/test/src/ProjMgrUnitTests.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6692,11 +6692,11 @@ TEST_F(ProjMgrUnitTests, ConfigFilesUpdate) {
66926692

66936693
// --no-update-rte
66946694
std::vector<std::tuple<std::string, int, std::string, std::string>> testDataVector1 = {
6695-
{ "BaseUnknown", 0, "warning csolution: file '.*/startup_ARMCM3.c.base' not found; base version unknown", "missing base" },
6696-
{ "Patch", 0, "warning csolution: file '.*/startup_ARMCM3.c' update suggested; use --update-rte", "update suggested" },
6697-
{ "Minor", 0, "warning csolution: file '.*/startup_ARMCM3.c' update recommended; use --update-rte", "update recommended" },
6698-
{ "Major", 1, "error csolution: file '.*/startup_ARMCM3.c' update required; use --update-rte", "update required" },
6699-
{ "Missing", 1, "error csolution: file '.*/startup_ARMCM3.c' not found; use --update-rte", "missing file" },
6695+
{ "BaseUnknown", 0, "warning csolution: file '.*/startup_ARMCM3.c.base' not found; base version unknown", "missing base" },
6696+
{ "Patch", 0, "warning csolution: update suggested for file '.*/startup_ARMCM3.c' from component 'Device:Startup&RteTest Startup'; use --update-rte", "update suggested" },
6697+
{ "Minor", 0, "warning csolution: update recommended for file '.*/startup_ARMCM3.c' from component 'Device:Startup&RteTest Startup'; use --update-rte", "update recommended" },
6698+
{ "Major", 1, "error csolution: update required for file '.*/startup_ARMCM3.c' from component 'Device:Startup&RteTest Startup'; use --update-rte", "update required" },
6699+
{ "Missing", 1, "error csolution: file '.*/startup_ARMCM3.c' not found; use --update-rte", "missing file" },
67006700
};
67016701

67026702
for (const auto& [build, errCode, errMsg, status] : testDataVector1) {
@@ -6716,9 +6716,9 @@ TEST_F(ProjMgrUnitTests, ConfigFilesUpdate) {
67166716
// --update-rte
67176717
std::vector<std::tuple<std::string, int, std::string>> testDataVector2 = {
67186718
{ "BaseUnknown", 0, "" },
6719-
{ "Patch", 0, "warning csolution: file '.*/startup_ARMCM3.c' update suggested; merge content from update file, rename update file to base file and remove previous base file" },
6720-
{ "Minor", 0, "warning csolution: file '.*/startup_ARMCM3.c' update recommended; merge content from update file, rename update file to base file and remove previous base file" },
6721-
{ "Major", 1, "error csolution: file '.*/startup_ARMCM3.c' update required; merge content from update file, rename update file to base file and remove previous base file" },
6719+
{ "Patch", 0, "warning csolution: update suggested for file '.*/startup_ARMCM3.c' from component 'Device:Startup&RteTest Startup'.\nMerge content from update file, rename update file to base file and remove previous base file" },
6720+
{ "Minor", 0, "warning csolution: update recommended for file '.*/startup_ARMCM3.c' from component 'Device:Startup&RteTest Startup'.\nMerge content from update file, rename update file to base file and remove previous base file" },
6721+
{ "Major", 1, "error csolution: update required for file '.*/startup_ARMCM3.c' from component 'Device:Startup&RteTest Startup'.\nMerge content from update file, rename update file to base file and remove previous base file" },
67226722
{ "Missing", 0, "" },
67236723
};
67246724

0 commit comments

Comments
 (0)