@@ -482,24 +482,23 @@ func (d DiggerController) SetJobStatusForProject(c *gin.Context) {
482
482
return
483
483
}
484
484
485
- err = AutomergePRforBatchIfEnabled (d .GithubClientProvider , batch )
485
+ err = CreateTerraformOutputsSummary (d .GithubClientProvider , batch )
486
486
if err != nil {
487
- log .Printf ("Error merging PR with automerge option : %v" , err )
488
- c .JSON (http .StatusInternalServerError , gin.H {"error" : "Error merging PR with automerge option " })
487
+ log .Printf ("could not generate terraform plans summary : %v" , err )
488
+ c .JSON (http .StatusInternalServerError , gin.H {"error" : "could not generate terraform plans summary " })
489
489
}
490
490
491
- err = CreateTerraformPlansSummary (d .GithubClientProvider , batch )
491
+ err = AutomergePRforBatchIfEnabled (d .GithubClientProvider , batch )
492
492
if err != nil {
493
- log .Printf ("could not generate terraform plans summary : %v" , err )
494
- c .JSON (http .StatusInternalServerError , gin.H {"error" : "could not generate terraform plans summary " })
493
+ log .Printf ("Error merging PR with automerge option : %v" , err )
494
+ c .JSON (http .StatusInternalServerError , gin.H {"error" : "Error merging PR with automerge option " })
495
495
}
496
496
497
497
// return batch summary to client
498
498
res , err := batch .MapToJsonStruct ()
499
499
if err != nil {
500
500
log .Printf ("Error getting batch details: %v" , err )
501
501
c .JSON (http .StatusInternalServerError , gin.H {"error" : "Error getting batch details" })
502
-
503
502
}
504
503
505
504
UpdateCommentsForBatchGroup (d .GithubClientProvider , batch , res .Jobs )
@@ -654,14 +653,14 @@ func GetPrServiceFromBatch(batch *models.DiggerBatch, gh utils.GithubClientProvi
654
653
return nil , fmt .Errorf ("could not retrieive a service for %v" , batch .VCS )
655
654
}
656
655
657
- func CreateTerraformPlansSummary (gh utils.GithubClientProvider , batch * models.DiggerBatch ) error {
656
+ func CreateTerraformOutputsSummary (gh utils.GithubClientProvider , batch * models.DiggerBatch ) error {
658
657
diggerYmlString := batch .DiggerConfig
659
658
diggerConfigYml , err := digger_config .LoadDiggerConfigYamlFromString (diggerYmlString )
660
659
if err != nil {
661
660
log .Printf ("Error loading digger config from batch: %v" , err )
662
661
return fmt .Errorf ("error loading digger config from batch: %v" , err )
663
662
}
664
-
663
+
665
664
config , _ , err := digger_config .ConvertDiggerYamlToConfig (diggerConfigYml )
666
665
667
666
if batch .Status == orchestrator_scheduler .BatchJobSucceeded && config .Reporting .AiSummary == true {
0 commit comments