-
Notifications
You must be signed in to change notification settings - Fork 36
feat(deps): add score_config_management to reference integration #299
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
Open
Chahult
wants to merge
4
commits into
eclipse-score:main
Choose a base branch
from
Chahult:feat/add_score_config_management
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+238
−0
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
171 changes: 171 additions & 0 deletions
171
patches/config_management/001-adapt-proxy-api-and-remove-internal-targets.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,171 @@ | ||
| diff --git a/score/config_management/config_provider/BUILD b/score/config_management/config_provider/BUILD | ||
| index e0d763b..0dd66b9 100644 | ||
| --- a/score/config_management/config_provider/BUILD | ||
| +++ b/score/config_management/config_provider/BUILD | ||
| @@ -14,13 +14,6 @@ alias( | ||
| visibility = ["//visibility:public"], | ||
| ) | ||
|
|
||
| -cc_library( | ||
| - name = "config_provider_factory_impl", | ||
| - tags = ["FUSA"], | ||
| - visibility = ["//visibility:public"], | ||
| - deps = ["//score/config_management/config_provider/code/config_provider/factory:factory_socal_r20_11"], | ||
| -) | ||
| - | ||
| cc_library( | ||
| name = "config_provider_mw_com", | ||
| tags = ["FUSA"], | ||
| @@ -28,12 +21,6 @@ cc_library( | ||
| deps = ["//score/config_management/config_provider/code/config_provider/factory:factory_mw_com"], | ||
| ) | ||
|
|
||
| -alias( | ||
| - name = "config_provider_factory_for_unit_test", | ||
| - actual = "//score/config_management/config_provider/code/config_provider/factory:factory_socal_r20_11_for_unit_tests", | ||
| - visibility = ["//visibility:public"], | ||
| -) | ||
| - | ||
| cc_unit_test_suites_for_host_and_qnx( | ||
| name = "unit_tests", | ||
| test_suites_from_sub_packages = [ | ||
| @@ -45,14 +32,6 @@ cc_unit_test_suites_for_host_and_qnx( | ||
| visibility = ["//score/config_management:__pkg__"], | ||
| ) | ||
|
|
||
| -test_suite( | ||
| - name = "component_tests", | ||
| - tests = [ | ||
| - "//score/config_management/config_provider/test/sct:component_tests", | ||
| - ], | ||
| - visibility = ["//score/config_management:__pkg__"], | ||
| -) | ||
| - | ||
| clang_tidy_extra_checks( | ||
| name = "clang_tidy_extra_checks", | ||
| extra_features = [ | ||
| diff --git a/score/config_management/config_provider/code/config_provider/details/config_provider_impl.cpp b/score/config_management/config_provider/code/config_provider/details/config_provider_impl.cpp | ||
| index 6784355..c6f05ea 100644 | ||
| --- a/score/config_management/config_provider/code/config_provider/details/config_provider_impl.cpp | ||
| +++ b/score/config_management/config_provider/code/config_provider/details/config_provider_impl.cpp | ||
| @@ -46,7 +46,7 @@ std::string GetParameterSetValue(mw::log::Logger& logger, const ParameterSet& pa | ||
| } // namespace | ||
|
|
||
| ConfigProviderImpl::ConfigProviderImpl( | ||
| - mw::service::OptionalProxyData<IInternalConfigProvider> proxy_data, | ||
| + mw::service::ProxyFuture<std::unique_ptr<IInternalConfigProvider>> proxy_future, | ||
| score::cpp::stop_token user_stop_token, | ||
| score::cpp::pmr::memory_resource* const memory_resource, | ||
| score::cpp::optional<std::size_t> max_samples_limit, | ||
| @@ -78,22 +78,23 @@ ConfigProviderImpl::ConfigProviderImpl( | ||
| score::cpp::ignore = proxy_available_thread_.emplace( | ||
| [this](const score::cpp::stop_token jthread_stop_token, | ||
| decltype(callback) notification_callback, | ||
| - decltype(proxy_data) pd) mutable { | ||
| - auto proxy_holder = pd.GetProxyFuture().Get(jthread_stop_token); | ||
| - pd.StopServiceDiscovery(); | ||
| - if (proxy_holder.has_value()) | ||
| + decltype(proxy_future) pf) mutable { | ||
| + auto proxy_holder = pf.Get(jthread_stop_token); | ||
| + if (proxy_holder.has_value() && (proxy_holder.value() != nullptr)) | ||
| { | ||
| logger_.LogInfo() << "ProxyAvailableThread: InternalConfigProvider proxy is connected"; | ||
| SetupInternalConfigProvider( | ||
| - std::move(proxy_holder).value(), std::move(notification_callback), jthread_stop_token); | ||
| + std::shared_ptr<IInternalConfigProvider>(std::move(proxy_holder).value()), | ||
| + std::move(notification_callback), | ||
| + jthread_stop_token); | ||
| } | ||
| else | ||
| { | ||
| - logger_.LogInfo() << "ProxyAvailableThread: No proxy found: " << proxy_holder.error().Message(); | ||
| + logger_.LogInfo() << "ProxyAvailableThread: No proxy found"; | ||
| } | ||
| }, | ||
| std::move(callback), | ||
| - std::move(proxy_data)); | ||
| + std::move(proxy_future)); | ||
|
|
||
| score::cpp::ignore = stop_callback_.emplace(user_stop_token, [this]() { | ||
| score::cpp::ignore = proxy_available_thread_->request_stop(); | ||
| diff --git a/score/config_management/config_provider/code/config_provider/details/config_provider_impl.h b/score/config_management/config_provider/code/config_provider/details/config_provider_impl.h | ||
| index 508555c..7630e60 100644 | ||
| --- a/score/config_management/config_provider/code/config_provider/details/config_provider_impl.h | ||
| +++ b/score/config_management/config_provider/code/config_provider/details/config_provider_impl.h | ||
| @@ -24,6 +24,7 @@ | ||
|
|
||
| #include "score/concurrency/condition_variable.h" | ||
| #include "score/mw/service/proxy_data.h" | ||
| +#include "score/mw/service/proxy_future.h" | ||
|
|
||
| #include <score/jthread.hpp> | ||
| #include <score/memory.hpp> | ||
| @@ -87,7 +88,7 @@ class ConfigProviderImpl final : public ConfigProvider | ||
| bool IsAwaitingProxyConnection() const noexcept; | ||
|
|
||
| ConfigProviderImpl( | ||
| - mw::service::OptionalProxyData<IInternalConfigProvider> proxy_data, | ||
| + mw::service::ProxyFuture<std::unique_ptr<IInternalConfigProvider>> proxy_future, | ||
| score::cpp::stop_token user_stop_token, | ||
| score::cpp::pmr::memory_resource* const memory_resource, | ||
| score::cpp::optional<std::size_t> max_samples_limit, | ||
| diff --git a/score/config_management/config_provider/code/config_provider/details/config_provider_impl_test.cpp b/score/config_management/config_provider/code/config_provider/details/config_provider_impl_test.cpp | ||
| index 8bd5f2f..ed559ea 100644 | ||
| --- a/score/config_management/config_provider/code/config_provider/details/config_provider_impl_test.cpp | ||
| +++ b/score/config_management/config_provider/code/config_provider/details/config_provider_impl_test.cpp | ||
| @@ -182,7 +182,7 @@ class ConfigProviderTest : public ::testing::Test | ||
| auto CreateConfigProviderWithAvailableCallback(IsAvailableNotificationCallback callback) | ||
| { | ||
| return std::make_unique<ConfigProviderImpl>( | ||
| - mw::service::OptionalProxyData<IInternalConfigProvider>{promise_.GetInterruptibleFuture().value()}, | ||
| + promise_.GetInterruptibleFuture().value(), | ||
| stop_source_.get_token(), | ||
| score::cpp::pmr::get_default_resource(), | ||
| score::cpp::nullopt, // default max_samples_limit | ||
| @@ -196,7 +196,7 @@ class ConfigProviderTest : public ::testing::Test | ||
| IsAvailableNotificationCallback callback) | ||
| { | ||
| return std::make_unique<ConfigProviderImpl>( | ||
| - mw::service::OptionalProxyData<IInternalConfigProvider>{promise_.GetInterruptibleFuture().value()}, | ||
| + promise_.GetInterruptibleFuture().value(), | ||
| stop_source_.get_token(), | ||
| score::cpp::pmr::get_default_resource(), | ||
| score::cpp::nullopt, | ||
| diff --git a/score/config_management/config_provider/code/config_provider/factory/factory_mw_com.h b/score/config_management/config_provider/code/config_provider/factory/factory_mw_com.h | ||
| index 5aeca26..123868b 100644 | ||
| --- a/score/config_management/config_provider/code/config_provider/factory/factory_mw_com.h | ||
| +++ b/score/config_management/config_provider/code/config_provider/factory/factory_mw_com.h | ||
| @@ -182,7 +182,8 @@ class ConfigProviderFactory final | ||
| logger_.LogDebug() << "ConfigProviderFactory:: Create ConfigProviderImpl"; | ||
| auto config_provider = score::cpp::pmr::make_unique<ConfigProviderImpl>( | ||
| memory_resource, | ||
| - proxy_container.template Extract<mw::service::Optional<IInternalConfigProvider>>(), | ||
| + static_cast<mw::service::ProxyFuture<std::unique_ptr<IInternalConfigProvider>>>( | ||
| + proxy_container.template Extract<mw::service::Optional<IInternalConfigProvider>>()), | ||
| token, | ||
| memory_resource, | ||
| max_samples_limit, | ||
| diff --git a/score/config_management/config_daemon/code/app/details/BUILD b/score/config_management/config_daemon/code/app/details/BUILD | ||
| index 63e9161..db9b630 100644 | ||
| --- a/score/config_management/config_daemon/code/app/details/BUILD | ||
| +++ b/score/config_management/config_daemon/code/app/details/BUILD | ||
| @@ -52,6 +52,7 @@ cc_library( | ||
| "//score/config_management/config_daemon/code/factory:interface_for_unit_test", | ||
| "//score/config_management/config_daemon/code/fault_event_reporter", | ||
| "@score_baselibs//score/scope_exit", | ||
| + "@score_lifecycle_health//score/launch_manager:application_cc", | ||
| "@score_lifecycle_health//score/launch_manager:applicationcontext_mock_cc", | ||
| "@score_logging//score/mw/log", | ||
| ], | ||
| diff --git a/score/config_management/config_daemon/code/BUILD b/score/config_management/config_daemon/code/BUILD | ||
| index b9a1469..7fdb370 100644 | ||
| --- a/score/config_management/config_daemon/code/BUILD | ||
| +++ b/score/config_management/config_daemon/code/BUILD | ||
| @@ -76,6 +76,7 @@ cc_binary( | ||
| deps = [ | ||
| "//score/config_management/config_daemon/code/app/details:app", | ||
| "//score/config_management/config_daemon/code/factory/details:mw_factory", | ||
| + "@score_lifecycle_health//score/launch_manager:lifecyclemanager_cc", | ||
| "@score_lifecycle_health//score/launch_manager:runapplication_cc", | ||
| ], | ||
| ) |
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| { | ||
| "name": "Config Management Daemon Example", | ||
| "description": "Example for running the config management daemon with demo parameters", | ||
| "apps": [ | ||
| { | ||
| "path": "/showcases/bin/config_daemon", | ||
| "args": [ | ||
| "-s", "/showcases/data/config_management/etc/mw_com_config.json" | ||
| ], | ||
| "env": {}, | ||
| "dir": "/showcases/data/config_management" | ||
| } | ||
| ] | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why we need those exclusions ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1.mw_com tests: require a running LoLa/SOME/IP runtime — the tests themselves are tagged "exclusive" because "Sandboxing is not properly working with LoLa message passing 2.0". Same reason score_communication excludes //score/mw/com/impl:unit_test_runtime_single_exec and //score/mw/com/impl:runtime_test.
2.dependability/...: these are component/dependable_element safety-metadata targets from score_tooling, not executable tests. Including //... without filtering them would cause build failures.