fix: create_vm robustness and cleanup - #16
Draft
Koan-Bot wants to merge 2 commits into
Draft
Conversation
…st fixture
Three bugs fixed in create_vm():
1. Missing null-check after image lookup — if neither image_from_uid nor
image_from_name finds a match, $image->{id} would crash with a cryptic
"Can't use undef as HASH ref" error. Now dies with a descriptive message.
2. Redundant condition — $server_status->{status} was checked twice in the
active-status condition (copy-paste artifact).
3. Wrong test fixture format — json_imageid() used Compute-style {image: {...}}
wrapping, but image_from_uid hits Glance v2 API which returns a flat hash.
This meant $image->{id} was silently undef in tests (masked because the
POST mock doesn't validate imageRef). Fixed to match actual Glance v2 format.
Also adds a test for the image-not-found error path and fixes a typo in comment.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
WhiteSource dependency scanning config has been abandoned — no active integration exists. Modern projects use GitHub's native Dependabot or similar alternatives. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
7 tasks
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 three bugs in
create_vm()and remove dead WhiteSource config.Why
$image->{id}crashes with cryptic "Can't use undef as HASH ref" instead of a helpful error message.$server_status->{status}was checked twice in the active-status loop — copy-paste artifact.json_imageid()used Compute-style{image: {...}}wrapping, butimage_from_uidhits Glance v2 API which returns a flat hash. This meant$image->{id}was silentlyundefin tests (masked because the POST mock ignores parameter values).How
look_by_id_or_name()for other resources.whitesourceconfig (separate commit)Testing
Full test suite passes (
prove -lv t/— 27 tests across 6 files).🤖 Generated with Claude Code
Quality Report
Changes: 3 files changed, 39 insertions(+), 44 deletions(-)
Code scan: clean
Tests: passed (OK)
Branch hygiene: clean
Generated by Kōan post-mission quality pipeline