Allow for the omission of the insight node in bloom.yaml (as we no longer have any mandatory Insight config params)

This commit is contained in:
Nav
2023-08-22 17:12:16 +01:00
parent c90f92e038
commit 35a534b3ed
2 changed files with 6 additions and 10 deletions

View File

@@ -311,15 +311,7 @@ void Application::loadProjectConfiguration() {
this->environmentConfig = selectedEnvironmentIt->second; this->environmentConfig = selectedEnvironmentIt->second;
#ifndef EXCLUDE_INSIGHT #ifndef EXCLUDE_INSIGHT
if (this->environmentConfig->insightConfig.has_value()) { this->insightConfig = this->environmentConfig->insightConfig.value_or(this->projectConfig->insightConfig);
this->insightConfig = this->environmentConfig->insightConfig.value();
} else if (this->projectConfig->insightConfig.has_value()) {
this->insightConfig = this->projectConfig->insightConfig.value();
} else {
throw InvalidConfig("Insight configuration missing.");
}
#endif #endif
if (this->environmentConfig->debugServerConfig.has_value()) { if (this->environmentConfig->debugServerConfig.has_value()) {

View File

@@ -217,8 +217,12 @@ struct ProjectConfig
/** /**
* Application level Insight configuration. We use this as a fallback if no Insight config is provided at * Application level Insight configuration. We use this as a fallback if no Insight config is provided at
* the environment level. * the environment level.
*
* We don't use std::optional here because the InsightConfig has no mandatory parameters, so users may wish to
* omit the 'insight' node from their bloom.yaml file, entirely. In this case, Bloom should fall back to a default
* constructed, project-level, InsightConfig instance.
*/ */
std::optional<InsightConfig> insightConfig; InsightConfig insightConfig = InsightConfig();
bool debugLoggingEnabled = false; bool debugLoggingEnabled = false;