Skip to content
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

Merged
merged 3 commits into from
Jul 6, 2019

Conversation

akkowal2
Copy link
Contributor

@akkowal2 akkowal2 commented Jul 6, 2019

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 [email protected]

@techknowlogick techknowlogick added this to the 1.9.0 milestone Jul 6, 2019
@akkowal2 akkowal2 changed the title Fix mirror webhooks Fix mirror repository webhooks Jul 6, 2019
@codecov-io
Copy link

Codecov Report

Merging #7366 into master will decrease coverage by <.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
models/action.go 58.5% <0%> (-0.28%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ef57fe4...a1ebb8b. Read the comment docs.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jul 6, 2019
@akkowal2 akkowal2 marked this pull request as ready for review July 6, 2019 17:55
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jul 6, 2019
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jul 6, 2019
@techknowlogick techknowlogick merged commit 89aa08d into go-gitea:master Jul 6, 2019
@akkowal2 akkowal2 deleted the fix-mirror-webhooks branch July 6, 2019 21:58
@@ -896,6 +896,11 @@ func mirrorSyncAction(e Engine, opType ActionType, repo *Repository, refName str
}); err != nil {
return fmt.Errorf("notifyWatchers: %v", err)
}

Copy link
Member

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.

jeffliu27 pushed a commit to jeffliu27/gitea that referenced this pull request Jul 18, 2019
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Webhooks on mirrored repositories broken
7 participants