feat: hassfest action for Home Assistant custom integrations #5

Merged
tim merged 1 commit from feat/hassfest into main 2026-10-12 12:19:54 +00:00
Owner

Adds hassfest: Home Assistant's own validator for custom integrations (manifest, requirements, config flow, translations, services), the same checks as home-assistant/actions/hassfest on GitHub, which never runs on Forgejo.

How it works

Runs the official image ghcr.io/home-assistant/hassfest and copies the workspace in with docker cp. A job runs in a container that talks to the host's Docker socket, so a bind-mounted workspace path would not exist on the host and hassfest would silently validate an empty directory. The action fails when no custom_components/*/manifest.json exists, so an empty validation can't pass either.

It found real problems

Running it against my own repositories before building the action:

  • homeassistant is not a valid key in manifest.json. The minimum Home Assistant version belongs in hacs.json. (The key was already in smart-forecast-solar's manifest, and I had added it to daikin-altherma's.)
  • Manifest keys must be sorted: domain, name, then alphabetical.
  • A requirement must not contain a space: pkg@git+https://...@v0.2.0, not pkg @ git+....

PATTERNS.md is corrected where it said otherwise, and has a new "Home Assistant custom components" section.

The check must be able to fail

The self-test (test-hassfest.yml) runs the action on a valid fixture (must pass) and on an invalid one (must fail, enforced by continue-on-error plus an outcome assertion). I verified locally that an invalid manifest makes hassfest exit 1.

Notes

  • The HACS validation action (hacs/action) needs the GitHub API and cannot run on Forgejo. It is not replaced; hassfest plus a correct hacs.json is what can be checked here.
  • The image only publishes latest, so the check follows Home Assistant. That is why the template also runs weekly.
  • Callers: tim/hass-daikin-altherma (next commit on its MR) and tim/hass-smart-forecast-solar.

Claude-Session: https://claude.ai/code/session_013jL41LP9srdcUDYggNpC98

🤖 Generated with Claude Code

Adds `hassfest`: Home Assistant's own validator for custom integrations (manifest, requirements, config flow, translations, services), the same checks as `home-assistant/actions/hassfest` on GitHub, which never runs on Forgejo. ## How it works Runs the official image `ghcr.io/home-assistant/hassfest` and copies the workspace in with `docker cp`. A job runs in a container that talks to the host's Docker socket, so a bind-mounted workspace path would not exist on the host and hassfest would silently validate an empty directory. The action fails when no `custom_components/*/manifest.json` exists, so an empty validation can't pass either. ## It found real problems Running it against my own repositories before building the action: - `homeassistant` is **not a valid key** in `manifest.json`. The minimum Home Assistant version belongs in `hacs.json`. (The key was already in smart-forecast-solar's manifest, and I had added it to daikin-altherma's.) - Manifest keys must be sorted: `domain`, `name`, then alphabetical. - A requirement must not contain a space: `pkg@git+https://...@v0.2.0`, not `pkg @ git+...`. `PATTERNS.md` is corrected where it said otherwise, and has a new "Home Assistant custom components" section. ## The check must be able to fail The self-test (`test-hassfest.yml`) runs the action on a valid fixture (must pass) and on an invalid one (must fail, enforced by `continue-on-error` plus an outcome assertion). I verified locally that an invalid manifest makes hassfest exit 1. ## Notes - The HACS validation action (`hacs/action`) needs the GitHub API and cannot run on Forgejo. It is not replaced; `hassfest` plus a correct `hacs.json` is what can be checked here. - The image only publishes `latest`, so the check follows Home Assistant. That is why the template also runs weekly. - Callers: tim/hass-daikin-altherma (next commit on its MR) and tim/hass-smart-forecast-solar. Claude-Session: https://claude.ai/code/session_013jL41LP9srdcUDYggNpC98 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat: hassfest action for Home Assistant custom integrations
All checks were successful
test auto-tag / test (pull_request) Successful in 3s
test docker-publish / test (pull_request) Successful in 4s
test hassfest / test (pull_request) Successful in 2m50s
test python-test / test (pull_request) Successful in 16s
test security-scan / test (pull_request) Successful in 29s
ef55ea646d
Runs Home Assistant's own validator (ghcr.io/home-assistant/hassfest),
the same checks as home-assistant/actions/hassfest on GitHub. The
workspace is copied in with docker cp: a job runs in a container that
talks to the host's Docker socket, so a bind-mounted workspace path
would not exist on the host and hassfest would validate nothing.

The self-test runs it on a valid fixture (must pass) and on an invalid
one (must fail), so the check cannot silently stop failing.

Running it against real repositories found rules no linter knows:
"homeassistant" is not a valid manifest key (the minimum version goes in
hacs.json), manifest keys must be sorted, and a requirement must not
contain a space (pkg@git+https://..., not pkg @ git+...). PATTERNS.md
says so; two statements there were wrong and are corrected.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013jL41LP9srdcUDYggNpC98
tim merged commit 63915cb4de into main 2026-10-12 12:19:54 +00:00
tim deleted branch feat/hassfest 2026-10-12 12:19:55 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
tim/workflow-basics!5
No description provided.