Skip to content

Replace utils.utils grab-bag with concern-named modules - #696

Merged
rtibbles merged 1 commit into
learningequality:mainfrom
rtibblesbot:issue-692-db8b96
Jul 21, 2026
Merged

Replace utils.utils grab-bag with concern-named modules#696
rtibbles merged 1 commit into
learningequality:mainfrom
rtibblesbot:issue-692-db8b96

Conversation

@rtibblesbot

@rtibblesbot rtibblesbot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

ricecooker.utils.utils was 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 into paths.py, storage.py, and validators.py, moves VideoURLFormatError into its sole consumer youtube.py, and repoints every import site. Function bodies move verbatim — no behavior changes — and utils.py is 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 new paths and config imports introduce no import cycle.
  • ricecooker/utils/utils.py — confirm no importer of the old path remains anywhere in ricecooker, tests, or examples.
  • ricecooker/utils/youtube.py:19 — confirm VideoURLFormatError'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?
  • Ran pre-flight CI checks (lint, format, tests) and verified all pass
  • Rebased onto the target branch and resolved any conflicts
  • Reorganized commit history into clean, logical commits
  • Audited the diff to ensure only issue-relevant files are changed
  • Built PR body from the repository's PR template with evidence blocks
@rtibblesbot

🟡 Waiting for feedback

Last updated: 2026-07-21 01:16 UTC

`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
rtibblesbot marked this pull request as ready for review July 21, 2026 01:16

@rtibbles rtibbles left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good cleanup!

@rtibbles
rtibbles merged commit 4667e25 into learningequality:main Jul 21, 2026
40 checks passed
@rtibblesbot
rtibblesbot deleted the issue-692-db8b96 branch July 21, 2026 05:27
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.

Rename the confusing ricecooker.utils.utils module path

2 participants