Skip to content

feat: add automatic inventory bootstrapping from example template#128

Merged
l50 merged 1 commit into
mainfrom
feat/pre-flight-improvements
Apr 20, 2026
Merged

feat: add automatic inventory bootstrapping from example template#128
l50 merged 1 commit into
mainfrom
feat/pre-flight-improvements

Conversation

@l50
Copy link
Copy Markdown
Contributor

@l50 l50 commented Apr 20, 2026

Key Changes:

  • Introduced bootstrap logic to auto-create inventory files from .example
  • Updated provision and inventory commands to use new bootstrap logic
  • Added comprehensive tests for inventory bootstrapping scenarios

Added:

  • Automatic inventory bootstrapping - Implemented bootstrapInventory function
    to copy an .example inventory file to the target path if missing, ensuring
    commands work without manual setup
  • Unit tests for inventory bootstrapping - Added tests to cover cases where the
    inventory is missing, already exists, or neither file is present

Changed:

  • Provision and inventory sync workflows - Updated to call
    bootstrapInventory before proceeding, enabling seamless operation even if
    the inventory file does not yet exist
  • Improved error handling - Now returns a clear error when neither inventory nor
    example template exists, instead of a generic file-not-found error

Removed:

  • Manual inventory file existence check - Replaced legacy inventory file check
    with the new bootstrapping mechanism for improved user experience

**Added:**

- Introduced `bootstrapInventory` helper to copy a `.example` inventory file to
  the target path if missing, enabling seamless setup for new environments
- Added unit tests for `bootstrapInventory` covering copy, no-op, and error
  scenarios (`bootstrap_test.go`)

**Changed:**

- Updated `runInventorySync` and `ensureInventorySynced` to invoke
  `bootstrapInventory`, ensuring inventory exists before proceeding and
  improving user experience for fresh setups
@l50 l50 merged commit 89c8a08 into main Apr 20, 2026
8 checks passed
@l50 l50 deleted the feat/pre-flight-improvements branch April 20, 2026 16:39
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