fix: Query both ABS and vmpooler services to find all active VMs - #47
Merged
Conversation
The ABS service only returns VMs from its own job tracking, missing VMs from previous checkouts. Now also queries the vmpooler service directly and merges results with deduplication by hostname. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Cache vmpooler VM data locally (~/.bolt_dynamic_inventory/cache/) with a 24-hour TTL so repeated inventory calls don't re-query ABS and vmpooler services. Includes require 'time' fix that was crashing iso8601 calls. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Without these stubs, tests hit the on-disk cache from prior live runs, bypassing the Open3 stubs entirely and causing all 14 vmpooler tests to fail with unexpected nmap arguments. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Enrich VM data with TTL (time-to-live) calculated from vmpooler's lifetime/running fields so users see when each VM will be reaped. The merge logic now enriches ABS VMs with TTL from vmpooler data. Add smart cache invalidation: if any cached VM's TTL has passed, the cache is automatically refreshed. Add --refresh/-r CLI flag for manual cache bypass. Surface unreachable VMs in a dedicated 'unavailable' group instead of silently dropping them, making connectivity issues visible. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add ADR-0008 (query both ABS and vmpooler services), ADR-0009 (cache with TTL-based invalidation), and ADR-0010 (surface unavailable VMs instead of silently dropping). Update ADR-0006 with cross-references and refresh the docs README index. ADR-0008 context corrected to accurately describe the ABS/vmpooler visibility gap: ABS filters by user but only shows jobs still in its queue; vmpooler filters by token and shows all VMs still alive regardless of ABS state. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix rubocop offenses in inventory.rb (use to_set block), vm_cache.rb (FileUtils.rm_f, class comment), and exe/binv (ternary for pluralization) - Move cache directory from ~/.bolt_dynamic_inventory/cache/ to ~/.config/bolt_dynamic_inventory/cache/ (XDG convention) - Add stderr warning in binv when unavailable VMs are present - Update ADRs 0009 and 0010 to reflect cache path and warning behavior - Regenerate .rubocop_todo.yml for current offense counts Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move from flat cache/ dir to per-provider directories: ~/.config/bolt_dynamic_inventory/<provider>/cache.json ~/.config/bolt_dynamic_inventory/<provider>/inventory.yaml The inventory.yaml is written on every generate call so users can point Bolt at it directly without piping binv output. binv reports the inventory path on stderr for vmpooler provider. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The cache.json now shows `expires_in: "24 hours"` instead of `ttl_seconds: 86400`, and the cached inventory.yaml gets `# created:` and `# expires:` comment headers so users can tell at a glance when the data was fetched and when it goes stale. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Gavin Didrichsen <gavin.didrichsen@gmail.com>
Signed-off-by: Gavin Didrichsen <gavin.didrichsen@gmail.com>
…drichsen/bolt_dynamic_inventory into fix-missing-vmpooler-vms
gavindidrichsen
force-pushed
the
fix-missing-vmpooler-vms
branch
from
July 9, 2026 12:09
5f34c31 to
8a12399
Compare
Signed-off-by: Gavin Didrichsen <gavin.didrichsen@gmail.com>
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.
Summary
The vmpooler provider had a visibility gap: it only queried ABS (
floaty list --active), which filters by user but only shows jobs still in the ABS queue. When ABS reaps a job, the VMs disappear from the query even though they may still be running on vmpooler. This PR fixes that and adds supporting features:e7d3e28): Query both ABS and vmpooler services, merge results by hostname with deduplication494a1ae): File-based cache avoids repeated floaty+nmap queries; invalidates on VM TTL expiry or 24h agef31a709): Stub VmCache in specs to avoid reading real cache files51a6df6): Enrich VMs with TTL from vmpooler lifetime/running fields; surface unreachable VMs in a dedicatedunavailablegroup instead of silently dropping; add--refresh/-rCLI flag63d5120): ADR-0008 (dual-service query), ADR-0009 (caching), ADR-0010 (unavailable group)Test plan
binv --provider=vmpoolerfinds all active VMs including those no longer tracked by ABS🤖 Generated with Claude Code