Skip to content
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

Webhooks: PRs events are not triggering Jenkins job #30252

Open
CristopherA96 opened this issue Apr 2, 2024 · 2 comments
Open

Webhooks: PRs events are not triggering Jenkins job #30252

CristopherA96 opened this issue Apr 2, 2024 · 2 comments

Comments

@CristopherA96
Copy link

Description

I've working on implement the Gitea PR integration with a Freestyle Project within Jenkins.

The idea is to be able to trigger the Jenkins job when it is created and approved and if this is the case in the Jenkins job, if the build fails, the PR auto merge should not be done, otherwise the auto merge should be done.

But during several tests, PRs events do not trigger the Jenkins job, it only triggers the Jenkins job when using Push events.

I am using the Gitea plugin.

The target URL looks something similar to this:
http://[jenkins_URL]/gitea-webhook/post?job=mytest

Gitea Version

1.21.0+rc0

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

2.31

Operating System

RedHat

How are you running Gitea?

What I have:

Gitea:

  • I have a git repo for testing purposes, with the configuration for the webhook. The connection between Gitea and Jenkins is working, but when I check the PR events they are not triggering the Jenkins job.

Jenkins:

  • I have a freestyle project with the configuration to build when Poll SCM.
  • I have a Execute shell to run specific scripts and I was testing out the Gitea API for the auto merge when the script passed.

Database

PostgreSQL

@CristopherA96 CristopherA96 changed the title PRs events are not triggering Jenkins job Webhooks: PRs events are not triggering Jenkins job Apr 2, 2024
@SniperCZE
Copy link

I have simmilar situation here - if I choose custom events -> Pull Request only with branch filter, even test delivery event is not triggered at all. Webhook with custom events is working when I choose all pull request events AND also Create, Delete and Push events from repository (branch filter is set to *). Gitea version 1.22.3.

@AmbroseX
Copy link

+1 Experiencing the same issue

When configuring the webhook, I only selected the push event, but I found that Gitea sends a lot of redundant and unnecessary data, causing Jenkins to reject the request.

Specifically:

  1. For a single push event, Gitea repeatedly sends event headers in three different formats
  2. The payload contains too much unnecessary repository and user information

I've looked through Gitea's settings interface for a while but couldn't find any options to streamline this data. This causes problems when integrating with Jenkins.

Hope the team could consider adding a configuration option that allows users to choose to send only the necessary data. This would help avoid rejection by CI systems and improve the overall user experience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants