@@ -20,7 +20,10 @@ func TestMergeConfigFiles(t *testing.T) {
20
20
globalConfig : nil ,
21
21
repoConfig : nil ,
22
22
expected : & models.Configuration {
23
- SeverityThreshold : parser .DefaultSeverityThreshold ,
23
+ EnablePullRequestReviews : models .Bool (true ),
24
+ EnableIssueDashboards : models .Bool (true ),
25
+ SeverityThreshold : parser .DefaultSeverityThreshold ,
26
+ PriorityThreshold : parser .DefaultPriorityThreshold ,
24
27
},
25
28
},
26
29
{
@@ -81,9 +84,12 @@ func TestMergeConfigFiles(t *testing.T) {
81
84
},
82
85
},
83
86
expected : & models.Configuration {
84
- SeverityThreshold : models .SeverityHigh ,
85
- IgnoreDirs : []string {"dir1" , "dir2" },
86
- IgnorePaths : []string {"path1" , "path2" },
87
+ EnablePullRequestReviews : models .Bool (true ),
88
+ EnableIssueDashboards : models .Bool (true ),
89
+ SeverityThreshold : models .SeverityHigh ,
90
+ PriorityThreshold : models .PriorityMedium ,
91
+ IgnoreDirs : []string {"dir1" , "dir2" },
92
+ IgnorePaths : []string {"path1" , "path2" },
87
93
Code : models.Code {
88
94
AutoFix : & models.AutoFix {
89
95
Enabled : true ,
@@ -199,9 +205,12 @@ func TestMergeConfigFiles(t *testing.T) {
199
205
},
200
206
repoConfig : nil ,
201
207
expected : & models.Configuration {
202
- SeverityThreshold : models .SeverityHigh ,
203
- IgnoreDirs : []string {"dir1" , "dir2" },
204
- IgnorePaths : []string {"path1" , "path2" },
208
+ EnablePullRequestReviews : models .Bool (true ),
209
+ EnableIssueDashboards : models .Bool (true ),
210
+ SeverityThreshold : models .SeverityHigh ,
211
+ PriorityThreshold : models .PriorityMedium ,
212
+ IgnoreDirs : []string {"dir1" , "dir2" },
213
+ IgnorePaths : []string {"path1" , "path2" },
205
214
Code : models.Code {
206
215
AutoFix : & models.AutoFix {
207
216
Enabled : true ,
@@ -264,43 +273,61 @@ func TestMergeConfigFiles(t *testing.T) {
264
273
globalConfig : nil ,
265
274
repoConfig : & models.Configuration {
266
275
SeverityThreshold : "" ,
276
+ PriorityThreshold : "" ,
267
277
},
268
278
expected : & models.Configuration {
269
- SeverityThreshold : parser .DefaultSeverityThreshold ,
279
+ EnablePullRequestReviews : models .Bool (true ),
280
+ EnableIssueDashboards : models .Bool (true ),
281
+ SeverityThreshold : parser .DefaultSeverityThreshold ,
282
+ PriorityThreshold : parser .DefaultPriorityThreshold ,
270
283
},
271
284
},
272
285
{
273
286
name : "global config without severity threshold" ,
274
287
globalConfig : & models.Configuration {
275
288
SeverityThreshold : "" ,
289
+ PriorityThreshold : "" ,
276
290
},
277
291
repoConfig : nil ,
278
292
expected : & models.Configuration {
279
- SeverityThreshold : parser .DefaultSeverityThreshold ,
293
+ EnablePullRequestReviews : models .Bool (true ),
294
+ EnableIssueDashboards : models .Bool (true ),
295
+ SeverityThreshold : parser .DefaultSeverityThreshold ,
296
+ PriorityThreshold : parser .DefaultPriorityThreshold ,
280
297
},
281
298
},
282
299
{
283
300
name : "global and repo config without severity threshold" ,
284
301
globalConfig : & models.Configuration {
285
302
SeverityThreshold : "" ,
303
+ PriorityThreshold : "" ,
286
304
},
287
305
repoConfig : & models.Configuration {
288
306
SeverityThreshold : "" ,
307
+ PriorityThreshold : "" ,
289
308
},
290
309
expected : & models.Configuration {
291
- SeverityThreshold : parser .DefaultSeverityThreshold ,
310
+ EnablePullRequestReviews : models .Bool (true ),
311
+ EnableIssueDashboards : models .Bool (true ),
312
+ SeverityThreshold : parser .DefaultSeverityThreshold ,
313
+ PriorityThreshold : parser .DefaultPriorityThreshold ,
292
314
},
293
315
},
294
316
{
295
317
name : "global and repo config without severity threshold" ,
296
318
globalConfig : & models.Configuration {
297
319
SeverityThreshold : models .SeverityCritical ,
320
+ PriorityThreshold : models .PriorityUrgent ,
298
321
},
299
322
repoConfig : & models.Configuration {
300
323
SeverityThreshold : models .SeverityHigh ,
324
+ PriorityThreshold : models .PriorityImportant ,
301
325
},
302
326
expected : & models.Configuration {
303
- SeverityThreshold : models .SeverityHigh ,
327
+ EnablePullRequestReviews : models .Bool (true ),
328
+ EnableIssueDashboards : models .Bool (true ),
329
+ SeverityThreshold : models .SeverityHigh ,
330
+ PriorityThreshold : models .PriorityImportant ,
304
331
},
305
332
},
306
333
} {
@@ -327,7 +354,10 @@ func TestMergeJira(t *testing.T) {
327
354
},
328
355
repoConfig : nil ,
329
356
expected : & models.Configuration {
330
- SeverityThreshold : parser .DefaultSeverityThreshold ,
357
+ EnablePullRequestReviews : models .Bool (true ),
358
+ EnableIssueDashboards : models .Bool (true ),
359
+ SeverityThreshold : parser .DefaultSeverityThreshold ,
360
+ PriorityThreshold : parser .DefaultPriorityThreshold ,
331
361
Integrations : models.Integrations {
332
362
Jira : & models.Jira {
333
363
ProjectKey : "" ,
@@ -356,7 +386,10 @@ func TestMergeJira(t *testing.T) {
356
386
},
357
387
repoConfig : nil ,
358
388
expected : & models.Configuration {
359
- SeverityThreshold : parser .DefaultSeverityThreshold ,
389
+ EnablePullRequestReviews : models .Bool (true ),
390
+ EnableIssueDashboards : models .Bool (true ),
391
+ SeverityThreshold : parser .DefaultSeverityThreshold ,
392
+ PriorityThreshold : parser .DefaultPriorityThreshold ,
360
393
Integrations : models.Integrations {
361
394
Jira : & models.Jira {
362
395
ProjectKey : "" ,
@@ -395,7 +428,10 @@ func TestMergeJira(t *testing.T) {
395
428
},
396
429
},
397
430
expected : & models.Configuration {
398
- SeverityThreshold : parser .DefaultSeverityThreshold ,
431
+ EnablePullRequestReviews : models .Bool (true ),
432
+ EnableIssueDashboards : models .Bool (true ),
433
+ SeverityThreshold : parser .DefaultSeverityThreshold ,
434
+ PriorityThreshold : parser .DefaultPriorityThreshold ,
399
435
Integrations : models.Integrations {
400
436
Jira : & models.Jira {
401
437
ProjectKey : "" ,
@@ -445,7 +481,10 @@ func TestMergeJira(t *testing.T) {
445
481
},
446
482
},
447
483
expected : & models.Configuration {
448
- SeverityThreshold : parser .DefaultSeverityThreshold ,
484
+ EnablePullRequestReviews : models .Bool (true ),
485
+ EnableIssueDashboards : models .Bool (true ),
486
+ SeverityThreshold : parser .DefaultSeverityThreshold ,
487
+ PriorityThreshold : parser .DefaultPriorityThreshold ,
449
488
Integrations : models.Integrations {
450
489
Jira : & models.Jira {
451
490
ProjectKey : "" ,
@@ -473,7 +512,10 @@ func TestMergeJira(t *testing.T) {
473
512
},
474
513
},
475
514
expected : & models.Configuration {
476
- SeverityThreshold : parser .DefaultSeverityThreshold ,
515
+ EnablePullRequestReviews : models .Bool (true ),
516
+ EnableIssueDashboards : models .Bool (true ),
517
+ SeverityThreshold : parser .DefaultSeverityThreshold ,
518
+ PriorityThreshold : parser .DefaultPriorityThreshold ,
477
519
Integrations : models.Integrations {
478
520
Jira : & models.Jira {
479
521
ProjectKey : "" ,
@@ -495,7 +537,10 @@ func TestMergeJira(t *testing.T) {
495
537
},
496
538
repoConfig : nil ,
497
539
expected : & models.Configuration {
498
- SeverityThreshold : parser .DefaultSeverityThreshold ,
540
+ EnablePullRequestReviews : models .Bool (true ),
541
+ EnableIssueDashboards : models .Bool (true ),
542
+ SeverityThreshold : parser .DefaultSeverityThreshold ,
543
+ PriorityThreshold : parser .DefaultPriorityThreshold ,
499
544
Secrets : models.Secrets {
500
545
CustomPatterns : map [string ]models.SecretsCustomPattern {
501
546
"custom1" : {
@@ -518,7 +563,10 @@ func TestMergeJira(t *testing.T) {
518
563
},
519
564
},
520
565
expected : & models.Configuration {
521
- SeverityThreshold : parser .DefaultSeverityThreshold ,
566
+ EnablePullRequestReviews : models .Bool (true ),
567
+ EnableIssueDashboards : models .Bool (true ),
568
+ SeverityThreshold : parser .DefaultSeverityThreshold ,
569
+ PriorityThreshold : parser .DefaultPriorityThreshold ,
522
570
Secrets : models.Secrets {
523
571
CustomPatterns : map [string ]models.SecretsCustomPattern {
524
572
"custom1" : {
@@ -555,7 +603,10 @@ func TestMergeJira(t *testing.T) {
555
603
},
556
604
},
557
605
expected : & models.Configuration {
558
- SeverityThreshold : parser .DefaultSeverityThreshold ,
606
+ EnablePullRequestReviews : models .Bool (true ),
607
+ EnableIssueDashboards : models .Bool (true ),
608
+ SeverityThreshold : parser .DefaultSeverityThreshold ,
609
+ PriorityThreshold : parser .DefaultPriorityThreshold ,
559
610
Secrets : models.Secrets {
560
611
CustomPatterns : map [string ]models.SecretsCustomPattern {
561
612
"custom1" : {
@@ -593,7 +644,10 @@ func TestMergeJira(t *testing.T) {
593
644
},
594
645
},
595
646
expected : & models.Configuration {
596
- SeverityThreshold : parser .DefaultSeverityThreshold ,
647
+ EnablePullRequestReviews : models .Bool (true ),
648
+ EnableIssueDashboards : models .Bool (true ),
649
+ SeverityThreshold : parser .DefaultSeverityThreshold ,
650
+ PriorityThreshold : parser .DefaultPriorityThreshold ,
597
651
Secrets : models.Secrets {
598
652
CustomPatternsOverrideGlobal : true ,
599
653
CustomPatterns : map [string ]models.SecretsCustomPattern {
0 commit comments