@@ -24,7 +24,7 @@ type ProjectLocation struct {
2424type PatrolConfig struct {
2525 Locations []ProjectLocation
2626 ReportToEmails []string
27- ReportToSlackChannel string
27+ ReportToSlackChannels [] string
2828 ReportToIssue bool
2929 EnableProjectReportTo bool
3030 SilentReport bool
@@ -34,7 +34,7 @@ type PatrolConfig struct {
3434// Options common in both the CLI options & file options
3535type PatrolReportToOpts struct {
3636 Emails * []string `toml:"emails"`
37- SlackChannel * string `toml:"slack-channel "`
37+ SlackChannels * [] string `toml:"slack-channels "`
3838 Issue * bool `toml:"issue"`
3939 EnableProjectReportTo * bool `toml:"enable-project-report-to"`
4040}
@@ -45,8 +45,8 @@ type PatrolReportOpts struct {
4545}
4646
4747type PatrolCommonOpts struct {
48- Urls * []string `toml:"urls "`
49- Report PatrolReportOpts `toml:"report"`
48+ Targets * []string `toml:"targets "`
49+ Report PatrolReportOpts `toml:"report"`
5050}
5151
5252// Options only available from CLI configuration
@@ -86,17 +86,17 @@ func GetPatrolConfiguration(cliOpts PatrolCLIOpts) (config PatrolConfig, err err
8686}
8787
8888func mergeConfigs (cliOpts PatrolCLIOpts , fileOpts PatrolFileOpts ) (config PatrolConfig , err error ) {
89- locations := getCliOrFileOption (cliOpts .Urls , fileOpts .Urls , []string {})
90- parsedLocations , err := parseUrls (locations )
89+ locations := getCliOrFileOption (cliOpts .Targets , fileOpts .Targets , []string {})
90+ parsedLocations , err := parseTargets (locations )
9191 if err != nil {
92- return config , errors .Join (errors .New ("could not parse urls from CLI options" ), err )
92+ return config , errors .Join (errors .New ("could not parse targets from CLI options" ), err )
9393 }
9494
9595 config = PatrolConfig {
9696 Locations : parsedLocations ,
9797 ReportToIssue : getCliOrFileOption (cliOpts .Report .To .Issue , fileOpts .Report .To .Issue , false ),
9898 ReportToEmails : getCliOrFileOption (cliOpts .Report .To .Emails , fileOpts .Report .To .Emails , []string {}),
99- ReportToSlackChannel : getCliOrFileOption (cliOpts .Report .To .SlackChannel , fileOpts .Report .To .SlackChannel , "" ),
99+ ReportToSlackChannels : getCliOrFileOption (cliOpts .Report .To .SlackChannels , fileOpts .Report .To .SlackChannels , [] string {} ),
100100 EnableProjectReportTo : getCliOrFileOption (cliOpts .Report .To .EnableProjectReportTo , fileOpts .Report .To .EnableProjectReportTo , false ),
101101 SilentReport : getCliOrFileOption (cliOpts .Report .SilentReport , fileOpts .Report .SilentReport , false ),
102102 Verbose : cliOpts .Verbose ,
@@ -118,16 +118,16 @@ func getCliOrFileOption[T interface{}](valueA *T, valueB *T, def T) (r T) {
118118 return def
119119}
120120
121- func parseUrls ( uris []string ) ([]ProjectLocation , error ) {
122- locations := make ([]ProjectLocation , len (uris ))
123- for i , uri := range uris {
124- parsed , err := url .Parse (uri )
121+ func parseTargets ( targets []string ) ([]ProjectLocation , error ) {
122+ locations := make ([]ProjectLocation , len (targets ))
123+ for i , t := range targets {
124+ parsed , err := url .Parse (t )
125125 if err != nil || parsed == nil {
126126 return nil , errors .Join (fmt .Errorf ("failed to parse uri" ), err )
127127 }
128128
129129 if ! parsed .IsAbs () {
130- return nil , fmt .Errorf ("url missing platform scheme %v" , uri )
130+ return nil , fmt .Errorf ("target missing platform scheme %v" , t )
131131 }
132132
133133 if parsed .Scheme == string (Github ) {
@@ -138,7 +138,7 @@ func parseUrls(uris []string) ([]ProjectLocation, error) {
138138
139139 path , err := url .JoinPath (parsed .Host , parsed .Path )
140140 if err != nil {
141- return nil , fmt .Errorf ("failed to join host and path %v" , uri )
141+ return nil , fmt .Errorf ("failed to join host and path %v" , t )
142142 }
143143
144144 locations [i ] = ProjectLocation {
0 commit comments