fix: surface warning when config thresholds are invalid - #552
fix: surface warning when config thresholds are invalid#552github-actions[bot] wants to merge 2 commits into
Conversation
ConfigurationManager.validateConfiguration() detects when warningThreshold >= errorThreshold, but the result was never checked anywhere in production code (only unit-tested). Wire it into activate() and the configuration change listener so a misconfigured user actually sees a warning instead of silently getting the wrong complexity color coding. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #552 +/- ##
==========================================
- Coverage 83.07% 82.62% -0.46%
==========================================
Files 13 13
Lines 4372 4396 +24
Branches 455 455
==========================================
Hits 3632 3632
- Misses 739 763 +24
Partials 1 1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@copilot add appropriate unit tests |
Co-authored-by: askpt <2493377+askpt@users.noreply.github.com>
Added unit tests in
|
🤖 This is an automated pull request from Repo Assist.
What: Wires
ConfigurationManager.validateConfiguration()intoextension.tsso that misconfigured thresholds (warningThreshold >= errorThreshold) actually surface avscode.window.showWarningMessageto the user, both on activation and whenever settings change.Why:
validateConfiguration()already existed and was covered by unit tests (src/test/configuration.test.ts), but nothing in production code ever called it. A user who misconfigures their thresholds would silently get incorrect complexity color-coding with no indication anything is wrong.Trade-offs: None significant — this is additive and only fires when the configuration is actually invalid. No new dependencies, no behavior change for valid configurations.
Test Status
npm run compile: ✅ cleannpm run lint: ✅ cleannpm run test:unit(c8 + mocha, 225 tests): ✅ all passing, no coverage regressionvscode-test(extension.ts/configuration.ts activation tests): not run — blocked by sandbox network (VS Code test binary download), as is standard in this environmentCloses: none (proactive improvement; Task 4 substituted with Task 5 this run — all outstanding dependency bumps are already covered by open PRs #546/#501/#455, no new engineering work identified).
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
releaseassets.githubusercontent.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.
Add this agentic workflow to your repo
To install this agentic workflow, run