@@ -193,18 +193,6 @@ func handleIssueCommentEvent(gh utils.GithubClientProvider, payload *github.Issu
193
193
slog .Debug ("Added eyes reaction to comment" , "commentId" , commentIdStr )
194
194
}
195
195
196
- if ! config .AllowDraftPRs && isDraft {
197
- slog .Info ("Draft PRs are disabled, skipping" ,
198
- "issueNumber" , issueNumber ,
199
- "isDraft" , isDraft ,
200
- )
201
- if os .Getenv ("DIGGER_REPORT_BEFORE_LOADING_CONFIG" ) == "1" {
202
- // This one is for aggregate reporting
203
- commentReporterManager .UpdateComment (":construction_worker: Ignoring event as it is a draft and draft PRs are configured to be ignored" )
204
- }
205
- return nil
206
- }
207
-
208
196
commentReporter , err := commentReporterManager .UpdateComment (":construction_worker: Digger starting.... config loaded successfully" )
209
197
if err != nil {
210
198
slog .Error ("Error initializing comment reporter" ,
@@ -339,6 +327,35 @@ func handleIssueCommentEvent(gh utils.GithubClientProvider, payload *github.Issu
339
327
return fmt .Errorf ("error processing event" )
340
328
}
341
329
330
+ if ! config .AllowDraftPRs && isDraft {
331
+ slog .Info ("Draft PRs are disabled, skipping" ,
332
+ "issueNumber" , issueNumber ,
333
+ "isDraft" , isDraft ,
334
+ )
335
+
336
+ if os .Getenv ("DIGGER_REPORT_BEFORE_LOADING_CONFIG" ) == "1" {
337
+ // This one is for aggregate reporting
338
+ commentReporterManager .UpdateComment (":construction_worker: Ignoring event as it is a draft and draft PRs are configured to be ignored" )
339
+ }
340
+
341
+ // special case to unlock all locks aquired by this PR
342
+ if * diggerCommand == scheduler .DiggerCommandUnlock {
343
+ err := models .DB .DeleteAllLocksAcquiredByPR (issueNumber , repoFullName , orgId )
344
+ if err != nil {
345
+ slog .Error ("Failed to delete locks" ,
346
+ "prNumber" , issueNumber ,
347
+ "command" , * diggerCommand ,
348
+ "error" , err ,
349
+ )
350
+ commentReporterManager .UpdateComment (fmt .Sprintf (":x: Failed to delete locks: %v" , err ))
351
+ return fmt .Errorf ("failed to delete locks: %v" , err )
352
+ }
353
+ commentReporterManager .UpdateComment (fmt .Sprintf (":white_check_mark: Command %v completed successfully" , * diggerCommand ))
354
+ }
355
+
356
+ return nil
357
+ }
358
+
342
359
// perform unlocking in backend
343
360
if config .PrLocks {
344
361
slog .Info ("Processing PR locks for impacted projects" ,
0 commit comments