Skip to content

test: Fix the weekly run against current Home Assistant - #23

Merged
sdebasek merged 2 commits into
mainfrom
fix/weekly-canary
Sep 2, 2026
Merged

sdebasek merged 2 commits into
mainfrom
fix/weekly-canary

Conversation

@sdebasek

@sdebasek sdebasek commented Sep 2, 2026

Copy link
Copy Markdown
Owner

The weekly latest HA run has been red since 2026-08-31. Fixes the break and makes the next one notify someone.

1. The break

Five tests called device_registry.async_get_device, which current Home Assistant raises on rather than warns about, and removes in 2027.8.0.

No production code was affected. api.py already resolves our device row with async_entries_for_config_entry and documents why. The tests were the only callers, so users saw nothing. What it cost was the canary: a job whose only value is being red exactly when something upstream breaks.

async_get_device_by_identifier takes the config entry id, so the tests now scope the lookup the way production does instead of resolving an identifier we deliberately share with the official integration.

2. Nobody was told

A scheduled failure has no pull request to redden and no pushing author to mail, which is how this sat for two days. A new job files an issue instead, on schedule only, since a manual run already has someone watching it.

One open issue at a time, commented on rather than reopened weekly, so a break that stays broken does not bury the original under duplicates. Both paths were run with gh stubbed. Job-level permissions restates contents: read because job permissions replace the workflow's rather than adding to them.

Testing

Installed current Home Assistant (2026.9.0b4) in a scratch venv and ran the suite, since latest HA deliberately never runs on a pull request and this PR's CI therefore cannot prove the fix:

pinned 2026.8.2 latest 2026.9.0b4
before 232 passed 5 failed, 227 passed
after 232 passed 232 passed

The 5 match the CI failures exactly. Worth a workflow_dispatch of Validate on main after merge to confirm on the runner.

The weekly `latest HA` run has been red since 2026-08-31. Five tests
called device_registry.async_get_device, which now raises rather than
warns and is removed in 2027.8.0.

No production code was affected: api.py already looks our device row up
with async_entries_for_config_entry, and explains why. The tests were the
only callers, so users saw nothing. What it cost was the canary itself, a
job whose only value is being red exactly when something upstream breaks.

async_get_device_by_identifier takes the config entry id, so the tests
now scope the lookup the same way production does rather than resolving
an identifier we deliberately share with the official integration.

Verified against 2026.9.0b4: 5 failed before, 232 pass after.
A scheduled run failing notifies nobody: there is no pull request to
redden and no pushing author to mail. That is how `latest HA` stayed red
for two days without anyone noticing, which is the entire value of the
job gone.

One open issue at a time, commented on rather than reopened weekly. An
upstream break stays broken until someone fixes it, so a fresh issue
every Monday would bury the original under its own duplicates.

Not wired to `workflow_dispatch`: a manual run already has someone
watching it.
@sdebasek
sdebasek merged commit 9a2bab8 into main Sep 2, 2026
7 checks passed
@sdebasek
sdebasek deleted the fix/weekly-canary branch September 2, 2026 13:34
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