Skip to content

fix: guard home.class access in battery homeAspect functions - #510

Merged
sini merged 1 commit into
denful:mainfrom
sini:fix/home-class-guard
May 11, 2026
Merged

sini merged 1 commit into
denful:mainfrom
sini:fix/home-class-guard

Conversation

@sini

@sini sini commented May 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Guard home.class access in all battery homeAspect functions with conditional checks
  • Prevents crash when home entity lacks a class attribute (e.g. no den.homes defined)
  • Affects: unfree-predicate-builder, insecure-predicate-builder, flake-parts/self, flake-parts/inputs

Test plan

  • 771/771 CI tests pass
  • unfree and standalone-homes suites pass

All battery homeAspect functions eagerly access home.class which
throws when the home entity lacks a class attribute.  Guard with
lib.optionalAttrs so the aspect produces an empty attrset instead
of crashing when home context is incomplete.

Affects: unfree-predicate-builder, insecure-predicate-builder,
flake-parts/self, flake-parts/inputs.
@sini
sini force-pushed the fix/home-class-guard branch from 10db42a to 80da9de Compare May 11, 2026 14:47
@sini sini added the allow-ci allow all CI integration tests label May 11, 2026
@sini
sini merged commit 12a1740 into denful:main May 11, 2026
40 of 53 checks passed
charlesfire pushed a commit to charlesfire/den that referenced this pull request May 16, 2026
)

## Summary

- Guard `home.class` access in all battery `homeAspect` functions with
conditional checks
- Prevents crash when `home` entity lacks a `class` attribute (e.g. no
`den.homes` defined)
- Affects: unfree-predicate-builder, insecure-predicate-builder,
flake-parts/self, flake-parts/inputs

## Test plan

- [x] 771/771 CI tests pass
- [x] unfree and standalone-homes suites pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

allow-ci allow all CI integration tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants