Skip to content

Conversation

@arkjedrz
Copy link
Contributor

@arkjedrz arkjedrz commented Nov 21, 2025

  • Backend implementation provided by DI.
  • Built-in JsonBackend is now public.
  • Added JsonBackendBuilder.
  • Added docs/class_diagram.puml with current design.
  • Updated tests and examples.

Resolves #203

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the KVS backend architecture to use dependency injection, making the backend implementation pluggable rather than hardcoded. The JsonBackend is now a public, configurable component with its own builder pattern.

Key changes:

  • Introduced KvsBackend trait with methods for loading, saving, and managing snapshots
  • Made JsonBackend public with JsonBackendBuilder for configuration
  • Removed file path methods from KVS API (get_kvs_filename, get_hash_filename)
  • Updated all tests and examples to use the new builder-based backend configuration

Reviewed Changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/rust/rust_kvs/src/lib.rs Exposed backend modules and updated prelude exports
src/rust/rust_kvs/src/kvs_backend.rs Defined KvsBackend trait with DynEq for dynamic equality checks
src/rust/rust_kvs/src/json_backend.rs Made JsonBackend public, added builder, moved snapshot rotation logic
src/rust/rust_kvs/src/kvs_builder.rs Refactored to accept backend via DI, simplified parameter handling
src/rust/rust_kvs/src/kvs.rs Delegated backend operations to injected backend implementation
src/rust/rust_kvs/src/kvs_api.rs Removed file path retrieval methods, added Eq derives
src/rust/rust_kvs/src/kvs_mock.rs Removed mock implementations of deleted file path methods
src/rust/rust_kvs_tool/src/kvs_tool.rs Added backend downcasting to access backend-specific methods
tests/rust_test_scenarios/src/helpers/mod.rs Added helper for computing expected file paths
tests/rust_test_scenarios/src/helpers/kvs_instance.rs Updated to build backend separately before passing to builder
tests/rust_test_scenarios/src/test_basic.rs Simplified to use helper function
tests/rust_test_scenarios/src/cit/*.rs Updated to use new helper and check file existence directly
tests/python_test_cases/tests/test_cit_snapshots.py Updated assertions to check path strings and existence flags
src/rust/rust_kvs/examples/*.rs Updated all examples to use new backend builder pattern
docs/class_diagram.puml Added PlantUML class diagram documenting new architecture

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link

github-actions bot commented Nov 21, 2025

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run //:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
Extracting Bazel installation...
Starting local Bazel server (8.3.0) and connecting to it...
INFO: Invocation ID: b59aa5a5-d6f7-4ece-8420-e28e174dd9a6
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
DEBUG: Rule 'rust_qnx8_toolchain+' indicated that a canonical reproducible form can be obtained by modifying arguments integrity = "sha256-oEubHgeZDdT0svMmBKJx7c3/2TdSI/vfwRUyDn+TPGA="
DEBUG: Repository rust_qnx8_toolchain+ instantiated at:
  <builtin>: in <toplevel>
Repository rule http_archive defined at:
  /home/runner/.bazel/external/bazel_tools/tools/build_defs/repo/http.bzl:394:31: in <toplevel>
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Loading: 
Loading: 5 packages loaded
Loading: 5 packages loaded
    currently loading: 
Analyzing: target //:license-check (6 packages loaded, 0 targets configured)
Analyzing: target //:license-check (6 packages loaded, 0 targets configured)

Analyzing: target //:license-check (88 packages loaded, 10 targets configured)

Analyzing: target //:license-check (149 packages loaded, 1936 targets configured)

Analyzing: target //:license-check (162 packages loaded, 3014 targets configured)

Analyzing: target //:license-check (165 packages loaded, 5028 targets configured)

INFO: Analyzed target //:license-check (165 packages loaded, 5030 targets configured).
INFO: From Generating Dash formatted dependency file ...:
INFO: Successfully converted 62 packages from Cargo.lock to bazel-out/k8-fastbuild/bin/formatted.txt
INFO: Found 1 target...
Target //:license.check.license_check up-to-date:
  bazel-bin/license.check.license_check
  bazel-bin/license.check.license_check.jar
INFO: Elapsed time: 20.584s, Critical Path: 0.36s
INFO: 14 processes: 5 disk cache hit, 9 internal.
INFO: Build completed successfully, 14 total actions
INFO: Running command line: bazel-bin/license.check.license_check ./formatted.txt <args omitted>
usage: org.eclipse.dash.licenses.cli.Main [-batch <int>] [-cd <url>]
       [-confidence <int>] [-ef <url>] [-excludeSources <sources>] [-help] [-lic
       <url>] [-project <shortname>] [-repo <url>] [-review] [-summary <file>]
       [-timeout <seconds>] [-token <token>]

@arkjedrz arkjedrz self-assigned this Nov 21, 2025
@github-actions
Copy link

The created documentation from the pull request is available at: docu-html

@arkjedrz arkjedrz force-pushed the arkjedrz_backend-api-changes-simplified branch 2 times, most recently from 697f11d to 8db77a1 Compare November 27, 2025 08:15
@arkjedrz arkjedrz force-pushed the arkjedrz_backend-api-changes-simplified branch 2 times, most recently from bf005a3 to 2b512a2 Compare December 8, 2025 13:32
@arkjedrz arkjedrz force-pushed the arkjedrz_backend-api-changes-simplified branch 4 times, most recently from ad5cae6 to e3945d4 Compare December 18, 2025 10:24
@pawelrutkaq
Copy link
Contributor

please link issue in PR description.

@arkjedrz arkjedrz force-pushed the arkjedrz_backend-api-changes-simplified branch from e3945d4 to 02ae015 Compare December 23, 2025 11:41
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 24 out of 24 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@pawelrutkaq pawelrutkaq left a comment

Choose a reason for hiding this comment

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

lgtm, since req are not ready yet code sound plausible. lets just fix doc copilot issues

@arkjedrz arkjedrz force-pushed the arkjedrz_backend-api-changes-simplified branch from 02ae015 to de5398e Compare December 23, 2025 13:19
@arkjedrz arkjedrz requested a review from Copilot December 23, 2025 13:21
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 24 out of 24 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Backend implementation provided by DI.
- Built-in `JsonBackend` is now public.
- Added `JsonBackendBuilder`.
- Added `docs/class_diagram.puml` with current design.
- Updated tests and examples.
@arkjedrz arkjedrz force-pushed the arkjedrz_backend-api-changes-simplified branch from de5398e to 31b1397 Compare December 23, 2025 13:26
@pawelrutkaq pawelrutkaq merged commit 6dbde7b into eclipse-score:main Dec 23, 2025
14 checks passed
@arkjedrz arkjedrz deleted the arkjedrz_backend-api-changes-simplified branch December 23, 2025 13:54
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.

Improvement: Backend abstraction

2 participants