fix: reconfigure script prefill#672
Conversation
Signed-off-by: ygelfand <yuri@shlitz.com>
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #672 +/- ##
==========================================
+ Coverage 84.14% 92.58% +8.44%
==========================================
Files 10 41 +31
Lines 801 4856 +4055
Branches 0 30 +30
==========================================
+ Hits 674 4496 +3822
- Misses 127 360 +233
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Code Review: PR #672 — "fix: reconfigure script prefill"SummaryThis PR adds a defensive normalization step in the reconfigure flow of Line-by-Line Analysis
+ Lines 118-120 (new block): notify_script = self._data[CONF_NOTIFY_SCRIPT_NAME]
if notify_script and notify_script != NONE_TEXT and not notify_script.startswith("script."):
self._data[CONF_NOTIFY_SCRIPT_NAME] = f"script.{notify_script}"This adds 4 lines of defensive normalization. The logic reads the stored script name, checks if it is not Review Checklist
Verdict🟢 Looks GoodWell-scoped bugfix. The issue is clear (prefix mismatch on reconfigure), the fix is minimal and correct, and the edge cases are properly guarded. No concerns. ✅ Looks Good
|
firstof9
left a comment
There was a problem hiding this comment.
A unit test covering the reconfigure path with a missing script. prefix would be a great addition.
|
Thanks! |
Summary
When reconfiguring the integration, the previous selected value (if not none) is always lost, because it doesn't match the "script." prefix. This restores it.
Proposed change
Minor change overall, just effects reconfigure, but could silently lose custom notifier if you don't re-select it.
Type of change