TkTech / notifico

IRC Message Relay
http://n.tkte.ch
MIT License
155 stars 39 forks source link

Create Gitea hook service #206

Closed sdegrande closed 2 years ago

sdegrande commented 2 years ago

This proposed Gitea hook is based on the code of the GitHub's hook.

Fixes #178

sdegrande commented 2 years ago

@TkTech : would you please mind having a look at that PR, and possibly merge it or request some changes ?

TkTech commented 2 years ago

I'll have time to look at this on Sunday, thanks for the contribution!

TkTech commented 2 years ago

I like having the separate service for Gitea, since it may diverge more in the future, but I think we can reduce quite a bit of the duplication unless I'm missing something. Like the form could be a subclass of the Github form, right? Most of the differences are in the payload.

sdegrande commented 2 years ago

Thanks for your reply.

The events lists are different (some names are changed, there's at least one additional event and some github events do not exists in gitea). That list could possibly be somehow a parameter of ConfigForm, I guess, but there's also one config option that does not make sense for Gitea. So 2 config 'widgets' are not shared.

There are some 'minor' changes in the payload.

So, yes, most of the code is duplicated. Same goes with gitlab.py, actually, that's why I did not try to factorize the code.

The difference of code between those 3 hooks is sometimes quite "subtle", so factorizing in a base class is perhaps not that easy.

TkTech commented 2 years ago

Works for me, thanks again for the contribution. It might take a day or two to deploy, our CI provider doesn't do open source anymore and the deploy tools I used for this project a decade ago don't work anymore 😆 I'll move over to GitHub actions.

sdegrande commented 2 years ago

Thanks for the merge, and thanks for your work !

sdegrande commented 2 years ago

Hello, @TkTech. Any ETA ?

TkTech commented 2 years ago

The host for n.tkte.ch is switching to hetzner, just twiddling my thumbs waiting for their support to get it running.

TkTech commented 2 years ago

@sdegrande progressing in #207

TkTech commented 2 years ago

Deployed, and future deployments are automatic.

sdegrande commented 2 years ago

Great ! Thanks a lot.