|
6 | 6 | "github.com/diggerhq/digger/backend/config" |
7 | 7 | "github.com/diggerhq/digger/backend/models" |
8 | 8 | "github.com/diggerhq/digger/backend/utils" |
9 | | - comment_updater "github.com/diggerhq/digger/libs/comment_utils/summary" |
10 | 9 | orchestrator_scheduler "github.com/diggerhq/digger/libs/scheduler" |
11 | 10 | "github.com/diggerhq/digger/libs/spec" |
12 | 11 | "github.com/google/go-github/v61/github" |
@@ -135,14 +134,13 @@ func TriggerJob(gh utils.GithubClientProvider, ciBackend ci_backends.CiBackend, |
135 | 134 | return err |
136 | 135 | } |
137 | 136 |
|
138 | | - go UpdateWorkflowUrlForJob(job, ciBackend, spec, gh) |
| 137 | + go UpdateWorkflowUrlForJob(job, ciBackend, spec) |
139 | 138 |
|
140 | 139 | return nil |
141 | 140 | } |
142 | 141 |
|
143 | 142 | // This is meant to run asyncronously since it queries for job url |
144 | | -// in case of github we don't get it immediately but with some delay |
145 | | -func UpdateWorkflowUrlForJob(job *models.DiggerJob, ciBackend ci_backends.CiBackend, spec *spec.Spec, gh utils.GithubClientProvider) { |
| 143 | +func UpdateWorkflowUrlForJob(job *models.DiggerJob, ciBackend ci_backends.CiBackend, spec *spec.Spec) { |
146 | 144 | defer func() { |
147 | 145 | if r := recover(); r != nil { |
148 | 146 | log.Printf("Recovered from panic in UpdateWorkflowUrlForJob handler: %v", r) |
@@ -176,27 +174,10 @@ func UpdateWorkflowUrlForJob(job *models.DiggerJob, ciBackend ci_backends.CiBack |
176 | 174 | log.Printf("DiggerJobId %v: successfully updated workflow run url to: %v for DiggerJobID: %v", job.DiggerJobID, workflowUrl, job.DiggerJobID) |
177 | 175 | } |
178 | 176 |
|
179 | | - // refresh the batch from DB to get accurate results |
180 | | - batch, err = models.DB.GetDiggerBatch(&job.Batch.ID) |
181 | | - if err != nil { |
182 | | - log.Printf("DiggerJobId %v: Error getting batch: %v", job.DiggerJobID, err) |
183 | | - continue |
184 | | - } |
185 | | - res, err := batch.MapToJsonStruct() |
186 | | - if err != nil { |
187 | | - log.Printf("DiggerJobId %v: Error getting batch details: %v", job.DiggerJobID, err) |
188 | | - continue |
189 | | - } |
190 | | - // TODO: make this abstract and extracting the right "prService" based on VCS |
191 | | - client, _, err := utils.GetGithubService(gh, batch.GithubInstallationId, spec.VCS.RepoFullname, spec.VCS.RepoOwner, spec.VCS.RepoName) |
192 | | - err = comment_updater.BasicCommentUpdater{}.UpdateComment(res.Jobs, *spec.Job.PullRequestNumber, client, spec.CommentId) |
193 | | - if err != nil { |
194 | | - log.Printf("diggerJobId: %v error whilst updating comment %v", job.DiggerJobID, err) |
195 | | - continue |
196 | | - } |
197 | 177 | return |
198 | 178 | } |
199 | 179 | } |
200 | 180 | } |
201 | 181 |
|
| 182 | + // if we get to here its highly likely that the workflow job entirely failed to start for some reason |
202 | 183 | } |
0 commit comments