test(logging): regression-guard the category-toggle Info enablement (#4419) - #4588
test(logging): regression-guard the category-toggle Info enablement (#4419)#4588skerker wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Good fix, and the PR body's claims hold up under independent checking. I built the new test standalone against your branch head (4d3e770) and ran it: 11/11 pass, and with only the .info=true line reverted it goes red on exactly the two #4419 assertions (enabled: info on, enabled: qCInfo emitted) — the other nine stay green, which is the right shape for a regression test. All 8 CI checks are green including check-windows.
I also verified the "default verbosity unchanged" claim independently: loadSettings()'s defaultOn set is {discovery, connection, protocol, audio.summary, kiwisdr}, every one of which is declared QtDebugMsg/QtInfoMsg, so their Info was already visible before this change — no default-on category gains output. And loadSettings() does call applyFilterRules(), so the fix is live at startup rather than only after a re-toggle in the dialog. The decision to skip a blanket aether.*.info=false is the right one for the reasons you give.
No blocking findings.
Polish
- The test's fake-
HOMEsandbox is inert —AppSettingsrefuses to save before a successful load, so nothing is written and three warning lines print to the test output.
Non-blocking notes
- The toggle now enables Info but still can't disable it for the seven
QtDebugMsg/QtInfoMsg-declared categories; worth a code comment so the asymmetry doesn't get re-derived later.
🤖 aethersdr-agent · cost: $5.7209 · model: claude-opus-5
| if (c.enabled) | ||
| if (c.enabled) { | ||
| rules << QString("%1.debug=true").arg(c.id); | ||
| // Most categories declare a QtWarningMsg threshold, which gates |
There was a problem hiding this comment.
Non-blocking, but worth capturing here rather than only in the PR description: after this change the toggle enables Info for the QtWarningMsg-declared majority, but it still can't disable Info for the seven categories declared QtDebugMsg/QtInfoMsg (discovery, connection, protocol, kiwisdr, automation, hl2, audio.summary) — no rule touches their Info, so it's on whether the box is ticked or not. That's deliberate and I agree with it, but the comment as written reads as though the toggle now governs Info uniformly. One clause would save the next reader the round trip through the issue:
| // Most categories declare a QtWarningMsg threshold, which gates | |
| // Most categories declare a QtWarningMsg threshold, which gates | |
| // Info as well as Debug — without an .info rule their qCInfo | |
| // lines can never emit under any runtime configuration (#4419). | |
| // Note the asymmetry: no blanket aether.*.info=false is emitted | |
| // (it would newly silence the QtDebugMsg/QtInfoMsg-declared | |
| // categories), so for those the toggle governs Debug only and | |
| // their Info stays visible regardless. | |
| rules << QString("%1.info=true").arg(c.id); |
| std::printf("[FAIL] create temporary home\n"); | ||
| return 1; | ||
| } | ||
| qputenv("HOME", fakeHome.path().toUtf8()); |
There was a problem hiding this comment.
This sandbox doesn't do anything. LogManager::setEnabled/setAllEnabled call saveSettings(), but AppSettings refuses to write before a successful load() — which this test never calls — so no settings file is ever created under the fake home. Running the built test confirms it: three AppSettings: refusing to save before a successful load lines on stdout, no files written.
That's harmless for what the test asserts (it reads category flags, not persisted state), but the four lines are dead weight and the warnings look like a failure at a glance in ctest output. I'd drop them and keep only QTemporaryDir-free setup, or leave a one-line comment saying the save path is intentionally a no-op here. Not worth calling AppSettings::instance().load() to "fix" it — that would make the test start writing real files, which is strictly worse.
… path (aethersdr#4588 review) Comment-only. The applyFilterRules() comment now states that no blanket aether.*.info=false is emitted, so the seven QtDebugMsg/QtInfoMsg-declared categories keep their Info regardless of the toggle. The test's settings sandbox is kept as defense-in-depth and marked as an intentional no-op (AppSettings refuses to save before a successful load). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Both notes addressed in 8f51ad1 (comment-only):
— authored by agent (Claude Code) on behalf of @skerker |
|
Heads up — the production half of this landed in
rules << QString("%1.info=true").arg(c.id);It merged 2026-07-30 01:46 UTC; this PR's head ( So The test is still worth landing
That's the good outcome: the test isn't coupled to this branch's version of the fix, it's testing the behavior. It guards the shipped code as written. Suggested pathRetarget this PR to test-only:
That clears the conflict, drops the duplication, and keeps the part of this PR Two smaller notes:
Nothing wrong with the work — this is just two people finding the same bug in the same week. — review by agent (Claude Code) on behalf of @jensenpat |
|
@jensenpat I'll go ahead and follow the suggested path above to retarget to test-only |
8f51ad1 to
5afb957
Compare
…ggle (aethersdr#4588 review) Folds the asymmetry note into applyFilterRules()'s comment, per review: no blanket aether.*.info=false is emitted — it would newly silence the QtDebugMsg/QtInfoMsg-declared categories whose Info is visible today — so for those categories the toggle governs Debug only. Comment-only change. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Retargeted as suggested: branch is now — authored by agent (Claude Code) on behalf of @skerker |
ten9876
left a comment
There was a problem hiding this comment.
Settings-architecture sweep of open PRs against the now-merged RFC #4603 store (maintainer-requested). One structural change needed here; the test itself is welcome.
log_manager_filter_rules_test will no longer link once this branch rebases onto current main. The new target compiles src/core/AppSettings.cpp standalone:
add_executable(log_manager_filter_rules_test
tests/log_manager_filter_rules_test.cpp
src/core/LogManager.cpp
src/core/AppSettings.cpp
src/core/AsyncLogWriter.cpp
)Since #4612, AppSettings is SQLite-backed and its implementation spans a source group (SettingsDatabase, SettingsPaths, SettingsBootstrap, SettingsSanitizer) plus the vendored engine. I verified this empirically — your CMake hunk applied onto today's main (020325fa) fails with:
undefined reference to `AetherSDR::SettingsDatabase::setMetaValue(...)'
undefined reference to `AetherSDR::SettingsPaths::legacyXmlPath()'
...
(Your green CI is not lying to you — it ran against a pre-#4612 merge base.)
The fix is two lines, and I verified it links clean:
- In the target's sources, replace
src/core/AppSettings.cppwith${AETHER_SETTINGS_SOURCES}. - Add
log_manager_filter_rules_testto theAETHER_SETTINGS_CONSUMERSlist near the end ofCMakeLists.txt(that loop linksaether_sqlite3for you).
This is the standing pattern for every target that compiles AppSettings.cpp — the comment block above set(AETHER_SETTINGS_SOURCES …) (CMakeLists.txt ~line 525) documents it, and AGENTS.md's Settings Persistence section now carries it as canon.
Also worth knowing for this test specifically: the "refuses to save before a successful load" no-op you rely on is now contract-pinned by app_settings_safety_test's save-before-load scenario, so your comment's assumption is guaranteed, not incidental.
…ethersdr#4419) The production fix (%1.info=true beside %1.debug=true in applyFilterRules()) landed on main independently via aethersdr#4537 (4077e02); this PR is retargeted to carry only the test that guards it, per review. log_manager_filter_rules_test drives the real LogManager toggle in a sandboxed settings home and asserts Info+Debug off when disabled and on when enabled — at the category-flag level and end-to-end through a message-handler capture of an actual qCInfo — plus per-category independence, warnings always passing, the audio.summary special case, no new suppression of QtDebugMsg-declared categories, and the gate closing again on disable. With main's .info=true line reverted, exactly the two aethersdr#4419 assertions fail. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ggle (aethersdr#4588 review) Folds the asymmetry note into applyFilterRules()'s comment, per review: no blanket aether.*.info=false is emitted — it would newly silence the QtDebugMsg/QtInfoMsg-declared categories whose Info is visible today — so for those categories the toggle governs Debug only. Comment-only change. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…er_rules_test (aethersdr#4588 review) Post-aethersdr#4612 (RFC aethersdr#4603), AppSettings' implementation spans the settings source group plus the vendored SQLite engine. Follow the standing pattern: sources come from ${AETHER_SETTINGS_SOURCES}, and the target joins AETHER_SETTINGS_CONSUMERS so the engine links in. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
5afb957 to
59e6188
Compare
|
Done as prescribed: rebased onto current The — authored by agent (Claude Code) on behalf of @skerker |
Retargeted after review: the production fix landed on
mainindependently via #4537 (4077e023) while this PR was open — same diagnosis, same line. The branch is now currentmain(e8a4e950) plus two commits: the regression test, and the comment-only addendum from review folding the asymmetry note intomain'sapplyFilterRules()comment.Refs #4419.
What
log_manager_filter_rules_test(ctest-registered) drives the realLogManagertoggle in a sandboxed settings home and asserts Info+Debug off when disabled and on when enabled — at the category-flag level and end-to-end through a message-handler capture of an actualqCInfo— plus per-category independence, warnings always passing, theaudio.summaryspecial case, no new suppression of QtDebugMsg-declared categories, and the gate closing again on disable.applyFilterRules()recording that the missing blanketaether.*.info=falseis deliberate: it would newly silence the QtDebugMsg/QtInfoMsg-declared categories whose Info is visible today, so for those the toggle governs Debug only.Verification (macOS, clean build)
5afb957d(crdv_quarantined_testskipped by design).cdc68926: withmain's%1.info=trueline reverted, exactly the two Diagnostic qCInfo lines on QtWarningMsg-declared categories can never emit — 107 call sites are unreachable on every build #4419 assertions fail (enabled: info on,enabled: qCInfo emitted); restored, all green — matching the transfer check in the review.— authored by agent (Claude Code) on behalf of @skerker