Skip to content

Rename cache operations from update to clear#176

Merged
jeremiah-k merged 5 commits intomainfrom
cache-cmd-1
Feb 12, 2026
Merged

Rename cache operations from update to clear#176
jeremiah-k merged 5 commits intomainfrom
cache-cmd-1

Conversation

@jeremiah-k
Copy link
Owner

@jeremiah-k jeremiah-k commented Feb 12, 2026

Overview

This PR refactors cache-related CLI commands, method names, and documentation to use "clear" terminology instead of "update," better reflecting that the operations remove cached data rather than refresh it. The changes are consistent across the CLI interface, integration layer, tests, and documentation.

Key Changes

CLI Commands & Flags

  • Renamed CLI subcommand: fetchtastic cache updatefetchtastic cache clear
  • Renamed CLI flag: --update-cache--clear-cache
  • Updated help text and documentation to reference cache clearing

Method Names

  • Renamed public method in DownloadCLIIntegration: update_cache()clear_cache()
  • Renamed internal CLI method: _perform_cache_update()_perform_cache_clear()
  • Updated all docstrings and return descriptions to reflect cache clearing semantics

Tests & Documentation

  • Updated all test files to use the new clear_cache() method name and verify the new behavior
  • Updated test function names (e.g., test_cli_download_update_cache_flagtest_cli_download_clear_cache_flag)
  • Updated usage documentation with new command syntax and flag names

Breaking Changes

This is a BREAKING CHANGE. Users and code that depend on the old CLI commands or API must be updated:

  • Replace fetchtastic cache update with fetchtastic cache clear
  • Replace --update-cache flag with --clear-cache
  • Update any code calling update_cache() method to use clear_cache() instead

Rename cache-related commands and methods from "update" to "clear" to
better reflect their actual behavior of clearing cached data rather
than updating it.

- Rename `fetchtastic cache update` to `fetchtastic cache clear`
- Rename `--update-cache` flag to `--clear-cache`
- Rename `_perform_cache_update()` to `_perform_cache_clear()`
- Rename `update_cache()` method to `clear_cache()`
- Update all related tests and documentation

BREAKING CHANGE: CLI commands have been renamed. Use `fetchtastic cache clear`
instead of `fetchtastic cache update`, and `--clear-cache` instead of
`--update-cache`.
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @jeremiah-k, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on enhancing the clarity and accuracy of cache management operations within the application. By renaming commands and functions from 'update-cache' to 'clear-cache', the changes ensure that the terminology precisely describes the action of removing cached data, rather than implying an update or refresh. This improves the user experience by making CLI commands more intuitive and aligns the codebase with the actual behavior of these features.

Highlights

  • CLI Command Renaming: The CLI command fetchtastic download --update-cache has been renamed to fetchtastic download --clear-cache for improved clarity regarding its function.
  • Cache Management Subcommand Renaming: The cache management subcommand fetchtastic cache update has been renamed to fetchtastic cache clear to better reflect its action of clearing cached data.
  • Internal Function Renaming: The internal Python functions _perform_cache_update in src/fetchtastic/cli.py and update_cache in src/fetchtastic/download/cli_integration.py have been renamed to _perform_cache_clear and clear_cache respectively, along with their docstrings and associated calls.
  • Documentation and Test Updates: All relevant documentation and unit tests have been updated to reflect the new command and function names, ensuring consistency across the project.
Changelog
  • docs/usage-guide.md
    • Updated CLI command examples for cache management from update-cache to clear-cache.
  • src/fetchtastic/cli.py
    • Renamed _perform_cache_update function to _perform_cache_clear.
    • Updated docstrings and parameter descriptions for cache clearing functions.
    • Modified _handle_download_subcommand to use args.clear_cache and call _perform_cache_clear.
    • Changed CLI argument --update-cache to --clear-cache in main function.
    • Renamed cache update subcommand to cache clear.
  • src/fetchtastic/download/cli_integration.py
    • Renamed update_cache method to clear_cache.
    • Updated docstring for clear_cache method to reflect cache clearing.
  • tests/test_cli.py
    • Updated fixture docstring to reflect clear_cache() returning True.
    • Changed mock integration's update_cache.return_value to clear_cache.return_value.
    • Renamed test_cli_download_update_cache_flag to test_cli_download_clear_cache_flag.
    • Updated sys.argv patch to use --clear-cache.
    • Asserted mock_cli_dependencies.clear_cache.assert_called_once() instead of update_cache.
    • Renamed test_cli_cache_update_command to test_cli_cache_clear_command.
    • Updated sys.argv patch to use cache clear.
  • tests/test_cli_additional.py
    • Updated fixture docstring to reflect clear_cache() returning True.
    • Changed mock integration's update_cache.return_value to clear_cache.return_value.
  • tests/test_download_cli_integration.py
    • Renamed test_cli_integration_update_cache_loads_config to test_cli_integration_clear_cache_loads_config.
    • Changed call from integration.update_cache to integration.clear_cache.
    • Renamed test_cli_integration_update_cache_requires_config to test_cli_integration_clear_cache_requires_config.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@codecov
Copy link

codecov bot commented Feb 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@jeremiah-k
Copy link
Owner Author

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 12, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the cache management commands, renaming update-cache to clear-cache and cache update to cache clear. This change significantly improves the clarity and intuitiveness of the command-line interface, as 'clear' more accurately describes the action of removing cached data than the ambiguous 'update'. The refactoring has been applied consistently across the application logic, documentation, and tests. The changes are well-executed and I have no further feedback.

@coderabbitai coderabbitai bot changed the title @coderabbitai Rename cache operations from update to clear Feb 12, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 12, 2026

Walkthrough

This PR systematically renames cache-related terminology from "update" to "clear" across the codebase. Changes include renaming the CLI flag --update-cache to --clear-cache, the cache subcommand from update to clear, the public method update_cache() to clear_cache(), and corresponding updates to documentation and all test files.

Changes

Cohort / File(s) Summary
Documentation
docs/usage-guide.md
Updated usage examples to reflect new command-line flag (--clear-cache) and cache subcommand (cache clear) terminology.
Core CLI Implementation
src/fetchtastic/cli.py
Renamed internal helper _perform_cache_update() to _perform_cache_clear(), updated argument parsing to use --clear-cache flag, renamed cache subcommand from update to clear, and adjusted all related docstrings and help text.
Integration Layer
src/fetchtastic/download/cli_integration.py
Renamed public method update_cache() to clear_cache(), updated operation topic and help text mapping to reflect cache clearing semantics, and adjusted docstring wording.
CLI Tests
tests/test_cli.py, tests/test_cli_additional.py
Updated test mocks to call clear_cache() instead of update_cache(), renamed test functions from *_update_cache_* to *_clear_cache_*, and adjusted assertions to verify the renamed method is invoked.
Integration Tests
tests/test_download_cli_integration.py
Renamed test method calls and test function names to reference clear_cache(), updated assertions and error behavior checks to align with the new method signature.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 A cache once "updated" with great care,
Now bravely "clears" the data there,
With flags and names refreshed anew,
The CLI hops—old out, new through!
One name, one truth, one purpose clear.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Title Check ✅ Passed Title check skipped as CodeRabbit has written the PR title.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch cache-cmd-1

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.

Caution

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

⚠️ Outside diff range comments (1)
src/fetchtastic/download/cli_integration.py (1)

943-955: ⚠️ Potential issue | 🟡 Minor

Docstring key name doesn't match the actual dict key.

Line 943 documents the key as cache_update, but line 954 uses cache_clear. The docstring should be updated to match.

Proposed fix
-                - cache_update: how to clear caches without running downloads
+                - cache_clear: how to clear caches without running downloads

Change RELEASES_CACHE_EXPIRY_HOURS from 1 minute to 10 minutes to
better balance API rate limiting with data freshness. Users can still
bypass cache using --force-download flag when needed.
@kiloconnect
Copy link

kiloconnect bot commented Feb 12, 2026

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
README.md 69 Documentation not updated - still shows cache update command instead of cache clear
Other Observations (not in diff)

Issues found in unchanged code that cannot receive inline comments:

File Line Issue
README.md 69 WARNING: Documentation inconsistency - README.md still shows fetchtastic cache update but the PR renames this to cache clear. The README should be updated to match the new CLI command naming.
Files Reviewed (10 files)
  • .trunk/trunk.yaml - Linter version bumps (no issues)
  • docs/usage-guide.md - Documentation updated correctly (no issues)
  • src/fetchtastic/cli.py - Command renaming (no issues)
  • src/fetchtastic/constants.py - Cache expiry change (no issues)
  • src/fetchtastic/download/cli_integration.py - Method renaming (no issues)
  • tests/test_cache_flow_integration.py - Test formatting (no issues)
  • tests/test_cache_management.py - Test formatting (no issues)
  • tests/test_cli.py - Test updates for new naming (no issues)
  • tests/test_cli_additional.py - Test updates for new naming (no issues)
  • tests/test_download_cli_integration.py - Test updates for new naming (no issues)

Summary

This PR renames the cache management commands from update-cache/cache update to clear-cache/cache clear for better clarity. The code changes are consistent and well-implemented. However, README.md was not updated and still shows the old cache update command on line 69.

Fix these issues in Kilo Cloud

Update checkov, osv-scanner, ruff, and trufflehog to latest versions.
Apply code formatting to test files with updated ruff 0.15.0.
@jeremiah-k jeremiah-k merged commit 9a017fb into main Feb 12, 2026
9 checks passed
@jeremiah-k jeremiah-k deleted the cache-cmd-1 branch February 12, 2026 02:12
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