Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(diagnostic_graph_aggregator): fix shadowFunction #7838

Merged
merged 2 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ FileLoader::FileLoader(const PathConfig * path)
}

TreeData tree = TreeData::Load(path->resolved);
const auto paths = tree.optional("files").children("files");
const auto files = tree.optional("files").children("files");
const auto edits = tree.optional("edits").children("edits");
const auto units = tree.optional("units").children("units");
for (const auto & data : paths) create_path_config(data);
for (const auto & data : files) create_path_config(data);
for (const auto & data : edits) create_edit_config(data);
for (const auto & data : units) create_unit_config(data);
}
Expand Down
12 changes: 6 additions & 6 deletions system/diagnostic_graph_aggregator/src/common/graph/data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,25 @@ TreeData::TreeData(const YAML::Node & yaml, const TreePath & path) : path_(path)
TreeData::Item TreeData::required(const std::string & name)
{
// TODO(Takagi, Isamu): check map type.
const auto path = path_.field(name);
const auto tree_path = path_.field(name);
if (!yaml_[name]) {
throw FieldNotFound(path);
throw FieldNotFound(tree_path);
}
const auto data = yaml_[name];
yaml_.remove(name);
return TreeData(data, path);
return TreeData(data, tree_path);
}

TreeData::Item TreeData::optional(const std::string & name)
{
// TODO(Takagi, Isamu): check map type.
const auto path = path_.field(name);
const auto tree_path = path_.field(name);
if (!yaml_[name]) {
return TreeData(YAML::Node(YAML::NodeType::Undefined), path);
return TreeData(YAML::Node(YAML::NodeType::Undefined), tree_path);
}
const auto data = yaml_[name];
yaml_.remove(name);
return TreeData(data, path);
return TreeData(data, tree_path);
}

bool TreeData::is_valid() const
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ void NodeUnit::initialize_status()

LeafUnit::LeafUnit(const UnitLoader & unit) : BaseUnit(unit)
{
const auto node = unit.data().required("node").text();
const auto name = unit.data().required("name").text();
const auto sep = node.empty() ? "" : ": ";
const auto diag_node = unit.data().required("node").text();
const auto diag_name = unit.data().required("name").text();
const auto sep = diag_node.empty() ? "" : ": ";

struct_.path = unit.path();
struct_.name = node + sep + name;
struct_.name = diag_node + sep + diag_name;
status_.level = DiagnosticStatus::STALE;
}

Expand Down
Loading