Skip to content

Commit d76db70

Browse files
committed
change method name
1 parent 2553102 commit d76db70

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

backend/controllers/projects.go

+8-9
Original file line numberDiff line numberDiff line change
@@ -482,24 +482,23 @@ func (d DiggerController) SetJobStatusForProject(c *gin.Context) {
482482
return
483483
}
484484

485-
err = AutomergePRforBatchIfEnabled(d.GithubClientProvider, batch)
485+
err = CreateTerraformOutputsSummary(d.GithubClientProvider, batch)
486486
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"})
489489
}
490490

491-
err = CreateTerraformPlansSummary(d.GithubClientProvider, batch)
491+
err = AutomergePRforBatchIfEnabled(d.GithubClientProvider, batch)
492492
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"})
495495
}
496496

497497
// return batch summary to client
498498
res, err := batch.MapToJsonStruct()
499499
if err != nil {
500500
log.Printf("Error getting batch details: %v", err)
501501
c.JSON(http.StatusInternalServerError, gin.H{"error": "Error getting batch details"})
502-
503502
}
504503

505504
UpdateCommentsForBatchGroup(d.GithubClientProvider, batch, res.Jobs)
@@ -654,14 +653,14 @@ func GetPrServiceFromBatch(batch *models.DiggerBatch, gh utils.GithubClientProvi
654653
return nil, fmt.Errorf("could not retrieive a service for %v", batch.VCS)
655654
}
656655

657-
func CreateTerraformPlansSummary(gh utils.GithubClientProvider, batch *models.DiggerBatch) error {
656+
func CreateTerraformOutputsSummary(gh utils.GithubClientProvider, batch *models.DiggerBatch) error {
658657
diggerYmlString := batch.DiggerConfig
659658
diggerConfigYml, err := digger_config.LoadDiggerConfigYamlFromString(diggerYmlString)
660659
if err != nil {
661660
log.Printf("Error loading digger config from batch: %v", err)
662661
return fmt.Errorf("error loading digger config from batch: %v", err)
663662
}
664-
663+
665664
config, _, err := digger_config.ConvertDiggerYamlToConfig(diggerConfigYml)
666665

667666
if batch.Status == orchestrator_scheduler.BatchJobSucceeded && config.Reporting.AiSummary == true {

0 commit comments

Comments
 (0)