Skip to content

feat: Make notifiers optional in Config model#42

Merged
lan17 merged 3 commits intomainfrom
feat/optional-notifiers
Mar 2, 2026
Merged

feat: Make notifiers optional in Config model#42
lan17 merged 3 commits intomainfrom
feat/optional-notifiers

Conversation

@lan17
Copy link
Owner

@lan17 lan17 commented Mar 2, 2026

Summary

Make the notifiers field optional in the Config model so that the pipeline can start without any notifier configured.

Changes

  • src/homesec/models/config.py: Remove _validate_notifiers model validator that required at least one notifier. Default notifiers to empty list.
  • src/homesec/runtime/worker.py: Add _NoopNotifier class that silently drops alerts when no notifiers are configured, instead of raising RuntimeError.
  • src/homesec/notifiers/multiplex.py: Remove empty-list guard in MultiplexNotifier.__init__ constructor.
  • src/homesec/services/setup.py: Default finalize config to empty notifiers list instead of injecting a default MQTT notifier.

Motivation

The setup wizard doesn't always configure a notifier (e.g., no MQTT broker available in dev/CI environments). Previously this caused a validation error that prevented config.yaml from being written, leaving the app stuck in setup mode. With this change, the pipeline starts normally and logs a message that notifications are disabled.

lan17 added 3 commits March 2, 2026 14:44
- Remove model validator requiring at least one notifier
- Default notifiers to empty list in Config
- Add NoopNotifier for when no notifiers are configured
- Remove hard requirement in MultiplexNotifier constructor
- Default setup finalize to empty notifiers list instead of MQTT
@lan17 lan17 changed the title Make notifiers optional in Config model feat: Make notifiers optional in Config model Mar 2, 2026
@codecov
Copy link

codecov bot commented Mar 2, 2026

Codecov Report

❌ Patch coverage is 73.07692% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.88%. Comparing base (f2f32a7) to head (2686277).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/homesec/runtime/worker.py 66.66% 4 Missing ⚠️
src/homesec/pipeline/core.py 76.92% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #42      +/-   ##
==========================================
+ Coverage   82.73%   82.88%   +0.14%     
==========================================
  Files         107      107              
  Lines        9673     9679       +6     
==========================================
+ Hits         8003     8022      +19     
+ Misses       1670     1657      -13     

☔ View full report in Codecov by Sentry.
📢 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.

@lan17 lan17 merged commit d0a725b into main Mar 2, 2026
3 of 5 checks passed
@lan17 lan17 deleted the feat/optional-notifiers branch March 2, 2026 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant