Skip to content

Refactor circuit discovery logic, enhance parameter validation#1552

Merged
liudger merged 2 commits into
mainfrom
harden-circuit-discovery
Jul 4, 2026
Merged

Refactor circuit discovery logic, enhance parameter validation#1552
liudger merged 2 commits into
mainfrom
harden-circuit-discovery

Conversation

@liudger

@liudger liudger commented Jul 4, 2026

Copy link
Copy Markdown
Owner
  • Replace MIN_SUPPORTED_JSON_API check with _supports_full_config in BSBLAN class.
  • Introduce is_param_value_active utility function to streamline active value checks.
  • Update tests to cover new logic for circuit discovery and parameter validation.

liudger added 2 commits July 4, 2026 18:55
- Replace MIN_SUPPORTED_JSON_API check with _supports_full_config in BSBLAN class.
- Introduce is_param_value_active utility function to streamline active value checks.
- Update tests to cover new logic for circuit discovery and parameter validation.
Copilot AI review requested due to automatic review settings July 4, 2026 16:59
@liudger liudger added the refactor Improvement of existing code, not introducing new features. label Jul 4, 2026
@codecov

codecov Bot commented Jul 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (979984e) to head (7b2ca8f).

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1552   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           14        14           
  Lines         1325      1325           
  Branches       142       142           
=========================================
  Hits          1325      1325           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sonarqubecloud

sonarqubecloud Bot commented Jul 4, 2026

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors heating-circuit discovery in the BSBLAN client to rely on the resolved capability flag (basic vs full config) rather than a JSON-API version string, and centralizes the “active parameter value” check so circuit probing and API section validation cannot diverge.

Changes:

  • Replace the circuit-discovery short-circuit guard with self._supports_full_config is False (basic-config detection).
  • Introduce is_param_value_active() in src/bsblan/utility.py and reuse it in APIValidator and both circuit-probing paths.
  • Extend tests to cover basic-config skip behavior and unresolved-capability probing, plus direct coverage of the new helper.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/bsblan/bsblan.py Uses _supports_full_config is False to skip discovery for basic config; reuses shared active-value predicate in probing logic.
src/bsblan/utility.py Adds is_param_value_active() and delegates APIValidator._is_valid_param() to it.
tests/test_circuit.py Updates/extends circuit discovery tests for basic-config skip and unresolved-capability probing.
tests/test_utility.py Adds direct unit tests for is_param_value_active() and keeps validator tests green via delegation.
openspec/specs/circuit-discovery/spec.md Adds spec documenting circuit discovery guard behavior and the shared predicate.
openspec/changes/archive/2026-07-04-harden-circuit-discovery-consistency/tasks.md Archives implementation tasks/checklist for the change.
openspec/changes/archive/2026-07-04-harden-circuit-discovery-consistency/specs/circuit-discovery/spec.md Archives delta spec for the circuit-discovery requirements.
openspec/changes/archive/2026-07-04-harden-circuit-discovery-consistency/proposal.md Archives proposal context and intended behavior changes.
openspec/changes/archive/2026-07-04-harden-circuit-discovery-consistency/design.md Archives design rationale and trade-offs for the refactor/guard change.
openspec/changes/archive/2026-07-04-harden-circuit-discovery-consistency/.openspec.yaml Archives OpenSpec metadata for the change bundle.

Comment thread src/bsblan/utility.py
Comment on lines +80 to +83
Returns:
bool: True if the payload is non-empty and its value is neither
None nor the inactive marker ("---").

@liudger liudger merged commit b3c2c31 into main Jul 4, 2026
18 checks passed
@liudger liudger deleted the harden-circuit-discovery branch July 4, 2026 17:44
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

refactor Improvement of existing code, not introducing new features.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants