feat: download and manage terraform version from manifest - #78
Merged
Merged
Conversation
Add manifest version 1.4 with an optional `engine` block (name `terraform`, version `X.Y.Z`, `latest` or `system`). - EngineManager downloads the official release for the current OS/arch, verifies its SHA-256 checksum and caches it in ~/.terranova/engines/terraform/<version>/ with an atomic install. - `latest` is looked up on the HashiCorp checkpoint API and cached for 24h, falling back to the stale answer when offline. - plan/apply pre-download distinct versions concurrently before the executor phase; other commands resolve lazily. - Runbooks get the pinned binary first on their PATH. - Older manifests and `system` keep the PATH lookup. Closes #73
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.
🧑💻Whis the change being made?
Adds manifest version
1.4with an optionalengineblock (name: terraform,version:X.Y.Z,latestorsystem). A newEngineManagerdownloads the official Terraform release for the currentOS/arch (Linux, macOS, Windows), verifies its SHA-256 checksum and caches it in
~/.terranova/engines/terraform/<version>/with an atomic install.latestis looked up on theHashiCorp checkpoint API and remembered for 24 hours, falling back to the last known answer when
offline.
planandapplydownload distinct versions concurrently before the executor phase, othercommands resolve lazily, and runbooks get the pinned binary first on their
PATH. Manifests olderthan 1.4, and
system, keep the existingPATHlookup.❓ Why is the change being made?
Terranova only looked up
terraformon thePATH, so versions drifted between developers and CI, andteams had to manage asdf or tfenv separately. Pinning the version per resource group in the manifest
makes runs reproducible without changing older manifests.
✅ How has this been tested?
Added unit tests for the schema,
EngineManager(download, cache hit, checksum mismatch, invalidarchive, unsupported platform, Windows,
latestTTL and offline fallback, concurrentprepare) andrunbook
PATHhandling, all with a faked HTTP layer. The full suite passes (373 tests) along withruffandbasedpyright. Not yet exercised against the real releases and checkpoint endpoints, or inthe PyInstaller-built binary.
📚 How has this been documented?
Added a "How to pin the terraform version" section to the README covering the
engineblock, theaccepted versions, the cache location, the
latestlookup and runbook behavior.🔗 Related Issues
Closes #73