Repository navigation
fix: _list() filter matches falsy-but-valid field values - #26
Merged
atoomic merged 1 commit intoSep 11, 2026
Merged
Conversation
The filtering logic in Listable::_list() used a truthiness check
($candidate->{$filter} && ...) which silently rejected entries where
the filtered field held a legitimate falsy value like 0, "0", or
empty string. OpenStack responses include such values (e.g.,
OS-EXT-STS:power_state = 0 for stopped VMs).
Replace the truthiness check with defined() so that only truly
missing/undef fields are excluded from results.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
atoomic
marked this pull request as ready for review
September 11, 2026 00:12
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.
What
Fix
_list()client-side filtering to correctly match entries with falsy field values (0, empty string).Why
The filter logic used Perl truthiness (
$candidate->{$filter} && ...) which silently excluded entries where the field held0,"0", or"". In OpenStack, fields likeOS-EXT-STS:power_stateare0for stopped VMs — filtering by power_state=0 returned no results.How
Replace truthiness check with
defined()on lines 52 and 57 of Listable.pm. Only truly undef/missing fields are now excluded.Testing
New
t/listable-filter.tcovers:All existing tests pass.
🤖 Generated with Claude Code
Quality Report
Changes: 2 files changed, 113 insertions(+), 2 deletions(-)
Code scan: clean
Tests: passed (OK)
Branch hygiene: clean
Generated by Kōan post-mission quality pipeline