-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Decouple HookTask from Repository #17940
Conversation
How about to add a new column named |
@KN4CK3R could you please resolve the conflict? |
Please resolve the conflicts |
@KN4CK3R please resolve conflicts |
…-user-org-webhook
Maybe I have posted this concern. When a hook task created from an org/system level webhook, if |
@lunny we do store RepoID in Webhook table: https://github.com/go-gitea/gitea/pull/17940/files#diff-8fd01247d233d732c2e8ffc0c554ad22dde28f35fc7e27f5489d5da39f53c79bR184 |
gitea/models/webhook/webhook.go Line 190 in 716fcfc
|
You don't really understand how webhook and hooktask work. A system/org level webhook's repo_id is always zero. |
* upstream/main: adapt README_{Country}.md stype name in localizedExtensions (go-gitea#21486) dump: Add option to skip index dirs (go-gitea#21501) Use recommended vscode configuration in gitpod environments (go-gitea#21537) Expand "Go to File" button again, fix 'Add File' margin (go-gitea#21543) Add yardenshoham to maintainers (go-gitea#21566) Refactor git command arguments and make all arguments to be safe to be used (go-gitea#21535) Update binding to fix bugs (go-gitea#21556) Link mentioned user in markdown only if they are visible to viewer (go-gitea#21554) Require authentication for OAuth token refresh (go-gitea#21421) CSS color enhancements (go-gitea#21534) Allow package version sorting (go-gitea#21453) Add link to user profile in markdown mention only if user exists (go-gitea#21533) Update milestone counters when issue is deleted (go-gitea#21459) Prevent Authorization header for presigned LFS urls (go-gitea#21531) Remove deleted repos from searchresult (go-gitea#21512) Remove unnecessary debug log (go-gitea#21536) Added check for disabled Packages (go-gitea#21540) Decouple HookTask from Repository (go-gitea#17940) Add color previews in markdown (go-gitea#21474) Fix generating compare link (go-gitea#21519)
When re-retrieving hook tasks from the DB double check if they have not been delivered in the meantime. Further ensure that tasks are marked as delivered when they are being delivered. In addition: * Improve the error reporting and make sure that the webhook task population script runs in a separate goroutine. * Only get hook task IDs out of the DB instead of the whole task when repopulating the queue * When repopulating the queue make the DB request paged Ref #17940 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
At the moment a repository reference is needed for webhooks. With the upcoming package PR we need to send webhooks without a repository reference. For example a package is uploaded to an organization. In theory this enables the usage of webhooks for future user actions.
This PR removes the repository id from
HookTask
and changes how the hooks are processed (seeservices/webhook/deliver.go
). In a follow up PR I want to remove the usage of the `UniqueQueue´ and replace it with a normal queue because there is no reason to be unique.