@@ -263,6 +263,24 @@ func AddTestPullRequestTask(doer *user_model.User, repoID int64, branch string,
263
263
return
264
264
}
265
265
266
+ for _ , pr := range prs {
267
+ log .Trace ("Updating PR[%d]: composing new test task" , pr .ID )
268
+ if pr .Flow == issues_model .PullRequestFlowGithub {
269
+ if err := PushToBaseRepo (ctx , pr ); err != nil {
270
+ log .Error ("PushToBaseRepo: %v" , err )
271
+ continue
272
+ }
273
+ } else {
274
+ continue
275
+ }
276
+
277
+ AddToTaskQueue (pr )
278
+ comment , err := CreatePushPullComment (ctx , doer , pr , oldCommitID , newCommitID )
279
+ if err == nil && comment != nil {
280
+ notification .NotifyPullRequestPushCommits (ctx , doer , pr , comment )
281
+ }
282
+ }
283
+
266
284
if isSync {
267
285
requests := issues_model .PullRequestList (prs )
268
286
if err = requests .LoadAttributes (); err != nil {
@@ -304,24 +322,6 @@ func AddTestPullRequestTask(doer *user_model.User, repoID int64, branch string,
304
322
}
305
323
}
306
324
307
- for _ , pr := range prs {
308
- log .Trace ("Updating PR[%d]: composing new test task" , pr .ID )
309
- if pr .Flow == issues_model .PullRequestFlowGithub {
310
- if err := PushToBaseRepo (ctx , pr ); err != nil {
311
- log .Error ("PushToBaseRepo: %v" , err )
312
- continue
313
- }
314
- } else {
315
- continue
316
- }
317
-
318
- AddToTaskQueue (pr )
319
- comment , err := CreatePushPullComment (ctx , doer , pr , oldCommitID , newCommitID )
320
- if err == nil && comment != nil {
321
- notification .NotifyPullRequestPushCommits (ctx , doer , pr , comment )
322
- }
323
- }
324
-
325
325
log .Trace ("AddTestPullRequestTask [base_repo_id: %d, base_branch: %s]: finding pull requests" , repoID , branch )
326
326
prs , err = issues_model .GetUnmergedPullRequestsByBaseInfo (repoID , branch )
327
327
if err != nil {
0 commit comments