refactor: deprecate the ovos_workshop.resource_files module#412
Merged
Conversation
Mark the entire resource_files module as deprecated. It predates the OVOS formal specifications and is considered overengineered. Everything stays fully functional for downstream consumers; nothing is removed. All public names (ResourceType, ResourceFile and subclasses, SkillResources, CoreResources, UserResources, RegexExtractor, locate_base_directories, locate_lang_directories, find_resource) now carry the @deprecated decorator plus an inner warnings.warn and a .. deprecated:: docstring notice. Messages point downstream to the ovos-spec-tools replacements where they exist (LocaleResources, render/DialogRenderer, expand, closest_lang/ standardize_lang); legacy types with no spec replacement (.qml, .json, .list, .value, .rx, .word, .template) are flagged as not part of the OVOS formal specifications. To avoid the framework spamming deprecation warnings at itself (these classes are built per-skill, per-language on hot paths), a _caller_is_internal stack guard suppresses both the log notice and the DeprecationWarning when the caller is ovos_workshop's own code; the warnings remain visible to downstream callers. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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 |
JarbasAl
added a commit
that referenced
this pull request
May 23, 2026
Restore partial back-compat for downstream skills that still call `self.resources.load_*` / `render_dialog` etc.: `self.resources` is now a deprecated property that returns a legacy SkillResources, with a DeprecationWarning pointing callers at the high-level skill methods (speak_dialog, register_intent_file, voc_match, ...) or at ovos_spec_tools.LocaleResources for low-level access. Workshop's own internal code goes through a private property, `OVOSSkill._locale_resources`, which returns the LocaleResources built by load_lang() — no functional change to the rewire, just a separate public-vs-internal handle. The SkillResources construction inside the deprecated property is silenced for workshop-internal callers by the _caller_is_internal guard from #412. Test assertions for `self.skill.resources` updated to check `self.skill._locale_resources` (the internal handle) for LocaleResources. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #411 (base:
feat/use-ovos-spec-tools). Part of the OVOS migrationonto
ovos-spec-tools— OpenVoiceOS/architecture#7.ovos_workshop.resource_filespredates the OVOS formal specifications and isoverengineered. This deprecates the whole module — every class and
function — while leaving it fully functional for downstream (nothing removed,
no behaviour change).
What changed
ResourceType,ResourceFile+ subclasses,SkillResources,CoreResources,UserResources,RegexExtractor) and 3functions (
locate_base_directories,locate_lang_directories,find_resource) are deprecated —@deprecatedlog notice +DeprecationWarning+.. deprecated::docstrings; the module docstring too.version.py(VERSION_MAJOR + 1).ovos-spec-toolsreplacements(
LocaleResources,render/DialogRenderer,expand,closest_lang/standardize_lang); the legacy types with no specreplacement (
.qml,.json,.list,.value,.rx,.word,.template) are flagged as legacy.Visible downstream, silent internally
SkillResourcesis built per-skill, per-language — a naive@deprecated__init__would flood every skill startup. A_caller_is_internal()stackcheck guards the warning: it fires for downstream callers, suppressed for
ovos_workshop's own internal use.A deep rewire of
OVOSSkill's resource-loading subsystem ontoovos_spec_tools.LocaleResourcesis intentionally out of scope — this PRmarks the debt; migrating off it is follow-up work.
Verification
test_resource_files*+ skill-keyword tests: 274 passed.skills/suite: 144passed — confirming internal skill startup emits no resource_files deprecation
noise.
🤖 Generated with Claude Code