Skip to content

feat: add FileStorage adapter for JSON file-based persistence#58

Merged
enginerd-kr merged 1 commit into
mainfrom
feat/file-storage-adapter
Apr 11, 2026
Merged

feat: add FileStorage adapter for JSON file-based persistence#58
enginerd-kr merged 1 commit into
mainfrom
feat/file-storage-adapter

Conversation

@enginerd-kr

Copy link
Copy Markdown
Owner

Summary

  • Add FileStorage adapter (chronis/contrib/adapters/storage/file.py) that persists jobs to a single JSON file on disk
  • Atomic writes via tempfile.mkstemp + os.replace for crash safety
  • Thread-safe via threading.Lock, suitable for local/single-process development
  • Configurable file_path and auto_create parameters

Test plan

  • 42 unit tests covering CRUD, persistence, filters, CAS, thread safety, and batch operations
  • Existing InMemoryStorage tests pass (no regression)
  • ruff lint passes
  • mypy type check passes

🤖 Generated with Claude Code

Add a file-based storage adapter that persists jobs to a JSON file on disk,
suitable for local development and single-process deployments where data
persistence across restarts is needed without external dependencies.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@enginerd-kr

Copy link
Copy Markdown
Owner Author

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  chronis/contrib/adapters/storage
  __init__.py 10-11
  file.py 68-69, 96-101
Project Total  

This report was generated by python-coverage-comment-action

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e37dfb95af

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread chronis/contrib/adapters/storage/file.py
@enginerd-kr
enginerd-kr merged commit c325c3e into main Apr 11, 2026
2 of 3 checks passed
@enginerd-kr
enginerd-kr deleted the feat/file-storage-adapter branch April 11, 2026 01:35
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