You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitea/routers/api/v1/repo
Aaron F 3963625b6e
Webhook for Wiki changes (#20219)
Add support for triggering webhook notifications on wiki changes.

This PR contains frontend and backend for webhook notifications on wiki actions (create a new page, rename a page, edit a page and delete a page). The frontend got a new checkbox under the Custom Event -> Repository Events section. There is only one checkbox for create/edit/rename/delete actions, because it makes no sense to separate it and others like releases or packages follow the same schema.

![image](https://user-images.githubusercontent.com/121972/177018803-26851196-831f-4fde-9a4c-9e639b0e0d6b.png)

The actions itself are separated, so that different notifications will be executed (with the "action" field). All the webhook receivers implement the new interface method (Wiki) and the corresponding tests.

When implementing this, I encounter a little bug on editing a wiki page. Creating and editing a wiki page is technically the same action and will be handled by the ```updateWikiPage``` function. But the function need to know if it is a new wiki page or just a change. This distinction is done by the ```action``` parameter, but this will not be sent by the frontend (on form submit). This PR will fix this by adding the ```action``` parameter with the values ```_new``` or ```_edit```, which will be used by the ```updateWikiPage``` function.

I've done integration tests with matrix and gitea (http).

![image](https://user-images.githubusercontent.com/121972/177018795-eb5cdc01-9ba3-483e-a6b7-ed0e313a71fb.png)

Fix #16457

Signed-off-by: Aaron Fischer <mail@aaron-fischer.net>
3 years ago
..
blob.go RepoAssignment ensure to close before overwrite (#19449) 3 years ago
branch.go Move some code into models/git (#19879) 3 years ago
collaborators.go Move some files into models' sub packages (#20262) 3 years ago
commits.go Add more checks in migration code (#21011) 3 years ago
file.go fix hard-coded timeout and error panic in API archive download endpoint (#20925) 3 years ago
fork.go Move access and repo permission to models/perm/access (#19350) 3 years ago
git_hook.go Move macaron to chi (#14293) 4 years ago
git_ref.go Go 1.19 format (#20758) 3 years ago
hook.go Fill the specified ref in webhook test payload (#20961) 3 years ago
hook_test.go Decouple unit test, remove intermediate `unittestbridge` package (#17662) 3 years ago
issue.go Use correct page size for link header pagination (#20546) 3 years ago
issue_comment.go Move issues related files into models/issues (#19931) 3 years ago
issue_label.go Add more linters to improve code readability (#19989) 3 years ago
issue_reaction.go Move issues related files into models/issues (#19931) 3 years ago
issue_stopwatch.go Move issues related files into models/issues (#19931) 3 years ago
issue_subscription.go Move issues related files into models/issues (#19931) 3 years ago
issue_tracked_time.go Go 1.19 format (#20758) 3 years ago
key.go Use `ctx` instead of `db.DefaultContext` in some packages(routers/services/modules) (#19163) 3 years ago
label.go Move issues related files into models/issues (#19931) 3 years ago
language.go Move almost all functions' parameter db.Engine to context.Context (#19748) 3 years ago
main_test.go Use queue instead of memory queue in webhook send service (#19390) 3 years ago
migrate.go Move some files into models' sub packages (#20262) 3 years ago
milestone.go fix: some typos (#19956) 3 years ago
mirror.go Add new API endpoints for push mirrors management (#19841) 3 years ago
notes.go Add more checks in migration code (#21011) 3 years ago
patch.go Move issues related files into models/issues (#19931) 3 years ago
pull.go Move some files into models' sub packages (#20262) 3 years ago
pull_review.go Dismiss prior pull reviews if done via web in review dismiss (#20197) 3 years ago
release.go Move some files into models' sub packages (#20262) 3 years ago
release_attachment.go Move some files into models' sub packages (#20262) 3 years ago
release_tags.go Move some files into models' sub packages (#20262) 3 years ago
repo.go Go 1.19 format (#20758) 3 years ago
repo_test.go Renamed ctx.User to ctx.Doer. (#19161) 3 years ago
star.go Renamed ctx.User to ctx.Doer. (#19161) 3 years ago
status.go Add more linters to improve code readability (#19989) 3 years ago
subscriber.go Renamed ctx.User to ctx.Doer. (#19161) 3 years ago
tag.go Move some files into models' sub packages (#20262) 3 years ago
teams.go Move some files into models' sub packages (#20262) 3 years ago
topic.go Add missing return for when topic isn't found (#20351) 3 years ago
transfer.go Move almost all functions' parameter db.Engine to context.Context (#19748) 3 years ago
tree.go Propagate context and ensure git commands run in request context (#17868) 3 years ago
wiki.go Webhook for Wiki changes (#20219) 3 years ago