diff --git a/pkg/cli/add_interactive_orchestrator.go b/pkg/cli/add_interactive_orchestrator.go index d83f931fd77..a38b6f631f8 100644 --- a/pkg/cli/add_interactive_orchestrator.go +++ b/pkg/cli/add_interactive_orchestrator.go @@ -135,7 +135,7 @@ func RunAddInteractive(ctx context.Context, workflowSpecs []string, verbose bool // Step 8: Confirm with user var secretName, secretValue string if config.hasWriteAccess && !config.SkipSecret { - secretName, secretValue, err = config.getSecretInfo() + secretName, secretValue, err = config.resolveEngineApiKeyCredential() if err != nil { return err } diff --git a/pkg/cli/add_interactive_secrets.go b/pkg/cli/add_interactive_secrets.go index fb768e347b7..fb40e19ac0b 100644 --- a/pkg/cli/add_interactive_secrets.go +++ b/pkg/cli/add_interactive_secrets.go @@ -67,9 +67,9 @@ func parseSecretNames(output []byte) []string { return names } -// getSecretInfo returns the secret name and value based on the selected engine +// resolveEngineApiKeyCredential returns the secret name and value based on the selected engine // Returns empty value if the secret already exists in the repository -func (c *AddInteractiveConfig) getSecretInfo() (name string, value string, err error) { +func (c *AddInteractiveConfig) resolveEngineApiKeyCredential() (name string, value string, err error) { addInteractiveLog.Printf("Getting secret info for engine: %s", c.EngineOverride) secretName, secretValue, existsInRepo, err := GetEngineSecretNameAndValue(c.EngineOverride, c.existingSecrets) diff --git a/pkg/cli/add_interactive_secrets_test.go b/pkg/cli/add_interactive_secrets_test.go index 6dc048168ad..f68a9bfec67 100644 --- a/pkg/cli/add_interactive_secrets_test.go +++ b/pkg/cli/add_interactive_secrets_test.go @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/require" ) -func TestAddInteractiveConfig_getSecretInfo(t *testing.T) { +func TestAddInteractiveConfig_resolveEngineApiKeyCredential(t *testing.T) { tests := []struct { name string engineOverride string @@ -79,7 +79,7 @@ func TestAddInteractiveConfig_getSecretInfo(t *testing.T) { config.existingSecrets = make(map[string]bool) } - name, value, err := config.getSecretInfo() + name, value, err := config.resolveEngineApiKeyCredential() if tt.wantErr { assert.Error(t, err, "Expected error but got none") diff --git a/pkg/cli/add_interactive_workflow.go b/pkg/cli/add_interactive_workflow.go index afc991e94bd..de2bfc732fc 100644 --- a/pkg/cli/add_interactive_workflow.go +++ b/pkg/cli/add_interactive_workflow.go @@ -49,7 +49,7 @@ func (c *AddInteractiveConfig) checkStatusAndOfferRun(ctx context.Context) error fmt.Fprintf(os.Stderr, "Checking workflow status (attempt %d/5) for: %s\n", i+1, parsed.WorkflowName) } // Check if workflow is in status - statuses, err := getWorkflowStatuses(parsed.WorkflowName, c.RepoOverride, c.Verbose) + statuses, err := findWorkflowsByFilenamePattern(parsed.WorkflowName, c.RepoOverride, c.Verbose) if err != nil { if c.Verbose { fmt.Fprintf(os.Stderr, "Status check error: %v\n", err) @@ -147,9 +147,9 @@ func (c *AddInteractiveConfig) checkStatusAndOfferRun(ctx context.Context) error return nil } -// getWorkflowStatuses is a helper to get workflow statuses for a pattern +// findWorkflowsByFilenamePattern is a helper to find workflows registered in GitHub by filename pattern. // The pattern is matched against the workflow filename (basename without extension) -func getWorkflowStatuses(pattern, repoOverride string, verbose bool) ([]WorkflowStatus, error) { +func findWorkflowsByFilenamePattern(pattern, repoOverride string, verbose bool) ([]WorkflowStatus, error) { // This would normally call StatusWorkflows but we need just a simple check // For now, we'll use the gh CLI directly // Request 'path' field so we can match by filename, not by workflow name diff --git a/pkg/cli/add_interactive_workflow_test.go b/pkg/cli/add_interactive_workflow_test.go index c91bdcfc2aa..e5665c82f8d 100644 --- a/pkg/cli/add_interactive_workflow_test.go +++ b/pkg/cli/add_interactive_workflow_test.go @@ -42,7 +42,7 @@ func TestGetWorkflowStatuses(t *testing.T) { t.Run(tt.name, func(t *testing.T) { // This function calls gh CLI, so it will likely error in tests // We just verify it doesn't panic - statuses, err := getWorkflowStatuses(tt.pattern, tt.repoOverride, tt.verbose) + statuses, err := findWorkflowsByFilenamePattern(tt.pattern, tt.repoOverride, tt.verbose) // Either succeeds or fails gracefully, but shouldn't panic // Note: statuses may be nil even when err is nil (no workflows found)