Skip to content

Conversation

@tisnik
Copy link
Contributor

@tisnik tisnik commented Sep 11, 2025

Description

LCORE-654: avoid cross instance bleed

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

Related Tickets & Documents

  • Related Issue #LCORE-654

Summary by CodeRabbit

  • Bug Fixes

    • Fixed rare cases where configuration defaults could be unintentionally shared across instances. Defaults now apply per instance for TLS, CORS, JWT, database, authentication, inference, and server lists, improving stability and isolation.
  • Refactor

    • Switched to safer per-instance initialization for configuration fields to enhance reliability and maintainability without changing validation or runtime behavior.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 11, 2025

Warning

Rate limit exceeded

@tisnik has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 8 minutes and 11 seconds before requesting another review.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 228a8f4 and f2cacca.

📒 Files selected for processing (2)
  • tests/unit/models/config/test_authentication_configuration.py (1 hunks)
  • tests/unit/models/config/test_tls_configuration.py (1 hunks)

Walkthrough

Replaced direct default instances with Field(default_factory=...) for several Pydantic model fields in src/models/config.py, affecting TLS, CORS, JWT, database, MCP servers, authentication, and inference configurations. Types and validators remain unchanged; initialization now creates per-instance defaults.

Changes

Cohort / File(s) Summary
Pydantic default factories in config models
src/models/config.py
Switched defaults to Field(default_factory=...) for: ServiceConfiguration.tls_config, ServiceConfiguration.cors, JwkConfiguration.jwt_configuration, Configuration.database, Configuration.mcp_servers (list), Configuration.authentication, Configuration.inference. No type/validator/control-flow changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks (3 passed)

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "LCORE-654: avoid cross instance bleed" is concise and accurately captures the PR's primary intent—preventing shared/default state across instances (the changes convert direct default initializers to Field(default_factory=...) in src/models/config.py)—and includes the related issue ID, so it is clear and specific.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

Poem

A little rabbit hops with cheer,
Factories planted, instances clear. 🥕
No shared bowls or tangled thread,
Each config naps in its own bed.
I nibble, thump — the defaults are dear.

✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

@tisnik tisnik force-pushed the lcore-654-avoid-cross-instance-bleed branch from 4b73f5c to 228a8f4 Compare September 11, 2025 08:48
@tisnik tisnik merged commit 63996a6 into lightspeed-core:main Sep 11, 2025
19 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.

1 participant