mirror of
https://github.com/go-gitea/gitea.git
synced 2026-03-21 14:06:26 -05:00
gitea1.23.3: wrong PR logic & disabled webhooks still working #14091
Closed
opened 2025-11-02 11:02:34 -06:00 by GiteaMirror
·
15 comments
No Branch/Tag Specified
main
release/v1.25
release/v1.24
release/v1.23
release/v1.22
release/v1.21
release/v1.20
release/v1.19
release/v1.18
release/v1.17
release/v1.16
release/v1.15
release/v1.14
release/v1.13
release/v1.12
release/v1.11
release/v1.10
release/v1.9
release/v1.8
v1.25.3
v1.25.2
v1.25.1
v1.25.0
v1.24.7
v1.25.0-rc0
v1.26.0-dev
v1.24.6
v1.24.5
v1.24.4
v1.24.3
v1.24.2
v1.24.1
v1.24.0
v1.23.8
v1.24.0-rc0
v1.25.0-dev
v1.23.7
v1.23.6
v1.23.5
v1.23.4
v1.23.3
v1.23.2
v1.23.1
v1.23.0
v1.23.0-rc0
v1.24.0-dev
v1.22.6
v1.22.5
v1.22.4
v1.22.3
v1.22.2
v1.22.1
v1.22.0
v1.23.0-dev
v1.22.0-rc1
v1.21.11
v1.22.0-rc0
v1.21.10
v1.21.9
v1.21.8
v1.21.7
v1.21.6
v1.21.5
v1.21.4
v1.21.3
v1.21.2
v1.20.6
v1.21.1
v1.21.0
v1.21.0-rc2
v1.21.0-rc1
v1.20.5
v1.22.0-dev
v1.21.0-rc0
v1.20.4
v1.20.3
v1.20.2
v1.20.1
v1.20.0
v1.19.4
v1.21.0-dev
v1.20.0-rc2
v1.20.0-rc1
v1.20.0-rc0
v1.19.3
v1.19.2
v1.19.1
v1.19.0
v1.19.0-rc1
v1.20.0-dev
v1.19.0-rc0
v1.18.5
v1.18.4
v1.18.3
v1.18.2
v1.18.1
v1.18.0
v1.17.4
v1.18.0-rc1
v1.19.0-dev
v1.18.0-rc0
v1.17.3
v1.17.2
v1.17.1
v1.17.0
v1.17.0-rc2
v1.16.9
v1.17.0-rc1
v1.18.0-dev
v1.16.8
v1.16.7
v1.16.6
v1.16.5
v1.16.4
v1.16.3
v1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3.3
v1.4.0-rc1
v1.3.2
v1.3.1
v1.3.0
v1.3.0-rc2
v1.3.0-rc1
v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.2.0-rc3
v1.2.0-rc2
v1.1.4
v1.2.0-rc1
v1.1.3
v1.1.2
v1.1.1
v1.1.0
v1.0.2
v1.0.1
v1.0.0
v0.9.99
Labels
Clear labels
$20
$250
$50
$500
backport/done
💎 Bounty
docs-update-needed
good first issue
hacktoberfest
issue/bounty
issue/confirmed
issue/critical
issue/duplicate
issue/needs-feedback
issue/not-a-bug
issue/regression
issue/stale
issue/workaround
lgtm/need 2
modifies/api
modifies/translation
outdated/backport/v1.18
outdated/theme/markdown
outdated/theme/timetracker
performance/bigrepo
performance/cpu
performance/memory
performance/speed
pr/breaking
proposal/accepted
proposal/rejected
pr/wip
pull-request
reviewed/wontfix
💰 Rewarded
skip-changelog
status/blocked
topic/accessibility
topic/api
topic/authentication
topic/build
topic/code-linting
topic/commit-signing
topic/content-rendering
topic/deployment
topic/distribution
topic/federation
topic/gitea-actions
topic/issues
topic/lfs
topic/mobile
topic/moderation
topic/packages
topic/pr
topic/projects
topic/repo
topic/repo-migration
topic/security
topic/theme
topic/ui
topic/ui-interaction
topic/ux
topic/webhooks
topic/wiki
type/bug
type/deprecation
type/docs
type/enhancement
type/feature
type/miscellaneous
type/proposal
type/question
type/refactoring
type/summary
type/testing
type/upstream
Mirrored from GitHub Pull Request
Milestone
No items
No Milestone
Projects
Clear projects
No project
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/gitea#14091
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @phoedos on GitHub (Feb 4, 2025).
Description
Hi guys
after upgrading to gitea 1.22.6->1.23.1 have next issue related with Pull Requests, Gitea and Jenkins integration
Jenkins version - latest jenkins:2.495-jdk21
Gitea jenkins plugin - latest 234.v60def593ec50
Inside gitea ORG have next webhook settings:
url: https://jenkinsurl/gitea-webhook/post
method: POST
POST content type: application/json
Trigger on: custom events [NO PR actions are activated]
Branch filter: *
Inside org I have a repo with 'main' and 'test' branches
Later, inside gitea interface I make a PR test->main branch and stay it unclosed (imagine it's under review for another developer)
Now I continue work on 'test' branch and make some new commits .
expected result: gitea will send a webhook, jenkins run a pipeline on 'test' branch according to jenkinsfile logic
actual resut: gitea add new commit to PR, test branch (inside jenkins) is disabled by Gitea.
Why This Behavior Seems Incorrect:

Unexpected Webhook Behavior – Gitea sends a PR webhook to Jenkins even though PR webhooks are explicitly disabled.
Forced PR Updates – New commits to test are automatically added to the existing open PR, making it impossible to continue working on test without affecting the PR.
Regression from 1.22.6 – This behavior did not occur in Gitea 1.22.6 and appears to be a new issue introduced in 1.23.1.
Impact:
Developers cannot work on test independently after opening a PR.
PRs may receive uncontrolled code changes, which could result in unintended code being merged into main.
Request for Investigation:
Could you please confirm if this is an intended change in Gitea 1.23.1 or a potential bug? If it is an intended change, is there a way to prevent this behavior?
Gitea Version
1.23.1
Can you reproduce the bug on the Gitea demo site?
Yes
Log Gist
No response
Screenshots
No response
Git Version
No response
Operating System
No response
How are you running Gitea?
docker-compose
Database
PostgreSQL
@wxiaoguang commented on GitHub (Feb 4, 2025):
Maybe related to:
-> Gitea submits webhooks on "status" event, even if webhook is defined only for "push" #33302
-> Add tests for webhook and fix some webhook bugs (#33396) #33442
Could you try 1.23-nightly? (it is a stable release and will be 1.23.2 soon)
@phoedos commented on GitHub (Feb 6, 2025):
Dear @wxiaoguang
today tested on 1.23.3 - no changes, logic is still the same:
@wxiaoguang commented on GitHub (Feb 6, 2025):
According to: https://github.com/go-gitea/gitea/issues/33302#issuecomment-2639340884
Does it help?
also @lunny
@phoedos commented on GitHub (Feb 6, 2025):
Dear @wxiaoguang
all other options before, after, compare_url, id, message, url are similar
maybe issue related with gitea jenkins plugin whith incorrect processing of 'open_pr_counter' parameter?
@lunny commented on GitHub (Feb 10, 2025):
@phoedos Have you tried to upgrade to v1.23.3 and you can reconfigure the webhook to uncheck
statusesin the webhook edit UI? Have you tried that?@phoedos commented on GitHub (Feb 10, 2025):
Dear @lunny, nice to meet you!
Now I'm running on Gitea 1.23.3. Webhook was deleted and created again. Disabled 'Statuses' option do not help me.
Also tried to enable 'Statuses' - apply; disable 'Statuses' - apply: no result.
Seems that 'Statuses' option checkbox do not work.
@lunny commented on GitHub (Feb 10, 2025):
Can you check whether there are other level webhooks, like org level and system level webhooks will be triggered. I cannot reproduce in my local machine with v1.23.3
@phoedos commented on GitHub (Feb 10, 2025):
Dear @lunny
no sys, no repo webhooks configured,
only ORG one
and this configuration disable branch in Jenkins during commit when PR is active
@phoedos commented on GitHub (Feb 10, 2025):
Action1:
just make a commit in Branch which trigger Jenkins build
Action2:
Make PR via Gitea interface test->master branch and stay it active (uclosed)
Action3:
during active PR make another commit in test branch
expected result:
actual result
-- when PR merge commit is created
--when PR is closed
@yp05327 commented on GitHub (Feb 10, 2025):
Can you also provide the history records (Recent Deliveries) in Gitea side?
The required information is the headers of these requests.
@phoedos commented on GitHub (Feb 11, 2025):
dear @yp05327 here is txt with webhook data.
PS: as you can see, headers are always similar.
webhooks.txt
@lunny commented on GitHub (Feb 11, 2025):
When you create a new branch, two webhooks will be triggered: one for the branch creation event and another for the commit push event. I reviewed the code again. As far as I know, there hasn’t been any change in this logic between versions 1.22 and 1.23.
When you push a commit, a webhook will be triggered regardless of whether a pull request (PR) is created with the branch as its head or not. This means that even if PR events are disabled, it’s normal for a webhook to be triggered when you push a commit to the head branch of the PR. GitHub exhibits similar behavior.
Since all your PR events are disabled, I don't understand why
--when PR is closed,jenkins will start bulds for 'test' branch only.I don't know how it works about
gitea disable branch in Jenkins. Gitea just triggered a webhook and no operation to disable branch in Jenkins. Maybe it's a behaviour of the Gitea plugin of Jenkins?@yp05327 commented on GitHub (Feb 11, 2025):
From the webhooks.txt, the behaviours in Gitea side are all expected.
There are something I can not understand:
What do you mean
Gitea sends a PR webhook? Because there are onlypushevents in the text you provided.If there are some PR related events, it should be a bug as no PR related events are selected.
Same to @lunny. There are only
pushevents triggered, so why it is disabled in jenkins?So maybe there are some other situations that make it be disabled at first. Even Gitea side works well, sends a
pushevent webhook later, but it is already disabled in jenkins, so the pipeline don't work? (This is a guess from me.)As you also said above:
So after the PR created, the
testbranch should be enabled in jenkins?Then when it is disabled? After the new commit to
testbranch (Action3) or before?According to webhook.txt, these two cases are worked because the target of push event workflow is
mainbranch nottestbranch:The
mainbranch is not disabled, so of cause, it worked.According to the analyzation above, the issue is clear:
The
testbranch is blocked in jenkins by some unkown reasons during the creation of the PR.But from Gitea side, only push events are triggered, so it is hard to consider that Gitea takes the initiative to block it.
Maybe you need to test when it is blocked, then figure out why it is blocked.
I hope this analyzation can be helpful to you. :)
@phoedos commented on GitHub (Feb 12, 2025):
Dear guys,
thank you for your efforts to investigate the issue.
I even made a lab with gitea+jenkins in docker-compose to analyze the reported case.
Found that issue related to Jenkins ORG folder configuration: Discover branches -> Strategy.
Changing settings Only branches that are not also filled as PRs -> All branches solved my issue.
now build is working during active PR. Thank you very much!
@lunny commented on GitHub (Feb 12, 2025):
Thank you for sharing! This could be really helpful for others facing similar issues.