fix: register azure_keyvault provider so it is reachable at runtime - #146
Open
husniadil wants to merge 1 commit into
Open
fix: register azure_keyvault provider so it is reachable at runtime#146husniadil wants to merge 1 commit into
husniadil wants to merge 1 commit into
Conversation
Providers register themselves from init(), so a provider is only usable if internal/cli blank-imports it. azurekeyvault was implemented, tested and documented but never imported, making `kind: azure_keyvault` fail with "unknown provider kind" in every released binary. The e2e tests missed this because they import the provider package directly, proving the provider works but not that it is reachable. The added test asserts registry contents against the documented kinds, which is what actually catches this class of bug. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hmh2p2Bg6kmxxvzpFDW2WL
This was referenced Aug 2, 2026
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.
Problem
kind: azure_keyvaultfails in every released binary:The provider itself is fine. It is implemented in
internal/provider/azurekeyvault/, callsprovider.Register("azure_keyvault", ...), has e2e tests, and is documented inCONFIGURATION.md. What is missing is the blank import ininternal/cli/root.go.Providers register themselves from
init(), so registration is a side effect of the import graph. A provider package that nobody imports never runs itsinit(), and its kind never enters the registry — with no compile-time error to point at it.Why CI did not catch it
The e2e tests import the provider package directly:
That proves the provider works, not that it is reachable from the binary. Those are different claims, and only the second one was broken.
Fix
One blank import in
internal/cli/root.go, plus a regression test that checks what the e2e tests structurally cannot.internal/cli/providers_test.goasserts the registry against the kinds documented inCONFIGURATION.md, in both directions:provider.NewThe second direction keeps the docs honest as providers are added. Both live in package
cli, so they observe the registry after the real import graph has run — which is the only place this bug is visible.Verification
Reverting just the one-line import makes the new test fail with a message that names the cause:
With the import in place,
go test ./internal/cli/passes, and a rebuilt binary reaches the provider's own validation instead of dying in the registry:Note on unrelated failures
internal/cache,internal/provider/vault, andinternal/provider/gcsmcurrently fail onmain, independently of this change (confirmed by stashing this branch's changes and re-running). The first two fail to compile because their tests reference struct fields that no longer exist. Left alone here to keep this PR to one concern — happy to open a separate PR if useful.🤖 Generated with Claude Code
https://claude.ai/code/session_01Hmh2p2Bg6kmxxvzpFDW2WL