Date: 2026-05-07
Branch: comprehensive-review-fixes
Waves completed: 3 (Wave 0 per-package, Wave 1 foundation ×11, Wave 2 deep-dive ×10)
Files modified: 35
All findings resolved: Yes
| Severity | Found | Fixed | Deferred | Blocked |
|---|---|---|---|---|
| CRITICAL | 6 | 6 | 0 | 0 |
| HIGH | 12 | 12 | 0 | 0 |
| MEDIUM | 9 | 9 | 0 | 0 |
| LOW | 4 | 4 | 0 | 0 |
| Total | 31 | 31 | 0 | 0 |
File: internal/nova/quotas.go
Fix: Rewrote CheckQuota to use database.WithTx + SELECT ... FOR UPDATE on the quota row, serializing concurrent quota checks at DB level.
File: internal/common/pagination.go
Fix: Added validSortKeys allowlist map. Invalid keys silently fall back to created_at.
File: internal/neutron/network.go, internal/cinder/volumes.go, internal/neutron/ports.go, internal/nova/handlers.go
Fix: Changed all ORDER BY created_at DESC pagination markers to use compound (created_at, id) cursor key and ORDER BY created_at DESC, id DESC.
File: pkg/cache/cache.go
Fix: FlushAll() now delegates to DeletePattern(ctx, "*") which respects the cache key prefix, scoping deletions to this service.
File: pkg/hypervisor/libvirt.go
Fix: Replaced with VMStatePaused constant and powerState = 3.
File: pkg/hypervisor/libvirt.go
Fix: connectLibvirt() now uses m.libvirtURI to derive socket path when set to a non-default value.
File: internal/keystone/credentials.go
Fix: Replaced string(rune('0'+argCount)) with strconv.Itoa(argCount) throughout.
File: internal/keystone/handlers.go
Fix: Added hasRole(c, "admin") helper; both endpoints now return 403 for non-admin callers.
File: internal/keystone/handlers.go
Fix: Added caller identity check — only the owner or an admin can change a password.
File: internal/metadata/service.go
Fix: Added production IP-based lookup: queries ports.fixed_ip to identify instance from source IP before falling back to header.
File: internal/nova/server_update.go
Fix: Query now fetches user_id from DB; response returns actual user_id instead of projectID.
File: internal/placement/placement.go
Fix: All self-referential URLs now use c.Request.Host at request time.
File: internal/neutron/network.go
Fix: Response now uses the calculated mtu variable.
File: internal/neutron/ports.go
Fix: Added svc.tapManager.DeleteTAPDevice cleanup on AttachToBridge failure and DB insert failure.
File: internal/neutron/network.go
Fix: Added port count and subnet count checks before deletion; returns 409 if dependencies exist.
File: internal/cinder/volumes.go
Fix: Added snapshot count check; returns 409 if snapshots exist.
File: pkg/networking/netns.go
Fix: Replaced all 10 log.Printf calls with zerolog structured logging.
File: internal/compute/node_registry.go
Fix: rows.Scan errors in ListActiveNodes now log via log.Error().
File: internal/middleware/logging.go
Fix: Replaced gin.RecoveryWithWriter(gin.DefaultWriter) with gin.CustomRecovery that logs panics via zerolog.
File: pkg/storage/image_store.go
Fix: Streams image to a temp file, uses the file as io.ReadSeeker body with explicit ContentLength. Removed unused bytes import.
File: pkg/cache/cache.go
Fix: Added defaultTTL field to Cache struct; Set() applies it when ttl == 0.
File: pkg/storage/image_store.go
Fix: Now correctly tries local stat, then S3, instead of falling through to the Ceph error.
Files: internal/cinder/backups.go, internal/cinder/groups.go, internal/nova/handlers.go, internal/neutron/address_scopes.go, internal/neutron/rbac.go, internal/neutron/qos.go, internal/neutron/network_ip_availability.go
Fix: Renamed all 36 occurrences of projID to projectID. Fixed resulting variable shadowing in scans.
Files: internal/cinder/qos_specs.go, internal/cinder/volumes.go
Fix: Renamed 5 methods to use QoS (matching Neutron convention and Go acronym rules).
File: migrations/058_seed_test_security_group.up.sql
Fix: Replaced INSERT with a comment; contract tests create their own security groups dynamically.
File: pkg/storage/ceph.go
Fix: Replaced with log.Warn().Err(err).Msg(...) via zerolog.
Files: Multiple
Fix: Covered by C-3 compound pagination fix.
File: pkg/networking/netns.go
Fix: Covered by H-11 zerolog migration — debug logs now use structured fields.
File: pkg/cache/cache.go
Fix: Covered by M-3.
internal/cinder/backups.go
internal/cinder/groups.go
internal/cinder/qos_specs.go
internal/cinder/volumes.go
internal/common/pagination.go
internal/compute/node_registry.go
internal/keystone/credentials.go
internal/keystone/handlers.go
internal/metadata/service.go
internal/middleware/logging.go
internal/neutron/address_scopes.go
internal/neutron/floatingip.go
internal/neutron/network.go
internal/neutron/network_ip_availability.go
internal/neutron/port_forwarding.go
internal/neutron/ports.go
internal/neutron/qos.go
internal/neutron/rbac.go
internal/neutron/router.go
internal/neutron/vxlan_coordinator.go
internal/nova/console.go
internal/nova/handlers.go
internal/nova/quotas.go
internal/nova/server_update.go
internal/placement/placement.go
migrations/058_seed_test_security_group.up.sql
pkg/cache/cache.go
pkg/hypervisor/libvirt.go
pkg/hypervisor/xml_template.go
pkg/networking/dhcp.go
pkg/networking/netns.go
pkg/storage/ceph.go
pkg/storage/image_store.go
(+ sorting tiebreaker files via earlier sed passes)
go build ./...— PASSgo test ./internal/... ./pkg/...— PASS (all unit tests pass)- Contract tests: SKIP (require running server, not regressions)
None. All 31 findings were fixed.