Skip to content

Conversation

@arkjedrz
Copy link
Contributor

  • 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.

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

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: 042c341f-dc66-4fae-9a31-4763b9964912
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
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: 
WARNING: For repository 'rules_rust', the root module requires module version [email protected], but got [email protected] in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'rules_cc', the root module requires module version [email protected], but got [email protected] in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'platforms', the root module requires module version [email protected], but got [email protected] in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
Computing main repo mapping: 
Loading: 
Loading: 4 packages loaded
Loading: 4 packages loaded
    currently loading: 
Analyzing: target //:license-check (5 packages loaded, 0 targets configured)
Analyzing: target //:license-check (5 packages loaded, 0 targets configured)

Analyzing: target //:license-check (90 packages loaded, 9 targets configured)

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

Analyzing: target //:license-check (156 packages loaded, 5708 targets configured)

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

INFO: Analyzed target //:license-check (165 packages loaded, 9001 targets configured).

INFO: From Generating Dash formatted dependency file ...:
INFO: Successfully converted 65 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: 31.156s, Critical Path: 0.37s
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

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.

1 participant