mirror of
https://github.com/Glitchy-Sheep/boosty-downloader.git
synced 2026-10-14 21:33:23 +00:00
[PR #199] [MERGED] [cli] Ask before clean-cache removes the cache and drop the credentials requirement #198
Labels
No labels
api-drift
bug
ci
documentation
enhancement
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Glitchy-Sheep/boosty-downloader#198
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Glitchy-Sheep/boosty-downloader/pull/199
Author: @Glitchy-Sheep
Created: 9/22/2026
Status: ✅ Merged
Merged: 9/22/2026
Merged by: @Glitchy-Sheep
Base:
main← Head:fix/clean-cache-confirm📝 Commits (1)
43ed707[cli] Ask before clean-cache removes the cache and drop the credentials requirement📊 Changes
9 files changed (+318 additions, -48 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
boosty_downloader/application/use_cases/clean_cache.py(+10 -3)📝
boosty_downloader/cli/cli_options.py(+10 -0)📝
boosty_downloader/cli/commands/clean_cache.py(+26 -5)📝
boosty_downloader/cli/composition_root.py(+38 -3)📝
boosty_downloader/infrastructure/yaml_configuration/config.py(+59 -15)📝
test/unit/cli/cli_smoke_test.py(+95 -17)📝
test/unit/configuration/init_config_test.py(+44 -0)📝
test/unit/use_cases/clean_cache_test.py(+35 -5)📄 Description
📝 Summary
clean-cacheasks before it removes the cache, and no longer needs credentials to do it. Closes the last item of audit stage 5.🔧 What changes
Cache for <creator> will be removed, the next run downloads everything again. Continue? [y/N]. A "no" keeps the cache;--yes/-yskips the question in scripts. Without a terminal and without--yesthe command aborts with exit 1 instead of removing anything.authsection is not checked, so a config with empty or stale credentials still works. Without any config the defaults apply and no sample config is left behind;--cache-diralone is enough.💡 Why
The cache is the only record of what was downloaded: after it is gone, the next run fetches every post again. That was one keystroke away and the cost was not said anywhere. And removing a local file required a valid token, which has nothing to do with it.
🧩 How
read_download_settings(config_path)in the config module reads thedownloading_settingssection alone through a settings class of its own; a missing file gives the defaults, a broken one gets the same report as before.resolve_cache_dirin the composition root shares the folder rule withload_settings.CleanCacheUseCasetakes aconfirmcallback and answerscancelledon a "no"; the question is asked only when there is a cache to remove.🧪 Tests
--yes, a credentials-free config that names the cache folder, no config and no sample. The--configtests now prove the file is read: the cache folder comes from it.task cigreen locally: ruff, pyright strict, import-linter, 323 tests + e2e.--yesremoves it; a config with onlycache_directoryand noauthworks with-y.✅ Checklist
--helpand README if neededdocs/if the download flow or dev process changed## Unreleasedin CHANGELOG.md (or theci/skip-changeloglabel if not user-facing)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.