Skip to content

fix: mark deprecated code for removal#253

Draft
JarbasAl wants to merge 3 commits intodevfrom
deprecations
Draft

fix: mark deprecated code for removal#253
JarbasAl wants to merge 3 commits intodevfrom
deprecations

Conversation

@JarbasAl
Copy link
Copy Markdown
Member

@JarbasAl JarbasAl commented Nov 7, 2025

Summary by CodeRabbit

  • New Features

    • Added timezone configuration utilities enabling runtime timezone management and retrieval
    • Added language configuration utilities for retrieving valid language codes from settings
  • Deprecations

    • Multiple legacy locale utility functions now emit deprecation warnings; users are encouraged to transition to configuration-based alternatives for future compatibility

@github-actions github-actions Bot added the fix label Nov 7, 2025
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Nov 7, 2025

Warning

Rate limit exceeded

@JarbasAl has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 19 minutes and 45 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 bbe2f1f and b38c126.

📒 Files selected for processing (1)
  • ovos_config/locale.py (2 hunks)

Walkthrough

The change refactors locale handling in the OVOS configuration module by introducing timezone utilities (get_config_tz, get_default_tz, set_default_tz), language configuration getters, and deprecated API shims for backward compatibility. The refactoring removes lingua-franca library coupling and consolidates locale behavior around configuration-driven operations.

Changes

Cohort / File(s) Summary
Timezone & Language Configuration Utilities
ovos_config/locale.py
Added get_config_tz(), get_default_tz(), set_default_tz() for timezone handling; added get_valid_languages() for language enumeration. Removed legacy _default_tz state in favor of configuration-driven approach.
Public Language API Utilities
ovos_config/locale.py
Added get_default_lang() with @deprecated decorator; modified get_full_lang_code() with inline deprecation warning.
Deprecated API Shims
ovos_config/locale.py
Added deprecated wrappers: get_primary_lang_code(), set_default_lang(), load_languages(), load_language(), setup_locale(), set_default_lf_lang(), all marked with @deprecated decorator and emitting warnings.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Validate timezone configuration reading logic and get_default_tz() runtime default handling
  • Verify @deprecated decorator usage consistency and deprecation warning emission across all shims
  • Confirm configuration access patterns and removal of lingua-franca coupling do not introduce regressions
  • Review get_valid_languages() implementation and its integration with configuration source

Poem

🐰 A rabbit tidied up the locale store,
With timezones and tongues that work once more!
Deprecated wisely, config took the lead,
The old friends warned, but still fulfilled their need! ✨

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 accurately describes the main change: marking deprecated code for removal through deprecation decorators and warnings across multiple locale utility functions.
Docstring Coverage ✅ Passed Docstring coverage is 83.33% which is sufficient. The required threshold is 80.00%.

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.

@github-actions github-actions Bot added fix and removed fix labels Nov 7, 2025
Copy link
Copy Markdown
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: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6ceec72 and bbe2f1f.

📒 Files selected for processing (1)
  • ovos_config/locale.py (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
ovos_config/locale.py (1)
ovos_config/config.py (1)
  • Configuration (31-371)
🪛 Ruff (0.14.3)
ovos_config/locale.py

35-35: Consider [lang_code, *extra_lang_codes] instead of concatenation

Replace with [lang_code, *extra_lang_codes]

(RUF005)


39-39: Unused function argument: config

(ARG001)


89-89: Unused function argument: config

(ARG001)


111-111: Unused function argument: langs

(ARG001)


121-121: Unused function argument: lang

(ARG001)


147-147: Unused function argument: lang_code

(ARG001)

Comment thread ovos_config/locale.py
@JarbasAl JarbasAl marked this pull request as draft November 7, 2025 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant