diff --git a/cmd/push.go b/cmd/push.go index bb4dc7a..9c800e6 100644 --- a/cmd/push.go +++ b/cmd/push.go @@ -154,8 +154,6 @@ var pushCmd = &cobra.Command{ aliases := surveys.RenderAliases(demo.Aliases, values) values = sthingsBase.MergeMaps(aliases, values) - fmt.Println(values) - // SET VALUES // LOOP OVER AUTHORS @@ -182,7 +180,6 @@ var pushCmd = &cobra.Command{ return input + " Hello from push" }, "random": func(input []string) string { - rand.Seed(time.Now().UnixNano()) return input[rand.Intn(len(input))] }, "timestamp": func() string { @@ -196,7 +193,6 @@ var pushCmd = &cobra.Command{ return template[severity][verb] }, "randomUsecase": func(system string, usecases map[string][]string) string { - rand.Seed(time.Now().UnixNano()) systemUsecases := usecases[system] allUsecaseNames := []string{} @@ -210,8 +206,6 @@ var pushCmd = &cobra.Command{ return allUsecaseNames[rand.Intn(len(allUsecaseNames))] }, "getUsecaseVerb": func(usecaseName string, system string, usecases map[string][]string) string { - rand.Seed(time.Now().UnixNano()) - verb := "Verb not found for usecase: " + usecaseName systemUsecases := usecases[system] @@ -220,21 +214,18 @@ var pushCmd = &cobra.Command{ usecasesplit := strings.Split(usecase, ":") if usecasesplit[0] == usecaseName { verb = usecasesplit[1] + break // Exit the loop once the verb is found } } return verb }, "getObject": func(usecaseName string, objects map[string][]string) string { - rand.Seed(time.Now().UnixNano()) allObjects := objects[usecaseName] - return allObjects[rand.Intn(len(allObjects))] }, "getArtifact": func(usecaseName string, objects map[string][]string) string { - rand.Seed(time.Now().UnixNano()) allObjects := objects[usecaseName] - return allObjects[rand.Intn(len(allObjects))] }, } diff --git a/profiles/homerun.yaml b/profiles/homerun.yaml index 1f5b618..469acd1 100644 --- a/profiles/homerun.yaml +++ b/profiles/homerun.yaml @@ -55,6 +55,12 @@ urls: - "https://example.com/src/utils/image_upload.js" - "https://example.com/src/ui/theme.css" - "https://example.com/src/core/file_handler.go" + MergeRequest: + - "https://example.com/README.md" + - "https://example.com/nginx/v21" + - "https://example.com/docs/contributing.md" + - "https://example.com/tests/api/authentication_test.go" + - "https://example.com/package.json" PullRequest: - "https://example.com/README.md" - "https://example.com/nginx/v21" diff --git a/surveys/surveys.go b/surveys/surveys.go index 5cd8c01..51a931e 100644 --- a/surveys/surveys.go +++ b/surveys/surveys.go @@ -258,7 +258,7 @@ func RunSurvey(profilePath, surveyKey string) (surveyValues map[string]interface // IF SURVEY EXISTS, RUN IT if len(preSurvey) > 0 { - surveyQuestions, answers, err := BuildSurvey(preSurvey) + surveyQuestions, _, err := BuildSurvey(preSurvey) if err != nil { log.Fatalf("ERROR BUILDING SURVEY: %v", err) @@ -271,8 +271,6 @@ func RunSurvey(profilePath, surveyKey string) (surveyValues map[string]interface log.Fatalf("ERROR RUNNING SURVEY: %v", err) } - fmt.Println("RANDPM SELECTION!!: ", answers) - // SET ANWERS TO ALL VALUES for _, question := range preSurvey { surveyValues[question.Name] = question.Default