feat: bind R to terraform init -reconfigure#153
Open
Slevy35 wants to merge 1 commit into
Open
Conversation
Pressing R on a module (or selection of modules / workspaces) now runs `terraform init -reconfigure`, mirroring the existing `i` (init) and `u` (init -upgrade) bindings. Refactors `module.Service.Init` to take an `InitOptions` struct so future init flags can be added without breaking call sites. Capital R was chosen because lowercase `r` is already "retry"; capital `I` is already "toggle task info". Co-authored-by: Cursor <cursoragent@cursor.com>
Author
|
@leg100 what do you think? |
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
Adds a
R(capital) key binding that runsterraform init -reconfigureon the selected module(s) / workspace(s) in the TUI, mirroring the existingi(init) andu(init -upgrade) shortcuts.Common.InitReconfigurebinding in internal/tui/keys/common.go.module.Service.Initrefactored to take anInitOptions{Upgrade, Reconfigure}struct so adding further init flags later won't break call sites.ActionHandlerin internal/tui/actions.go dispatches the three init variants through the same code path.Why
Rand notICapital
Iis already bound to "toggle task info" (localKeys.ToggleInfo), and lowercaseris "retry". CapitalRis unused in the codebase, is the natural mnemonic for "Reconfigure", and follows the existing pattern of capital variants extending lowercase actions. Happy to switch to a different key if you'd prefer.Test plan
go build ./...go vet ./...go test ./internal/module/... ./internal/tui/...TestExplorer_SingleInitReconfigureplus existingTestExplorer_SingleInit/TestExplorer_SingleInitUpgradeall pass with the local mirror (./hacks/setup_mirror.sh).Made with Cursor