-
Notifications
You must be signed in to change notification settings - Fork 58
LCORE-1029: dumping configuration with BYOK section #829
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughAdds support for a new public ByokRag entity to configuration model exports and introduces a test function that validates serialization and deserialization of configurations containing byok_rag fields with proper sensitive value redaction and default preservation. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
5e5cb28 to
60e88c1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
tests/unit/models/config/test_dump_configuration.py (3)
505-509: Improve docstring to describe BYOK-specific testing.The docstring is generic and doesn't indicate this test specifically validates BYOK RAG configuration serialization and deserialization.
Consider updating to something like:
def test_dump_configuration_byok(tmp_path: Path) -> None: """ - Test that the Configuration object can be serialized to a JSON file and - that the resulting file contains all expected sections and values. + Test that a Configuration with BYOK RAG entries can be serialized to JSON + and that the byok_rag section is correctly dumped with all fields including + defaults (embedding_model, embedding_dimension, rag_type). """
510-558: Consider extracting common configuration setup to reduce duplication.The configuration setup (lines 510-558) is nearly identical to
test_dump_configurationandtest_dump_configuration_with_quota_limiters, with only thebyok_ragparameter being unique. This creates maintenance overhead.Consider creating a pytest fixture or helper function:
@pytest.fixture def base_configuration(): """Fixture providing a base Configuration for testing.""" return Configuration( name="test_name", service=ServiceConfiguration( tls_config=TLSConfiguration( tls_certificate_path=Path("tests/configuration/server.crt"), tls_key_path=Path("tests/configuration/server.key"), tls_key_password=Path("tests/configuration/password"), ), cors=CORSConfiguration( allow_origins=["foo_origin", "bar_origin", "baz_origin"], allow_credentials=False, allow_methods=["foo_method", "bar_method", "baz_method"], allow_headers=["foo_header", "bar_header", "baz_header"], ), ), # ... rest of common configuration )Then use it with specific overrides:
def test_dump_configuration_byok(tmp_path: Path, base_configuration: Configuration) -> None: cfg = base_configuration.model_copy( update={"byok_rag": [ByokRag(...)]} ) # ... rest of test
663-672: Consider adding test coverage for multiple BYOK RAG entries.The current test validates a single
byok_ragentry. Following the pattern oftest_dump_configuration_with_more_mcp_servers, consider adding a test case for multiple BYOK RAG entries to ensure list serialization works correctly.This would be consistent with the existing test coverage patterns in this file.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
tests/unit/models/config/test_dump_configuration.py(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
tests/unit/models/config/test_dump_configuration.py (1)
src/models/config.py (8)
ByokRag(582-592)Configuration(623-649)ServiceConfiguration(149-166)LlamaStackConfiguration(177-220)UserDataCollection(223-256)DatabaseConfiguration(108-146)InferenceConfiguration(521-538)dump(646-649)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: build-pr
- GitHub Check: Konflux kflux-prd-rh02 / lightspeed-stack-on-pull-request
- GitHub Check: e2e_tests (ci)
- GitHub Check: e2e_tests (azure)
🔇 Additional comments (2)
tests/unit/models/config/test_dump_configuration.py (2)
17-17: LGTM!The import is properly placed and necessary for the new BYOK RAG test coverage.
551-557: The test file exists. No issues found.
Description
LCORE-1029: dumping configuration with BYOK section
Type of change
Related Tickets & Documents
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.