Skip to content

Commit f07511c

Browse files
authored
report no projects impacted when REPORT_BEFORE_LOADING_CONFIG is set (#2099)
1 parent d1d3952 commit f07511c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

backend/controllers/github.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ func handlePullRequestEvent(gh utils.GithubClientProvider, payload *github.PullR
541541
}
542542

543543
commentReporterManager := utils.InitCommentReporterManager(ghService, prNumber)
544-
if _, exists := os.LookupEnv("DIGGER_REPORT_BEFORE_LOADING_CONFIG"); exists {
544+
if os.Getenv("DIGGER_REPORT_BEFORE_LOADING_CONFIG") == "1" {
545545
_, err := commentReporterManager.UpdateComment(":construction_worker: Digger starting....")
546546
if err != nil {
547547
slog.Error("Error initializing comment reporter",
@@ -597,7 +597,10 @@ func handlePullRequestEvent(gh utils.GithubClientProvider, payload *github.PullR
597597
"prNumber", prNumber,
598598
"repoFullName", repoFullName,
599599
)
600-
// This one is for aggregate reporting
600+
if os.Getenv("DIGGER_REPORT_BEFORE_LOADING_CONFIG") == "1" {
601+
// This one is for aggregate reporting
602+
commentReporterManager.UpdateComment(":construction_worker: No projects impacted")
603+
}
601604
err = utils.SetPRStatusForJobs(ghService, prNumber, jobsForImpactedProjects)
602605
return nil
603606
}
@@ -1363,7 +1366,7 @@ func handleIssueCommentEvent(gh utils.GithubClientProvider, payload *github.Issu
13631366
}
13641367

13651368
commentReporterManager := utils.InitCommentReporterManager(ghService, issueNumber)
1366-
if _, exists := os.LookupEnv("DIGGER_REPORT_BEFORE_LOADING_CONFIG"); exists {
1369+
if os.Getenv("DIGGER_REPORT_BEFORE_LOADING_CONFIG") == "1" {
13671370
_, err := commentReporterManager.UpdateComment(":construction_worker: Digger starting....")
13681371
if err != nil {
13691372
slog.Error("Error initializing comment reporter",

0 commit comments

Comments
 (0)