Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/update-homerun-dev #208

Merged
merged 1 commit into from
Jan 28, 2025
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
11 changes: 1 addition & 10 deletions cmd/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand All @@ -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{}
Expand All @@ -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]

Expand All @@ -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))]
},
}
Expand Down
6 changes: 6 additions & 0 deletions profiles/homerun.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 1 addition & 3 deletions surveys/surveys.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down