Replace utils.utils grab-bag with concern-named modules - #696
Merged
Conversation
`ricecooker.utils.utils` was a stutter holding seven unrelated helpers. Split it by concern and repoint every import site: - paths.py — extract_path_ext, make_dir_if_needed - storage.py — get_hash, copy_file_to_storage - validators.py — is_valid_url, is_valid_uuid_string - VideoURLFormatError moves into its sole consumer, youtube.py Pure move-and-reimport; function bodies are unchanged. utils.py is deleted with no compat shim (internal helper path, per issue learningequality#692). Closes learningequality#692 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
rtibblesbot
marked this pull request as ready for review
July 21, 2026 01:16
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.
Summary
ricecooker.utils.utilswas a meaningless stutter holding seven unrelated helpers (path, storage, and validation functions plus a video-only exception), giving no hint of its contents at import sites. This splits it by concern intopaths.py,storage.py, andvalidators.py, movesVideoURLFormatErrorinto its sole consumeryoutube.py, and repoints every import site. Function bodies move verbatim — no behavior changes — andutils.pyis deleted with no compat shim.References
Closes #692. Follow-up split out from review discussion on #690.
Reviewer guidance
ricecooker/utils/storage.py:5— confirm the newpathsandconfigimports introduce no import cycle.ricecooker/utils/utils.py— confirm no importer of the old path remains anywhere inricecooker,tests, orexamples.ricecooker/utils/youtube.py:19— confirmVideoURLFormatError's message text is unchanged from the original.AI usage
Used Claude Code to move each helper into its concern-named module and repoint every import site, following a pre-approved plan. Verified with the affected pytest subset, import-resolution smoke checks, and
uvx prek run --all-files.@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly
How was this generated?
🟡 Waiting for feedback
Last updated: 2026-07-21 01:16 UTC