Skip to content

implement configuration by file. - #595

Open
Ahmed-Elsaka-JC wants to merge 2 commits into
eclipse-score:mainfrom
Ahmed-Elsaka-JC:afe_config_by_file_per
Open

Ahmed-Elsaka-JC wants to merge 2 commits into
eclipse-score:mainfrom
Ahmed-Elsaka-JC:afe_config_by_file_per

Conversation

@Ahmed-Elsaka-JC

Copy link
Copy Markdown
Contributor

adding new support to config by file

#411

@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run --lockfile_mode=error //:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
Starting local Bazel server (8.7.0) and connecting to it...
INFO: Invocation ID: a1a06680-0a9f-4234-aec7-24c77806ec06
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Loading: 
Loading: 2 packages loaded
Loading: 2 packages loaded
    currently loading: 
Loading: 2 packages loaded
    currently loading: 
Loading: 2 packages loaded
    currently loading: 
Loading: 2 packages loaded
    currently loading: 
Loading: 2 packages loaded
    currently loading: 
Loading: 2 packages loaded
    currently loading: 
Analyzing: target //:license-check (3 packages loaded, 0 targets configured)
Analyzing: target //:license-check (3 packages loaded, 0 targets configured)

Analyzing: target //:license-check (83 packages loaded, 14 targets configured)

Analyzing: target //:license-check (99 packages loaded, 14 targets configured)

Analyzing: target //:license-check (100 packages loaded, 14 targets configured)

Analyzing: target //:license-check (100 packages loaded, 14 targets configured)

Analyzing: target //:license-check (153 packages loaded, 3717 targets configured)

Analyzing: target //:license-check (204 packages loaded, 8002 targets configured)

Analyzing: target //:license-check (207 packages loaded, 11661 targets configured)

Analyzing: target //:license-check (207 packages loaded, 11661 targets configured)

Analyzing: target //:license-check (212 packages loaded, 17771 targets configured)

Analyzing: target //:license-check (212 packages loaded, 17774 targets configured)

Analyzing: target //:license-check (212 packages loaded, 17774 targets configured)

INFO: Analyzed target //:license-check (213 packages loaded, 17903 targets configured).
[12 / 16] JavaToolchainCompileClasses external/rules_java+/toolchains/platformclasspath_classes; 0s disk-cache, processwrapper-sandbox ... (2 actions running)
INFO: From Generating Dash formatted dependency file ...:
INFO: Successfully converted 50 packages from Cargo.lock to bazel-out/k8-fastbuild/bin/tools/formatted.txt
[14 / 16] JavaToolchainCompileBootClasspath external/rules_java+/toolchains/platformclasspath.jar; 0s disk-cache, processwrapper-sandbox
INFO: Found 1 target...
Target //tools:license.check.license_check up-to-date:
  bazel-bin/tools/license.check.license_check
  bazel-bin/tools/license.check.license_check.jar
INFO: Elapsed time: 53.757s, Critical Path: 2.49s
INFO: 16 processes: 12 internal, 3 processwrapper-sandbox, 1 worker.
INFO: Build completed successfully, 16 total actions
INFO: Running command line: bazel-bin/tools/license.check.license_check tools/formatted.txt <args omitted>
[main] INFO Querying Eclipse Foundation for license data for 42 items.
[main] INFO Found 32 items.
[main] INFO Querying ClearlyDefined for license data for 10 items.
[main] INFO Found 10 items.
[main] INFO License information could not be automatically verified for the following content:
[main] INFO 
[main] INFO crate/cratesio/-/lazy_static/1.5.1
[main] INFO 
[main] INFO This content is either not correctly mapped by the system, or requires review.

@github-actions

Copy link
Copy Markdown
Contributor

Documentation preview for this pull request is available at:
pr-595: https://eclipse-score.github.io/persistency/pr-595/

@Ahmed-Elsaka-JC
Ahmed-Elsaka-JC deployed to workflow-approval October 27, 2026 10:52 — with GitHub Actions Active
@Ahmed-Elsaka-JC
Ahmed-Elsaka-JC deployed to workflow-approval October 27, 2026 10:52 — with GitHub Actions Active

@arkjedrz arkjedrz 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.

Review to internal/ files is not thorough yet, since many raised points relate to design.

#include <optional>

/*
* This header declares the abstraction over deployment-time "configuration by file" discovery and

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.

Since this is generated - ask Your LLM of choice to rework docs and comments. Following rules seem to be a good first step.

  • Be concise, use short sentences.
  • One sentence per line.
  • If a sentence is too long, try to rephrase it first.
  • This one's interesting, but turned out to be the most effective. Write as if it was written for an impatient developer that is not using English as a native language.

This is required, because otherwise those docs needlessly meander.

namespace score::mw::per::kvs
{

class IKvsConfigParser

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 use non-prefixed name for interface, and then suffix Impl for concrete implementation.
This is the already-required approach in baselibs, already followed by logging.

#include <cstddef>
#include <optional>

/*

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.

Follow new docs format. /// for docs, Doxygen-style @xyz keywords, // for comments.

* input: the `InstanceId::id` of the KVS instance about to be opened.
* behavior: Discovers whether a configuration-by-file document applies at all, and if so
* parses and strictly validates it in full before looking for an entry matching
* `instance_id`. Performs no mutation; intended to be called once per

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.

Performs no mutation -> then the function should be marked as const, and docs require no additional statement.

* input: the `InstanceId::id` of the KVS instance about to be opened.
* behavior: Discovers whether a configuration-by-file document applies at all, and if so
* parses and strictly validates it in full before looking for an entry matching
* `instance_id`. Performs no mutation; intended to be called once per

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.

intended to be called once per -> additional request to LLM, do not state what is the expected usage and even where it is used, this is just a fluff.

(void)value;
const std::string_view key_view = key.GetAsStringView();
bool found = false;
for (const auto& allowed_key : allowed)

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.

std::any_of, return false quickly if not satisfied.
Do not use single point of return rule.

score::Unexpected KvsConfigParser::fail(ErrorCode code, std::string_view user_message) const
{
const auto error = MakeError(code, user_message);
logger_->LogError() << "KVS config:" << error.Message() << error.UserMessage();

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.

logger_ can become an object placed in anonymous namespace, then this function can be in anonymous function as well. Or a KVS-wide internal object, because it's using the same code.

return fail(ErrorCode::InvalidConfiguration, "unknown need_* value");
}

/*

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.

cpp is not a place for docs.


/*
* Determine the directory containing the currently running binary.
* Used only as part of the fallback configuration file lookup; exposed for unit testing.

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.

No fallback or candidates. It's a known path or an error.

EDIT: took a look at communication, here it's a default constructor or given path, but the overall approach is different - RuntimeConfiguration is created first, then provided to Initialize function. This is incompatible with persistency approach, but as mentioned in other comment - maybe other places in persistency component need a redesign too.

* Determine the directory containing the currently running binary.
* Used only as part of the fallback configuration file lookup; exposed for unit testing.
*/
std::optional<std::string> running_binary_directory() const;

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.

Do not pollute public API. I disagree this is needed, but if it is - move to anonymous namespace, and recreate in unit tests.

@Ahmed-Elsaka-JC
Ahmed-Elsaka-JC deployed to workflow-approval October 27, 2026 12:08 — with GitHub Actions Active
@Ahmed-Elsaka-JC
Ahmed-Elsaka-JC deployed to workflow-approval October 27, 2026 12:08 — with GitHub Actions Active

This branch was successfully deployed

1 active deployment
workflow-approval — 4ad857d5 Deployed Oct 27, 2026 by Ahmed-Elsaka-JC via qnx-build (score-qnx-aarch64) / approval #1445
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants