Skip to content

LCORE-973: descriptions for TLS configuration#834

Merged
tisnik merged 1 commit intolightspeed-core:mainfrom
tisnik:lcore-973-decriptions-for-tls-configuration
Nov 24, 2025
Merged

LCORE-973: descriptions for TLS configuration#834
tisnik merged 1 commit intolightspeed-core:mainfrom
tisnik:lcore-973-decriptions-for-tls-configuration

Conversation

@tisnik
Copy link
Contributor

@tisnik tisnik commented Nov 24, 2025

Description

LCORE-973: descriptions for TLS configuration

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-973

Summary by CodeRabbit

  • Documentation
    • Improved user-facing descriptions for TLS/HTTPS settings (certificate, private key, and key-password) to simplify setup and troubleshooting.
    • Clarified that TLS configuration defaults are explicitly constructed with empty/none values; no behavioral changes to TLS handling.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 24, 2025

Walkthrough

Added Pydantic Field schema metadata (title and description) to three TLS fields on TLSConfiguration and changed ServiceConfiguration.tls_config to use a default_factory that constructs a TLSConfiguration with explicit None values for its path fields; types and defaults remain functionally the same.

Changes

Cohort / File(s) Summary
TLS configuration field documentation
src/models/config.py
Replaced Optional[FilePath] = None with Field(None, title=..., description=...) for tls_certificate_path, tls_key_path, and tls_key_password on TLSConfiguration to add schema metadata only.
ServiceConfiguration default_factory
src/models/config.py
Changed tls_config: TLSConfiguration = Field(default_factory=TLSConfiguration) to Field(default_factory=lambda: TLSConfiguration(tls_certificate_path=None, tls_key_path=None, tls_key_password=None)), explicitly constructing a TLSConfiguration with None paths.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Files to inspect: src/models/config.py (verify Field metadata text and that types/defaults/validation behaviour are unchanged).

Pre-merge checks and finishing touches

✅ 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 clearly summarizes the main change: adding descriptions/metadata to TLS configuration fields, which matches the documented alterations to TLSConfiguration fields.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1f237a8 and 5e13497.

📒 Files selected for processing (1)
  • src/models/config.py (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/models/config.py
⏰ 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)

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/models/config.py (1)

172-172: Address the type checking error in Field definition.

The pipeline failures indicate a type checking issue with Field(default_factory=TLSConfiguration). Although this line wasn't modified in this PR, the type checkers (mypy and Pyright) expect default_factory to be a callable, not a class reference.

The current usage is actually correct for Pydantic v2, where passing a class to default_factory is valid and the framework handles instantiation. However, to satisfy the type checkers, you can make it explicitly callable:

-    tls_config: TLSConfiguration = Field(default_factory=TLSConfiguration)
+    tls_config: TLSConfiguration = Field(default_factory=lambda: TLSConfiguration())

Alternatively, verify that the type stubs for Pydantic are up to date. Would you like me to investigate further or open an issue to track this separately?

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1cdb5a1 and 265f451.

📒 Files selected for processing (1)
  • src/models/config.py (1 hunks)
🧰 Additional context used
🪛 GitHub Actions: Pyright
src/models/config.py

[error] 172-172: Pyright error: Argument of type "type[TLSConfiguration]" cannot be assigned to parameter "default_factory" of type "(() -> _T@Field) | ((dict[str, Any]) -> _T@Field)" in function "Field".

🪛 GitHub Actions: Type checks
src/models/config.py

[error] 172-172: mypy: Argument 'default_factory' to 'Field' has incompatible type 'type[TLSConfiguration]'; expected 'Callable[[], Never] | Callable[[dict[str, Any]], Never]'. Command: 'uv run mypy --explicit-package-bases --disallow-untyped-calls --disallow-untyped-defs --disallow-incomplete-defs --ignore-missing-imports --disable-error-code attr-defined src/'

⏰ 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 (azure)
  • GitHub Check: e2e_tests (ci)
🔇 Additional comments (1)
src/models/config.py (1)

41-45: LGTM! Clear and accurate documentation.

The title and description for tls_certificate_path are appropriate and clearly describe the field's purpose.

@tisnik tisnik force-pushed the lcore-973-decriptions-for-tls-configuration branch from 265f451 to 1f237a8 Compare November 24, 2025 10:17
@tisnik tisnik force-pushed the lcore-973-decriptions-for-tls-configuration branch from 1f237a8 to 5e13497 Compare November 24, 2025 10:22
@tisnik tisnik merged commit 3ca4c28 into lightspeed-core:main Nov 24, 2025
21 of 23 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