Skip to content

fix: Compute v2_0 specs and minor code cleanup#21

Draft
Koan-Bot wants to merge 1 commit into
atoomic:masterfrom
Koan-Bot:koan.atoomic/fix-compute-specs-and-cleanup
Draft

fix: Compute v2_0 specs and minor code cleanup#21
Koan-Bot wants to merge 1 commit into
atoomic:masterfrom
Koan-Bot:koan.atoomic/fix-compute-specs-and-cleanup

Conversation

@Koan-Bot

@Koan-Bot Koan-Bot commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

What

Fix broken Compute v2.0 API specs and clean up minor code issues.

Why

The v2_0.pm specs were missing the uid field on both getfromid entries (server_from_uid and delete_server_from_uid). This causes setup_api_methods_for_service() to die at load time for any deployment using OpenStack Compute API v2.0 — the method setup code requires uid for token substitution in routes.

Addresses remaining items from #18 (audit findings).

How

  • v2_0.pm: Added uid: '{server_id}' to both getfromid specs, matching the v2_1 counterpart
  • MetaAPI.pm: Removed duplicate $server_status->{status} check in create_vm polling loop (copy-paste artifact), fixed comment typo, initialized $server_is_ready explicitly
  • Routes.pm: Removed unused use YAML::XS import (DataAsYaml handles YAML internally)
  • New test: t/specs-integrity.t validates all spec classes have required fields for their declared types — catches this class of bug automatically

Testing

  • t/specs-integrity.t: 3 subtests (one per spec class), 14+ individual assertions
  • Verified the test correctly catches the bug: removing uid from v2_0 causes test failure

🤖 Generated with Claude Code


Quality Report

Changes: 4 files changed, 63 insertions(+), 4 deletions(-)

Code scan: clean

Tests: failed (0 Failed, 512 Tests)

Branch hygiene: clean

Generated by Kōan post-mission quality pipeline

Add missing uid: '{server_id}' to both getfromid specs in v2_0.pm —
without this field, setup_api_methods_for_service() dies at load time
for any OpenStack deployment using API version 2.0.

Also: remove duplicate status check in create_vm polling loop,
fix comment typo, initialize $server_is_ready explicitly, and
drop unused YAML::XS import from Routes.pm.

New t/specs-integrity.t validates all spec classes have required
fields for their declared types (prevents future regressions).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

1 participant