Skip to content

Commit 72a98fb

Browse files
committed
remove commented out code, ensure code parameter handled gracefully
1 parent 88424cb commit 72a98fb

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

backend/controllers/github_callback.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ func (d DiggerController) GithubAppCallbackPage(c *gin.Context) {
3131
code := ""
3232
if codeExists && len(codeParams) > 0 && len(codeParams[0]) > 0 {
3333
code = codeParams[0]
34+
} else {
35+
slog.Debug("No code parameter found, probably a setup update, going to return success since we are relying on webhooks now")
36+
c.HTML(http.StatusOK, "github_success.tmpl", gin.H{})
37+
return
3438
}
3539

3640
appId := c.Request.URL.Query().Get("state")

backend/controllers/projects.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,7 +1026,6 @@ func (d DiggerController) SetJobStatusForProject(c *gin.Context) {
10261026
c.JSON(http.StatusInternalServerError, gin.H{"error": "Error getting refreshed batch"})
10271027
return
10281028
}
1029-
//err = UpdateCheckStatusForBatch(d.GithubClientProvider, refreshedBatch)
10301029
slog.Debug("Attempting to update GitHub Check Run for batch",
10311030
"batchId", batch.ID,
10321031
"checkRunId", refreshedBatch.CheckRunId,
@@ -1056,7 +1055,6 @@ func (d DiggerController) SetJobStatusForProject(c *gin.Context) {
10561055
c.JSON(http.StatusInternalServerError, gin.H{"error": "Error getting refreshed job"})
10571056
return
10581057
}
1059-
//err = UpdateCommitStatusForJob(d.GithubClientProvider, refreshedJob)
10601058
slog.Debug("Attempting to update GitHub Check Run for job",
10611059
"jobId", jobId,
10621060
"checkRunId", refreshedJob.CheckRunId,

backend/models/scheduler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ func GetCheckRunConclusionForJob(job *DiggerJob) (string, error) {
258258
case orchestrator_scheduler.DiggerJobFailed:
259259
return "failure", nil
260260
}
261-
slog.Error("Unknown job status in GetCheckRunConclusionForJob - this will cause GitHub API 422 error",
261+
slog.Error("Unknown job status in GetCheckRunConclusionForJob - this will cause GitHub API 422 error",
262262
"jobId", job.DiggerJobID,
263263
"jobStatus", job.Status,
264264
"jobStatusInt", int(job.Status),

0 commit comments

Comments
 (0)