Skip to content

LCORE-1880: Reorganize models#1694

Open
asimurka wants to merge 1 commit intolightspeed-core:mainfrom
asimurka:move_error_responses
Open

LCORE-1880: Reorganize models#1694
asimurka wants to merge 1 commit intolightspeed-core:mainfrom
asimurka:move_error_responses

Conversation

@asimurka
Copy link
Copy Markdown
Contributor

@asimurka asimurka commented May 6, 2026

Description

Reorganizes the rest of models. No functional changes.

Type of change

  • Refactor
  • New feature
  • Bug fix
  • CVE fix
  • Optimization
  • Documentation Update
  • Configuration Update
  • Bump-up service version
  • Bump-up dependent library
  • 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: Cursor

Related Tickets & Documents

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

  • Refactor
    • Reorganized internal code modules to improve structure and maintainability across cache, API model, and response handling layers.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 6, 2026

Warning

Rate limit exceeded

@asimurka has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 44 minutes and 1 second before requesting another review.

To continue reviewing without waiting, purchase usage credits in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 84f81c11-885c-4b06-983b-6935e6205455

📥 Commits

Reviewing files that changed from the base of the PR and between b521d83 and 83ea3c5.

📒 Files selected for processing (39)
  • src/app/endpoints/conversations_v2.py
  • src/app/endpoints/responses.py
  • src/app/endpoints/rlsapi_v1.py
  • src/app/endpoints/streaming_query.py
  • src/cache/README.md
  • src/cache/cache.py
  • src/cache/cache_entry.py
  • src/cache/in_memory_cache.py
  • src/cache/noop_cache.py
  • src/cache/postgres_cache.py
  • src/cache/sqlite_cache.py
  • src/models/README.md
  • src/models/__init__.py
  • src/models/api/README.md
  • src/models/api/requests/__init__.py
  • src/models/api/requests/rlsapi.py
  • src/models/api/responses/successful/README.md
  • src/models/api/responses/successful/__init__.py
  • src/models/api/responses/successful/rlsapi.py
  • src/models/common/responses/README.md
  • src/models/common/responses/__init__.py
  • src/models/common/responses/contexts.py
  • src/models/context.py
  • src/models/rlsapi/README.md
  • src/models/rlsapi/__init__.py
  • src/utils/query.py
  • tests/integration/endpoints/test_conversations_v2_integration.py
  • tests/integration/endpoints/test_query_integration.py
  • tests/integration/endpoints/test_rlsapi_v1_integration.py
  • tests/unit/app/endpoints/test_conversations_v2.py
  • tests/unit/app/endpoints/test_responses.py
  • tests/unit/app/endpoints/test_rlsapi_v1.py
  • tests/unit/app/endpoints/test_streaming_query.py
  • tests/unit/cache/test_noop_cache.py
  • tests/unit/cache/test_postgres_cache.py
  • tests/unit/cache/test_sqlite_cache.py
  • tests/unit/models/rlsapi/test_requests.py
  • tests/unit/models/rlsapi/test_responses.py
  • tests/unit/utils/test_query.py

Walkthrough

This PR reorganizes module imports and file structure across the codebase. CacheEntry is relocated from models.cache_entry to cache.cache_entry, ResponseGeneratorContext moves from models.context to models.common.responses.contexts, and rlsapi v1 models are restructured from models.rlsapi.* to models.api.requests.rlsapi and models.api.responses.successful.rlsapi. All dependent imports in endpoints, utilities, and tests are updated consistently. No functional or behavioral changes are introduced.

Changes

Module Restructuring and Import Consolidation

Layer / File(s) Summary
Cache Package Migration
src/cache/cache_entry.py (new), src/cache/cache.py, src/cache/in_memory_cache.py, src/cache/noop_cache.py, src/cache/postgres_cache.py, src/cache/sqlite_cache.py
CacheEntry moves from models.cache_entry to a new cache/cache_entry.py module; all cache implementations update their imports accordingly. Cache README documents the new file.
Response Context Relocation
src/models/common/responses/contexts.py, src/models/context.py
ResponseGeneratorContext moves from models/context.py to models/common/responses/contexts.py; the new location adds dataclass imports and introduces ResponseGeneratorContext as a new public entity; old file module docstring removed.
API Models Restructuring
src/models/rlsapi/... (deleted), src/models/api/requests/rlsapi.py, src/models/api/responses/successful/rlsapi.py
Rlsapi v1 models relocated from models.rlsapi.requests and models.rlsapi.responses to models.api.requests.rlsapi and models.api.responses.successful.rlsapi; old rlsapi directory module and README removed.
Package Exports and Documentation
src/models/__init__.py, src/models/api/README.md, src/models/api/requests/__init__.py, src/models/api/responses/successful/__init__.py, src/models/common/responses/__init__.py, src/models/README.md
New __all__ exports introduced in models and api subpackages to expose reorganized entities; READMEs updated to reflect new file locations and removed obsolete entries; new imports wired through package initializers.
Endpoint and Utility Imports
src/app/endpoints/conversations_v2.py, src/app/endpoints/responses.py, src/app/endpoints/rlsapi_v1.py, src/app/endpoints/streaming_query.py, src/utils/query.py
All endpoint and utility files updated to import from new module paths for CacheEntry, ResponseGeneratorContext, and Rlsapi models.
Test File Imports
tests/integration/endpoints/test_*.py, tests/unit/app/endpoints/test_*.py, tests/unit/cache/test_*.py, tests/unit/models/rlsapi/test_*.py, tests/unit/utils/test_query.py
All test files updated to reflect new import paths; no changes to test logic or assertions.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'LCORE-1880: Reorganize models' accurately summarizes the main change—a reorganization of the models module structure throughout the codebase.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
✨ Simplify code
  • Create PR with simplified code

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 and usage tips.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 6, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@asimurka asimurka requested a review from tisnik May 7, 2026 08:31
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