mirror of
https://github.com/Glitchy-Sheep/boosty-downloader.git
synced 2026-10-14 21:33:23 +00:00
[PR #130] [MERGED] [config] Report a broken config instead of silently replacing it #134
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#134
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/130
Author: @Glitchy-Sheep
Created: 8/9/2026
Status: ✅ Merged
Merged: 8/9/2026
Merged by: @Glitchy-Sheep
Base:
main← Head:fix/broken-config-not-overwritten📝 Commits (1)
459a460fix: 🐛 A broken config is reported, not silently replaced📊 Changes
6 files changed (+154 additions, -18 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
boosty_downloader/src/infrastructure/yaml_configuration/config.py(+65 -18)📝
pyproject.toml(+1 -0)➕
test/unit/configuration/__init__.py(+0 -0)➕
test/unit/configuration/init_config_test.py(+85 -0)📝
uv.lock(+2 -0)📄 Description
Summary
A typo in
config.yamlused to destroy the user's saved credentials: the app replaced the file with a blank sample and even reported it in green as a success. Now every config problem is explained in plain words and the file is never touched.Problem
create_sample_config_file()over the user's file -auth_headerandcookiewere wiped without warning or backupFix
auth.cookie: should be text (wrap it in quotes), a mistyped key getsunknown setting - check the spellingthe file breaks at line 3, column 17pyyamlbecomes a direct dependency: the code now imports it to catchYAMLErrorBefore / After
Before: one YAML typo - and the token is gone, replaced by an empty sample.
After: the app names the broken line or field, the file and the token survive.
Tests
test_broken_yaml_syntax_keeps_the_file/test_invalid_values_keep_the_file- the file stays byte-identical on both error pathstest_missing_config_creates_a_sample- the first-run path still workstest_pydantic_jargon_never_reaches_the_user/test_yaml_parser_jargon_never_reaches_the_user- translator fallbacks guard against leaking raw messagescmpconfirms the file is untouched🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.