@@ -74,6 +74,19 @@ function Validate-Boolean {
74
74
return $boolean_val
75
75
}
76
76
77
+ # Function to set default suggestion mode
78
+ function Validate-Suggestion-Mode {
79
+ param ($suggestion_mode )
80
+ # Convert the input to lowercase
81
+ $suggestion_mode = $suggestion_mode.ToLower ()
82
+
83
+ if ($suggestion_mode -eq " comprehensive" ) {
84
+ return $suggestion_mode
85
+ }
86
+
87
+ return " essential"
88
+ }
89
+
77
90
# Function to validate a mode value i.e. cli or server
78
91
function Validate-Mode {
79
92
param ($mode_val )
@@ -414,7 +427,10 @@ $optional_params_cli = @(
414
427
" enable_default_branch" ,
415
428
" exclude_branches" ,
416
429
" include_source_branches" ,
417
- " include_target_branches" ,
430
+ " include_target_branches"
431
+ " post_as_request_changes" ,
432
+ " suggestion_mode" ,
433
+ " locale" ,
418
434
" exclude_files" ,
419
435
" exclude_draft_pr" ,
420
436
" dependency_check" ,
@@ -433,6 +449,7 @@ $optional_params_cli = @(
433
449
" custom_rules.region_name"
434
450
" custom_rules.bucket_name"
435
451
" custom_rules.aes_key"
452
+ " support_email"
436
453
)
437
454
438
455
# Parameters that are required/optional in mode server
@@ -456,6 +473,9 @@ $optional_params_server = @(
456
473
" exclude_branches" ,
457
474
" include_source_branches" ,
458
475
" include_target_branches" ,
476
+ " post_as_request_changes" ,
477
+ " suggestion_mode" ,
478
+ " locale" ,
459
479
" exclude_files" ,
460
480
" exclude_draft_pr" ,
461
481
" dependency_check" ,
@@ -474,6 +494,7 @@ $optional_params_server = @(
474
494
" custom_rules.bucket_name"
475
495
" custom_rules.aes_key"
476
496
" output_path"
497
+ " support_email"
477
498
)
478
499
479
500
$bee_params = @ (
@@ -542,7 +563,7 @@ foreach ($param in $required_params) {
542
563
foreach ($param in $optional_params ) {
543
564
if ($param -eq " dependency_check.snyk_auth_token" -and $props [" dependency_check" ] -eq " True" ) {
544
565
Ask- For- Param $param $false
545
- } elseif ($param -ne "acceptable_suggestions_enabled" -and $param -ne "dependency_check.snyk_auth_token" -and $param -ne "env" -and $param -ne "cli_path" -and $param -ne "output_path" -and $param -ne "static_analysis_tool" -and $param -ne "linters_feedback" -and $param -ne "secret_scanner_feedback" -and $param -ne "enable_default_branch" -and $param -ne "git.domain" -and $param -ne "review_scope" -and $param -ne "exclude_branches" -and $param -ne "include_source_branches" -and $param -ne "include_target_branches" -and $param -ne "exclude_files" -and $param -ne "exclude_draft_pr" -and $param -ne "cr_event_type" -and $param -ne "posting_to_pr" -and $param -ne "custom_rules.configured_ws_ids" -and $param -ne "custom_rules.aws_access_key_id" -and $param -ne "custom_rules.aws_secret_access_key" -and $param -ne "custom_rules.region_name" -and $param -ne "custom_rules.bucket_name" -and $param -ne "custom_rules.aes_key" -and $param -ne "code_context_config.partial_timeout" -and $param -ne "code_context_config.max_depth" -and $param -ne "code_context_config.kill_timeout_sec") {
566
+ } elseif ($param -ne "acceptable_suggestions_enabled" -and $param -ne "dependency_check.snyk_auth_token" -and $param -ne "env" -and $param -ne "cli_path" -and $param -ne "output_path" -and $param -ne "static_analysis_tool" -and $param -ne "linters_feedback" -and $param -ne "secret_scanner_feedback" -and $param -ne "enable_default_branch" -and $param -ne "git.domain" -and $param -ne "review_scope" -and $param -ne "exclude_branches" -and $param -ne "include_source_branches" -and $param -ne "include_target_branches" -and $param -ne "suggestion_mode" -and $param -ne "locale" -and $param -ne "exclude_files" -and $param -ne "exclude_draft_pr" -and $param -ne "cr_event_type" -and $param -ne "posting_to_pr" -and $param -ne "custom_rules.configured_ws_ids" -and $param -ne "custom_rules.aws_access_key_id" -and $param -ne "custom_rules.aws_secret_access_key" -and $param -ne "custom_rules.region_name" -and $param -ne "custom_rules.bucket_name" -and $param -ne "custom_rules.aes_key" -and $param -ne "code_context_config.partial_timeout" -and $param -ne "code_context_config.max_depth" -and $param -ne "code_context_config.kill_timeout_sec" -and $param -ne "support_email" -and $param -ne "post_as_request_changes") {
546
567
Ask- For- Param $param $false
547
568
}
548
569
}
@@ -571,6 +592,9 @@ foreach ($param in $required_params + $bee_params + $optional_params) {
571
592
} elseif ($param -eq " linters_feedback" ) {
572
593
$validated_boolean = Validate- Boolean $props [$param ]
573
594
$docker_cmd += " --$param =$validated_boolean "
595
+ } elseif ($param -eq " post_as_request_changes" ) {
596
+ $validated_boolean = Validate- Boolean $props [$param ]
597
+ $docker_cmd += " --$param =$validated_boolean "
574
598
} elseif ($param -eq " secret_scanner_feedback" ) {
575
599
$validated_boolean = Validate- Boolean $props [$param ]
576
600
$docker_cmd += " --$param =$validated_boolean "
@@ -589,6 +613,11 @@ foreach ($param in $required_params + $bee_params + $optional_params) {
589
613
$docker_cmd += " --include_source_branches='$ ( $props [$param ]) '"
590
614
} elseif ($param -eq " include_target_branches" ) {
591
615
$docker_cmd += " --include_target_branches='$ ( $props [$param ]) '"
616
+ } elseif ($param -eq " suggestion_mode" ) {
617
+ $validated_suggestion_mode = Validate- Suggestion- Mode $props [$param ]
618
+ $docker_cmd += " --suggestion_mode='$validated_suggestion_mode '"
619
+ } elseif ($param -eq " locale" ) {
620
+ $docker_cmd += " --locale='$ ( $props [$param ]) '"
592
621
} elseif ($param -eq " exclude_files" ) {
593
622
$docker_cmd += " --exclude_files='$ ( $props [$param ]) '"
594
623
} elseif ($param -eq " exclude_draft_pr" ) {
@@ -627,8 +656,9 @@ foreach ($param in $required_params + $bee_params + $optional_params) {
627
656
$crEventType = ValidateCrEventType $props [$param ]
628
657
} elseif ($param -eq " posting_to_pr" ) {
629
658
$postingToPr = ValidatePostingToPr $props [$param ]
630
- }
631
- else {
659
+ } elseif ($param -eq " support_email" ) {
660
+ $docker_cmd += " --support_email='$ ( $props [$param ] ) '"
661
+ } else {
632
662
$docker_cmd += " --$param =$ ( $props [$param ]) "
633
663
}
634
664
}
0 commit comments