Skip to content

feat: download and manage terraform version from manifest - #78

Merged
amannocci merged 2 commits into
mainfrom
feat/manifest-engine-version
Sep 19, 2026
Merged

amannocci merged 2 commits into
mainfrom
feat/manifest-engine-version

Conversation

@amannocci

@amannocci amannocci commented Sep 19, 2026

Copy link
Copy Markdown
Member

🧑‍💻Whis the change being made?

Adds manifest version 1.4 with an optional engine block (name: terraform, version: X.Y.Z,
latest or system). A new EngineManager downloads the official Terraform release for the current
OS/arch (Linux, macOS, Windows), 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 remembered for 24 hours, falling back to the last known answer when
offline. plan and apply download distinct versions concurrently before the executor phase, other
commands resolve lazily, and runbooks get the pinned binary first on their PATH. Manifests older
than 1.4, and system, keep the existing PATH lookup.

❓ Why is the change being made?

Terranova only looked up terraform on the PATH, so versions drifted between developers and CI, and
teams 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, invalid
archive, unsupported platform, Windows, latest TTL and offline fallback, concurrent prepare) and
runbook PATH handling, all with a faked HTTP layer. The full suite passes (373 tests) along with
ruff and basedpyright. Not yet exercised against the real releases and checkpoint endpoints, or in
the PyInstaller-built binary.

📚 How has this been documented?

Added a "How to pin the terraform version" section to the README covering the engine block, the
accepted versions, the cache location, the latest lookup and runbook behavior.

🔗 Related Issues

Closes #73

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
@amannocci amannocci self-assigned this Sep 19, 2026
@amannocci
amannocci merged commit bc97b26 into main Sep 19, 2026
14 checks passed
@amannocci
amannocci deleted the feat/manifest-engine-version branch September 19, 2026 09:45
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.

[Feature]: Download and manage Terraform version from manifest

1 participant