File tree Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Expand file tree Collapse file tree 2 files changed +46
-0
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,22 @@ func MergeConfigFiles(
50
50
if config .Integrations .Jira == nil {
51
51
config .Integrations .Jira = extraConfig .Integrations .Jira
52
52
} else {
53
+ if extraConfig .Integrations .Jira .ProjectKey != "" {
54
+ config .Integrations .Jira .ProjectKey = extraConfig .Integrations .Jira .ProjectKey
55
+ }
56
+ if extraConfig .Integrations .Jira .IssueType != "" {
57
+ config .Integrations .Jira .IssueType = extraConfig .Integrations .Jira .IssueType
58
+ }
59
+ if extraConfig .Integrations .Jira .OnFixTransition != "" {
60
+ config .Integrations .Jira .OnFixTransition = extraConfig .Integrations .Jira .OnFixTransition
61
+ }
62
+ if extraConfig .Integrations .Jira .Disabled {
63
+ config .Integrations .Jira .Disabled = extraConfig .Integrations .Jira .Disabled
64
+ }
65
+ if extraConfig .Integrations .Jira .SeverityThreshold != "" {
66
+ config .Integrations .Jira .SeverityThreshold = extraConfig .Integrations .Jira .SeverityThreshold
67
+ }
68
+
53
69
if extraConfig .Integrations .Jira .Priorities != nil {
54
70
config .Integrations .Jira .Priorities = extraConfig .Integrations .Jira .Priorities
55
71
}
Original file line number Diff line number Diff line change @@ -524,6 +524,36 @@ func TestMergeJira(t *testing.T) {
524
524
},
525
525
},
526
526
},
527
+ {
528
+ name : "Jira repo config with project key overriding" ,
529
+ globalConfig : & models.Configuration {
530
+ Integrations : models.Integrations {
531
+ Jira : & models.Jira {
532
+ ProjectKey : "projectkey1" ,
533
+ IssueType : "issuetype1" ,
534
+ },
535
+ },
536
+ },
537
+ repoConfig : & models.Configuration {
538
+ Integrations : models.Integrations {
539
+ Jira : & models.Jira {
540
+ ProjectKey : "projectkey2" ,
541
+ },
542
+ },
543
+ },
544
+ expected : & models.Configuration {
545
+ EnablePullRequestReviews : models .Bool (true ),
546
+ EnableIssueDashboards : models .Bool (true ),
547
+ SeverityThreshold : parser .DefaultSeverityThreshold ,
548
+ PriorityThreshold : parser .DefaultPriorityThreshold ,
549
+ Integrations : models.Integrations {
550
+ Jira : & models.Jira {
551
+ ProjectKey : "projectkey2" ,
552
+ IssueType : "issuetype1" ,
553
+ },
554
+ },
555
+ },
556
+ },
527
557
{
528
558
name : "secrets custom patterns global" ,
529
559
globalConfig : & models.Configuration {
You can’t perform that action at this time.
0 commit comments