Skip to content

fix: specs correctness and comprehensive test coverage - #12

Merged
atoomic merged 2 commits into
cpan-authors:mainfrom
Koan-Bot:koan.atoomic/specs-fixes-and-tests
Sep 11, 2026
Merged

atoomic merged 2 commits into
cpan-authors:mainfrom
Koan-Bot:koan.atoomic/specs-fixes-and-tests

Conversation

@Koan-Bot

@Koan-Bot Koan-Bot commented Mar 25, 2026 •

Copy link
Copy Markdown
Contributor

What

Fix two bugs in API specs and add 41 tests for previously untested core functionality.

Why

  • prokect_id typo in Network specs silently broke server-side filtering by project ID
  • Compute v2_1 had a delete section using getfromid type, generating a GET method for what should be a DELETE — dead code that would misbehave if ever wired up
  • The specs method generation system and Listable filtering logic (including regex) had zero test coverage

How

  1. Fixed typo prokect_id → project_id in Network v2 specs
  2. Removed the broken delete spec from Compute v2_1 (the real delete_server in Compute.pm handles deletion correctly with floating IP cleanup)
  3. Added t/specs-and-filtering.t with 41 tests covering: regex/multi-criteria/empty filtering, getfromid response unwrapping, query_filters_for validation, Routes dispatch, and error handling

Testing

Full test suite passes: 7 files, 64 tests (was 23 before this PR).

🤖 Generated with Claude Code


Quality Report

Changes: 3 files changed, 415 insertions(+), 11 deletions(-)

Code scan: clean

Tests: passed (OK)

Branch hygiene: clean

Generated by Kōan post-mission quality pipeline

Koan-Bot and others added 2 commits September 10, 2026 19:08
The delete section defined a 'delete_server_from_uid' method using
'getfromid' type, which generates a GET request — not a DELETE. This
method was also unreachable through Routes (not registered in the
route table), making it dead code that would behave incorrectly if
ever wired up.

The actual delete_server method in Compute.pm handles deletion with
proper floating IP cleanup and is the correct implementation.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Add 41 tests covering previously untested functionality:

- Listable regex filtering (single match, multi match, no match)
- Multi-criteria filtering with AND semantics
- Filtering resilience when fields are missing on candidates
- getfromid single-key response unwrapping behavior
- getfromid multi-key response passthrough
- Specs query_filters_for validation (valid, invalid, mixed keys)
- query_filters_for edge cases (odd args, empty, unknown routes)
- Network service server-side query filter propagation
- Routes::list_all() coverage
- Error handling in query_filters_for

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@Koan-Bot
Koan-Bot force-pushed the koan.atoomic/specs-fixes-and-tests branch from 0168db2 to f3c738e Compare September 11, 2026 01:09
@atoomic
atoomic marked this pull request as ready for review September 11, 2026 01:12
@atoomic
atoomic merged commit 332cfa1 into cpan-authors:main Sep 11, 2026
19 checks passed
@Koan-Bot

Copy link
Copy Markdown
Contributor Author

Simple rebase

Branch koan.atoomic/specs-fixes-and-tests was rebased onto main — no additional changes were needed.

Stats

2 files changed, 414 insertions(+), 10 deletions(-)
Actions performed
  • Already-solved check: skipped (Claude call failed)
  • Rebased koan.atoomic/specs-fixes-and-tests onto origin/main
  • Pre-push CI check: previous run #23541821822 failed
  • Pre-push CI fix: no changes needed or Claude found nothing to fix
  • Force-pushed koan.atoomic/specs-fixes-and-tests to fork-Koan-Bot
  • Private review gate passed
  • CI check enqueued in ## CI (async)

CI status

CI will be checked asynchronously.


Automated by Skuggi

atoomic added a commit that referenced this pull request Sep 11, 2026
Covers the merges of #12 and #16: the create_vm image null-check, the
removal of the broken Compute v2_1 delete spec, the dead .whitesource
config, and the Glance image fixture correction.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
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.

2 participants