Description
Description
GET /admin/hooks
lists hooks with is_system_webhook = true
, but POST /admin/hooks
creates them without. There does not currently seem to be a way to create a system webhook from the API -- only default webhooks; meanwhile there is no way to list default webhooks from the API.
I see that /admin/hooks
was only added less than a month ago with #14537. It's an niche but extremely helpful feature for what I'm trying to do with Gitea, so I want to help get it working.
Gitea Version
1.19.0+dev-586-g10cdcb9ea
Can you reproduce the bug on the Gitea demo site?
No -- but only because I don't have admin rights there
Log Gist
https://gist.github.com/kousu/1f0be0c81dce500caef0b0af3e985196
Screenshots
Under http://localhost:3000/admin/hooks I start with an empty slate
I go to http://localhost:3000/api/swagger and log in:
http://localhost:3000/api/swagger#/admin/adminGetHook gives an empty list
I create a hook:
Back on the UI at http://localhost:3000/admin/hooks I can see it, but it's a Default Hook:
But using the API gets me an empty list still:
If I make a system webhook with the UI
it adds to the UI
and the API can see it:
If I add another Default Webhook
The API cannot see it
...unless I specifically ask for hook 20
19 also works, but there's nothing to distinguish that it is a system hook:
Git Version
2.34.1
Operating System
Ubuntu 22.04
How are you running Gitea?
user@dev:~/src/gitea$ TAGS="bindata sqlite sqlite_unlock_notify" make build
user@dev:~/src/gitea$ ./gitea
Database
SQLite