github-java-client icon indicating copy to clipboard operation
github-java-client copied to clipboard

Add repository_dispatch endpoint

Open ajmalab opened this issue 1 year ago • 5 comments

Adding support for the /repos/{owner}/{repo}/dispatches endpoint that allows us to dispatch custom webhook events from repositories to trigger workflows. See more here: https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#create-a-repository-dispatch-event

ajmalab avatar May 08 '24 23:05 ajmalab

@felix-seifert or @Abhi347 perhaps for a review? 😄

ajmalab avatar May 09 '24 13:05 ajmalab

I did consider tests, but the response for that endpoint is always a 204 with no body (similar to the editComment and deleteComment methods). Unsure what I'd be testing (perhaps I can simply check for a 204 no body response?). Happy to take suggestions.

ajmalab avatar May 09 '24 13:05 ajmalab

I did consider tests, but the response for that endpoint is always a 204 with no body (similar to the editComment and deleteComment methods). Unsure what I'd be testing (perhaps I can simply check for a 204 no body response?). Happy to take suggestions.

Hi @ajmalab, yeah exactly. It's mostly for safety in case this code where to change. Even testing something as simple as a 204 response is still valuable. You'll see similar tests in RepositoryClientTest.java.

ebk45 avatar May 10 '24 07:05 ebk45

@ebk45 @Abhi347 Added a test, please do let me know if you require further changes 😄

ajmalab avatar May 10 '24 14:05 ajmalab

Could I get a review please 🙏 @ebk45 or @Abhi347 perhaps?

ajmalab avatar May 16 '24 08:05 ajmalab