Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/cli/add_interactive_orchestrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/cli/add_interactive_secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions pkg/cli/add_interactive_secrets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down
6 changes: 3 additions & 3 deletions pkg/cli/add_interactive_workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/add_interactive_workflow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading