Handle bad settings read from disk
Be robust to bad setting values read from disk, by logging the occurrence, resetting, and returning the default.
The lazy approach taken here reuses SettingSpec::interpret, but it imposes a new constraint on it: it needs to be able to validate already "interpreted" (marshalled) settings. I want to see how this goes on different platforms and integration tests.
If this works, we can rely on it to reset hyperkit to qemu once the former is gone (because the latter will be the default by then). Otherwise, we could try to finally move to a marshall/unmarshall scheme, or just tackle the hyperkit case with dedicated code.
Codecov Report
Merging #2742 (65dc52e) into main (9c15247) will decrease coverage by
0.02%. The diff coverage is78.57%.
@@ Coverage Diff @@
## main #2742 +/- ##
==========================================
- Coverage 86.41% 86.39% -0.02%
==========================================
Files 230 230
Lines 11575 11586 +11
==========================================
+ Hits 10002 10010 +8
- Misses 1573 1576 +3
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/settings/wrapped_qsettings.h | 16.66% <0.00%> (-1.86%) |
:arrow_down: |
| src/settings/persistent_settings_handler.cpp | 100.00% <100.00%> (ø) |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
Un-drafting to get a Windows run too.
This still needed some work after all. One unit test missing at this point.
Actually I think this is good enough. The only missing coverage is on the QSettings wrapper (which we decided before didn't need testing).
Hey @townsend2010, just to let you know that this is now ready for review.
bors try
try
Build succeeded:
- CI (Windows, windows-11, hyperv)
- CI (Linux, linux, qemu)
- CI (macOS, macos-10.15, qemu, x86_64)
- CI (Linux, linux, lxd)
- macOS-arm64
- CI (Windows, windows-10, hyperv)
- CI (macOS, macos-11, hyperkit, x86_64)
- macOS-x86_64
- CI (macOS, macos-11, qemu, x86_64)
- Linux
- CI (macOS, macos-10.15, hyperkit, x86_64)
- CI (macOS, qemu, arm64)
- Windows
The danged clang crash in CI...
bors retry
Build succeeded:
- CI (Linux, linux, lxd)
- CI (Linux, linux, qemu)
- CI (macOS, macos-10.15, hyperkit, x86_64)
- CI (macOS, macos-10.15, qemu, x86_64)
- CI (macOS, macos-11, hyperkit, x86_64)
- CI (macOS, macos-11, qemu, x86_64)
- CI (macOS, qemu, arm64)
- CI (Windows, windows-10, hyperv)
- CI (Windows, windows-11, hyperv)
- Linux
- macOS-arm64
- macOS-x86_64
- Windows