Skip to content

LCORE-1057: create the parent directory in the A2A SQLite store - #2847

Merged
radofuchs merged 1 commit into
lightspeed-core:mainfrom
snuryyeva:snuryyeva/parent_directory
Oct 8, 2026
Merged

radofuchs merged 1 commit into
lightspeed-core:mainfrom
snuryyeva:snuryyeva/parent_directory

Conversation

@snuryyeva

@snuryyeva snuryyeva commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Description

SQLight does not create missing parent directories. The A2A message/send request opens /tmp/data/a2a-state.db before that directory exists, which fails GitHub Actions CI with:

(sqlite3.OperationalError) unable to open database file

link : https://github.com/snuryyeva/lightspeed-stack/actions/runs/37062953377/job/111023767535

This PR adds creation of the parent directory when the A2A SQLite store is opened, the same way feedback and transcript storage create theirs.

Type of change

  • Refactor
  • New feature
  • Bug fix
  • CVE fix
  • Optimization
  • Documentation Update
  • Configuration Update
  • Bump-up service version
  • Bump-up dependent library [pyproject.toml + uv.lock]
  • Bump-up dependent library [requirements.*.txt for Konflux]
  • Bump-up library or tool used for development (does not change the final image)
  • CI configuration change
  • Konflux configuration change
  • Unit tests improvement
  • Integration tests improvement
  • End to end tests improvement
  • Benchmarks improvement

Tools used to create PR

Identify any AI code assistants used in this PR (for transparency and review context)

  • Assisted-by: (e.g., Claude, CodeRabbit, Ollama, etc., N/A if not used)
  • Generated by: (e.g., tool name and version; N/A if not used)

Related Tickets & Documents

  • Related Issue #
  • Closes #

Checklist before requesting a review

  • I have performed a self-review of my code.
  • PR has passed all pre-merge test jobs.
  • If it is a core feature, I have added thorough tests.

Testing

  • Please provide detailed steps to perform tests related to this code change.
  • How were the fix/results from this change verified? Please provide relevant screenshots or results.

Summary by CodeRabbit

  • Bug Fixes
    • Applications using SQLite storage can now start when the configured database is inside a directory that does not yet exist. Missing parent directories are created automatically before the database is opened, preventing startup failures and allowing the database to be created at the configured path. This applies when the database is configured in a nested directory rather than the current directory.

@coderabbitai

coderabbitai Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: lightspeed-core/lightspeed-stack/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 48b8e14e-e004-4945-b0bc-316f935d7323
📥 Commits

Reviewing files that changed from the base of the PR and between 0afad63 and 8f19bc3.

📒 Files selected for processing (1)
  • src/a2a_storage/storage_factory.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📜 Recent review details
⏰ Context from checks skipped due to timeout. (23)
  • GitHub Check: E2E: server / ci / default
  • GitHub Check: E2E: library / ci / mcp
  • GitHub Check: E2E: server / ci / tls
  • GitHub Check: E2E: library / ci / default
  • GitHub Check: E2E: server / ci / mcp
  • GitHub Check: E2E: library / ci / shields
  • GitHub Check: E2E: server / ci / shields
  • GitHub Check: E2E: library / ci / authorized
  • GitHub Check: E2E: server / ci / skills
  • GitHub Check: E2E: library / ci / skills
  • GitHub Check: E2E: server / ci / authorized
  • GitHub Check: E2E: library / ci / rbac
  • GitHub Check: E2E: server / ci / other
  • GitHub Check: E2E: library / ci / other
  • GitHub Check: E2E: server / ci / rbac
  • GitHub Check: integration_tests (3.13)
  • GitHub Check: integration_tests (3.12)
  • GitHub Check: unit_tests (3.13)
  • GitHub Check: Pylinter
  • GitHub Check: Red Hat Konflux / rag-content-0-8-e2e-tests / lightspeed-stack-0-8
  • GitHub Check: Red Hat Konflux / lightspeed-core-0-8-enterprise-contract / lightspeed-stack-0-8
  • GitHub Check: Red Hat Konflux / lightspeed-stack-0-8-e2e-tests / lightspeed-stack-0-8
  • GitHub Check: Konflux kflux-prd-rh02 / lightspeed-stack-0-8-on-pull-request
🔇 Additional comments (1)
src/a2a_storage/storage_factory.py (1)

3-3: LGTM!

Also applies to: 142-144


Walkthrough

Before creating a SQLite engine, the storage factory creates the configured database path’s parent directories when the parent is not the current directory. The connection string and engine configuration remain unchanged.

Changes

SQLite path setup

Layer / File(s) Summary
Prepare the SQLite database path
src/a2a_storage/storage_factory.py
The storage factory converts the configured database path to a Path and recursively creates its parent directories when the parent is not the current directory.

Priority: ➖ Normal

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 8f19b

The change creates missing parent directories for configured SQLite file paths before opening the database. No concrete merge-blocking risk is established.

Security Architecture Review

Security architecture risk: ⚪ Minimal · up to 0afad

The database location remains controlled by application configuration, not A2A request data. Creating its parent directory does not introduce new caller authority or weaken an existing security boundary. Created directories persist across shutdown and failed initialization.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The new side effect is bounded by the deployment-selected SQLite path and the service process's existing filesystem permissions. It does not create request-specific or tenant-specific path selection.

Trust Boundaries and Controls

  • observed — Application startup loads configuration from the deployment-selected YAML file. The inspected A2A request path consumes that configuration rather than deriving db_path from request bodies, headers, or authentication context. The configuration endpoint is GET-only and does not provide a path-mutation operation.
🚥 Pre-merge checks | ✅ 7
✅ Passed checks (7 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: creating the parent directory for the A2A SQLite store.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Performance And Algorithmic Complexity ✅ Passed PASSED. The only change creates the SQLite database parent directory once before engine creation. _get_or_create_engine returns the cached engine on later calls, and the added operation is not insid…
Security And Secret Handling ✅ Passed PASSED. The only change adds recursive parent-directory creation for the configured SQLite path in src/a2a_storage/storage_factory.py:142-144. The path comes from application configuration loaded fr…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
✨ Simplify code
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@snuryyeva
snuryyeva force-pushed the snuryyeva/parent_directory branch from 36fd6bc to 8f19bc3 Compare October 6, 2026 17:52

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

LGTM

@radofuchs
radofuchs merged commit d8c9b4f into lightspeed-core:main Oct 8, 2026
41 checks passed
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.

3 participants