-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Add GET requests to webhook #6771
Conversation
Pretty sure Jenkins accepts both GET and POST, depending on whether you use a token or other auth? 🤔 EDIT: Tested with curl, definitely accepts both GET and POST requests. |
AFAIK the jenkins build trigger doesn't accept POST requests. |
The Gitea Jenkins plugin (https://github.com/jenkinsci/gitea-plugin) has been working successfully for some time now without GET requests. |
@techknowlogick That plugin is pull-based, i.e. it fetches every x minutes - based on configuration. |
@jolheiser Can you provide the curl command, please? GET works fine for me, POST does not. |
For my instance, I use
|
Seems this plugin also accepts POSTs from Gitea https://wiki.jenkins.io/plugins/servlet/mobile?contentId=106267244#content/view/106267244 |
Codecov Report
@@ Coverage Diff @@
## master #6771 +/- ##
==========================================
- Coverage 41.18% 41.18% -0.01%
==========================================
Files 424 425 +1
Lines 58459 58477 +18
==========================================
+ Hits 24078 24082 +4
- Misses 31196 31209 +13
- Partials 3185 3186 +1
Continue to review full report at Codecov.
|
@jolheiser That doesn't trigger any build for me, unfortunately. Only GET requests do, tested it on multiple systems. @techknowlogick While that might be a solution for most people, I can not add plugins to our systems due to compliance without a lot of hassle. Also, people will probably find GET hooks quite useful for other systems than jenkins. |
What version of Jenkins are you using? As far as I can tell I don't have any plugins that added the functionality. |
Some webhook maybe failed when the request body is big enough. |
@jolheiser I'm using the latest one from docker
|
@shilch The http standard didn't limit that length of GET request but in fact, browsers did that. For Chrome, it's 8182 bytes. See https://stackoverflow.com/questions/2659952/maximum-length-of-http-get-request |
@lunny I'd say that's not a problem here since we're not dealing with browsers. |
@kolaente even though we aren't dealing with web browsers, web servers still have max limit on GET request as well. For example if URI is too long nginx will give |
Maybe do not send payload with get requests as in such cases most probably it won't be needed anyway |
I'd say we should send the payload to be consistent. If the receiving end needs the payload via url, its their responsibility to configure their nginx/apache/whatever appropriate or just use post requests. This is somewhat of an edge case, so I'd say we do the minimum needed to get this working, as its not our job to fix other peoples broken software. |
GET would be needed to trigger builds etc mostly not to actually use gitea payload data |
@shilch Could you add a setting whether to send payload or not? |
Add option to use GET methods for webhooks to support Jenkins build triggers.