Skip to content

Support loading add-on configurations - #930

Queued
SebSparrowHawk wants to merge 1 commit into
eclipse-score:mainfrom
SebSparrowHawk:ssp_merging_addon_configs
Queued

Support loading add-on configurations#930
SebSparrowHawk wants to merge 1 commit into
eclipse-score:mainfrom
SebSparrowHawk:ssp_merging_addon_configs

Conversation

@SebSparrowHawk

@SebSparrowHawk SebSparrowHawk commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Enables users to load add-on mw::com configurations after loading the actual application's configuration.
Only service definitions of these add-on configurations will be considered and merged into the existing configuration if there is no conflict with the already existing configuration.
Restructured the Configuration's internal data structures for service types and service instances so that the use of mutex/locks to protect the configuration can be limited to a minimum.

Review Checklist Evidence Notice - Merge Queue

This pull request was modified after the review checklist evidence was recorded.
The review checklist evidence visible here does no longer reflect the evidence that will be recorded at merge.
Please rely on the evidence in the git history once the pull request was merged.

The git history shows the evidence state at the time of merge queue entry.
A pull request may only enter the merge queue when all necessary review checklist acknowledgements are in place.
Changes made after this pull request enters the merge queue may update the evidence here,
but they do not affect the evidence recorded in the git history.

Comment thread score/mw/com/impl/configuration/configuration.cpp Fixed
Comment thread score/mw/com/impl/configuration/configuration.cpp Fixed
Comment thread score/mw/com/impl/runtime.cpp Fixed
Comment thread score/mw/com/impl/runtime.cpp Fixed
@SebSparrowHawk
SebSparrowHawk force-pushed the ssp_merging_addon_configs branch 2 times, most recently from 4569701 to a7c0120 Compare August 17, 2026 14:03

@castler castler left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed, we have to rethink the "add" logik.

Comment thread score/mw/com/impl/instance_identifier.h Outdated
Comment on lines +183 to +186
*
* Pointer to Configuration is an atomic pointer because SetConfiguration() might be called from different threads,
* while it is read from Create() concurrently. Using std::atomic avoids the data race that could occur in this
* situation.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not change with the addon configuration feature - does it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

Comment thread score/mw/com/impl/runtime.cpp Outdated
{
return merge_result;
}
InstanceIdentifier::SetConfiguration(&configuration_);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why should we do that? We are just changing the content of the original configuration object, its not that we create a new one. Thus, this change is not needed! You can then remove also the changes in the InstanceIdentifier no?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, removed that.

Comment on lines +60 to +63
// Suppress "AUTOSAR C++14 A11-3-1", The rule declares: "Friend declarations shall not be used".
// Test only use to check internal state of configuration after (merge) operations.
// coverity[autosar_cpp14_a11_3_1_violation]
friend class ConfigurationFixture;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What internal state is that? Should not every change be publicly visible?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the moment there are methods "ServiceTypeDeployments GetServiceTypes() const noexcept" and "ServiceInstanceDeployments GetServiceInstances() const noexcept" that are defined as private methods.
Because they should only be used internally and are useful for some test checks.

Comment thread score/mw/com/impl/instance_identifier.h Outdated

#include "score/result/result.h"

#include <atomic>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This include should not be needed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, removed


#include "score/result/result.h"

#include "score/mw/log/logging.h"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are not performing any logging in the header.

If you add this here, this will pollute the dependencies, thus better remove it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed it.

/// over the persisted storage.
ServiceTypeDeployments GetServiceTypes() const noexcept
{
auto result = ServiceTypeDeployments();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are initializing here the variable no?

Then easiest would be:

ServiceTypeDeployments result{};

otherwise its not clear if you are invoking a constructor in 160 or a method or ....

/// directly over the persisted storage.
ServiceInstanceDeployments GetServiceInstances() const noexcept
{
auto result = ServiceInstanceDeployments();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same statement as above, prefer {}-Initialization.

for (auto& element : *current_list.get())
{
for (auto& entry : *element.get())
{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question above, should those be moved - if no, make it const

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't be moved, I'll make them const


/// \brief Helper function to check if entry for this service_identifier is already stored in list of service type
/// deployments
static bool CheckServiceTypeExists(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we make this static and the pass the member variable? Same question for the function below

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to avoid to call std:.atomic_load_explicit(...) in a loop and therefore decided to load it just once and pass it by reference.
If that should be avoided, I could think about restructuring the whole check logic.

GlobalConfiguration global_configuration_;
TracingConfiguration tracing_configuration_;

std::mutex merge_mutex_;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please give an explanation in a comment what this mutex is used for.

Only used to avoid parallel merges...or something like that. Not used in "read" path, due to atomic list construct...yada yada

@SebSparrowHawk
SebSparrowHawk force-pushed the ssp_merging_addon_configs branch 2 times, most recently from f00263b to a990e5c Compare August 20, 2026 08:18
castler
castler previously approved these changes Aug 20, 2026
@SebSparrowHawk
SebSparrowHawk marked this pull request as ready for review August 20, 2026 08:57
@castler
castler added this pull request to the merge queue Aug 20, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 20, 2026
@SebSparrowHawk
SebSparrowHawk force-pushed the ssp_merging_addon_configs branch from a990e5c to b60b823 Compare August 20, 2026 11:45
castler
castler previously approved these changes Aug 20, 2026
@castler
castler added this pull request to the merge queue Aug 20, 2026
@github-actions

Copy link
Copy Markdown

Review Checklist Evidence Notice - Merge Queue

This pull request was modified after the review checklist evidence was recorded.
The review checklist evidence visible here does no longer reflect the evidence that will be recorded at merge.
Please rely on the evidence in the git history once the pull request was merged.

The git history shows the evidence state at the time of merge queue entry.
A pull request may only enter the merge queue when all necessary review checklist acknowledgements are in place.
Changes made after this pull request enters the merge queue may update the evidence here,
but they do not affect the evidence recorded in the git history.

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 20, 2026
@castler
castler added this pull request to the merge queue Aug 20, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 20, 2026
Enables users to load additional mw::com configurations. Introduced a new public API to load
these configurations. It is expected that a complete configuration has been loaded before.
The data structures of a Configuration to hold service type and service instance information has been
changed in order to limit the required usage of mutexes to a minimum.
@castler
castler added this pull request to the merge queue Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

3 participants