-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix mirror repository webhooks #7366
Conversation
Codecov Report
@@ Coverage Diff @@
## master #7366 +/- ##
==========================================
- Coverage 41.24% 41.24% -0.01%
==========================================
Files 467 467
Lines 63295 63298 +3
==========================================
Hits 26108 26108
- Misses 33770 33773 +3
Partials 3417 3417
Continue to review full report at Codecov.
|
@@ -896,6 +896,11 @@ func mirrorSyncAction(e Engine, opType ActionType, repo *Repository, refName str | |||
}); err != nil { | |||
return fmt.Errorf("notifyWatchers: %v", err) | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should move these to https://github.com/go-gitea/gitea/blob/master/models/action.go#L943 because it should be with webhook.
Fixes #5441
I found that mirror syncs will properly create hook tasks, however, the hook queue that gitea is monitoring is never updated/notified of the hook task for the repo and thus the hook task is never fulfilled. If you restart the gitea server, the goroutine first fulfills the current task list and then blocks on the hook queue. This is why any mirror action webhooks are sent on restart and why any new hook tasks created by mirror actions do not get fulfilled automatically.
Signed-off-by: Drew Kowalski drewkowalski93@gmail.com