Repository navigation
0.10.0 — the dashboard cards ship with the integration - #53
Merged
Merged
Conversation
The HACS default-store review asked that the cards, a separate repository up to cards 0.2.0, ship inside the integration (ADR-0024): - card sources move to cards/ (from notify-switchboard-cards d7bc8e9); the build lands in custom_components/notify_switchboard/www/ and is committed; a Cards workflow checks the sources and that the build is up to date - the integration serves www/ at /notify_switchboard and keeps one module resource at ?v=<version> (extra frontend module in YAML resource mode); removing the entry removes it; failures are logged, never fatal - a repair, legacy_cards_resource, while an old copy of the bundle loads - cards take the integration's version; contract v0.10 addendum; docs/cards.md Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…odule From the independent judge's no-go: - aiohttp keeps the first static resource on a prefix and accepts a second silently, so a clash on /notify_switchboard left the bundle at 404 with no warning; the router is now searched first, and on a clash nothing is served, a warning is logged and no dashboard resource is written - an existing resource to the bundle of type `js` is put back to `module` (the bundle is an ES module); an absolute URL to the bundle counts as ours, not as a legacy copy - the failure test now checks that a message still reaches a phone Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Closes the mutant the judge's second pass found surviving. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Response to the HACS default-store review (hacs/default#10724, hacs/default#10725): the dashboard cards ship inside the integration. Decision record
docs/ADR/0024-cards-ship-with-the-integration.md, contract v0.10 addendum indocs/contract.md. Three commits: the change (29c0da1), the fixes from the independent judge (a0ed463), one closed test gap (d408a8a). Not merged, not tagged, not released.Summary
cards/(fromnotify-switchboard-cardsd7bc8e9, unchanged except paths, the documentation URL and a guard on the card-picker entries). The build goes tocustom_components/notify_switchboard/www/and is committed, because the release zip ships what is committed. The cards take the integration's version (0.10.0); a test checks thatcards/package.jsonmatchesmanifest.json.async_setupserveswww/at/notify_switchboard. aiohttp silently accepts a second static resource on a prefix that is already taken, so the router is checked first: if the path is taken, nothing is served, a warning is logged and no resource is written.moduleresource/notify_switchboard/notify-switchboard-cards.js?v=<version>. It is created if missing, moved to the current version, put back tomoduleif needed, and duplicates are removed. An absolute URL to the same path counts as ours. With YAML resources the YAML is left untouched and the bundle is loaded withadd_extra_js_url. Removing the entry removes the resource. A failure never fails the entry: it is logged and the router keeps working.repairsissue,legacy_cards_resource, appears while any other resource still loadsnotify-switchboard-cards.js(/hacsfiles/…,/local/community/…,/local/…). That resource belongs to HACS, so the integration never deletes it.docs/cards.md(the former cards README), the README, ARCHITECTURE, CONTRIBUTING, known issues (a stale resource after uninstalling through HACS or disabling the entry), CHANGELOG 0.10.0, and the cards' changelog indocs/history/cards-changelog.md.Tests
ruff,ruff format --check,mypy(strict) and pytest are green: 486 unit tests and 392 acceptance tests.cards.pyis at 99 %. Cards: lint, format, typecheck, 179 vitest tests and the size budget (22 kB gzip) pass. The build is byte-identical when rebuilt. hassfest run locally passes (0 invalid).tests/unit/test_cards.pycovers storage and YAML modes, reload, restart, version move, type fix, deduplication, removal, every legacy path, an absolute URL, a resource registration failure (a message still reaches a phone), a failing static path and a path already served by something else.claude -p, Opus, separate context, hidden tests the author never saw, success criteria written from the HACS comments only):d408a8a.moduleresource is written.legacy_cards_resourceis raised for the old/local/copy, and its menu path exists.Deviations and things to look at
.github/workflows/cards.yml. The checklist forbids workflow edits outside a CI sprint. This one only adds a job (lint, test, build, size, and a check that the committed build matches the sources). ADR-0024 explains why.http,frontendandlovelaceareafter_dependencies, notdependencies. The code handles their absence, and the tests do not need the frontend package.StaticPathConfigis imported fromhomeassistant.components.http.server, because the package re-exports it without__all__and mypy strict complains.release.ymlpublishes as soon as the tag is pushed, without waiting for Validate or Cards, so tag only after green CI.Core APIs cited (2026.9.1)
homeassistant/components/http/server.py:StaticPathConfig,async_register_static_paths→_async_register_static_paths(router.register_resource)homeassistant/components/lovelace/__init__.py:LovelaceData(resources,resource_mode)homeassistant/components/lovelace/resources.py:ResourceStorageCollection(async_get_info,async_create_itemwithres_type,async_update_item,async_delete_item),ResourceYAMLCollection.async_itemshomeassistant/components/lovelace/const.py:LOVELACE_DATA,RESOURCE_CREATE_FIELDShomeassistant/components/frontend/__init__.py:add_extra_js_url,remove_extra_js_urlhomeassistant/helpers/issue_registry.py:async_create_issue,async_delete_issuescript/hassfest/dependencies.py:calc_allowed_references(after_dependencies allow the imports)🤖 Generated with Claude Code