-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Closed PRs getting picked up by build servers monitoring Gitea repos with Gitea 1.19 #24213
Comments
Could you please explain how your Gitea instance triggers builds in TeamCity? Is it via a webhook or by monitoring the repository refs files? @sillyguodong Please take a look. |
Yes, good question, I left that out of the initial report. Our TeamCity is set up to monitor branches matching the specification:
|
I have probably found out the cause of this problem, I will fix that this week. |
We've been running the change from #24231 on our server for the past couple of weeks and it has indeed fixed the issue. Is this going to be merged in soon? |
Close #24213 Replace #23830 #### Cause - Before, in order to making PR can get latest commit after reopening, the `ref`(${REPO_PATH}/refs/pull/${PR_INDEX}/head) of evrey closed PR will be updated when pushing commits to the `head branch` of the closed PR. #### Changes - For closed PR , won't perform these behavior: insert`comment`, push `notification` (UI and email), exectue [pushToBaseRepo](https://github.com/go-gitea/gitea/blob/74225033413dc0f2b308bbe069f6d185b551e364/services/pull/pull.go#L409) function and trigger `action` any more when pushing to the `head branch` of the closed PR. - Refresh the reference of the PR when reopening the closed PR (**even if the head branch has been deleted before**). Make the reference of PR consistent with the `head branch`.
Close go-gitea#24213 Replace go-gitea#23830 #### Cause - Before, in order to making PR can get latest commit after reopening, the `ref`(${REPO_PATH}/refs/pull/${PR_INDEX}/head) of evrey closed PR will be updated when pushing commits to the `head branch` of the closed PR. #### Changes - For closed PR , won't perform these behavior: insert`comment`, push `notification` (UI and email), exectue [pushToBaseRepo](https://github.com/go-gitea/gitea/blob/74225033413dc0f2b308bbe069f6d185b551e364/services/pull/pull.go#L409) function and trigger `action` any more when pushing to the `head branch` of the closed PR. - Refresh the reference of the PR when reopening the closed PR (**even if the head branch has been deleted before**). Make the reference of PR consistent with the `head branch`.
Backport #24231 by @sillyguodong Close #24213 Replace #23830 #### Cause - Before, in order to making PR can get latest commit after reopening, the `ref`(${REPO_PATH}/refs/pull/${PR_INDEX}/head) of evrey closed PR will be updated when pushing commits to the `head branch` of the closed PR. #### Changes - For closed PR , won't perform these behavior: insert`comment`, push `notification` (UI and email), exectue [pushToBaseRepo](https://github.com/go-gitea/gitea/blob/74225033413dc0f2b308bbe069f6d185b551e364/services/pull/pull.go#L409) function and trigger `action` any more when pushing to the `head branch` of the closed PR. - Refresh the reference of the PR when reopening the closed PR (**even if the head branch has been deleted before**). Make the reference of PR consistent with the `head branch`. Co-authored-by: sillyguodong <33891828+sillyguodong@users.noreply.github.com>
Description
We recently upgraded from Gitea 1.18.5 to Gitea 1.19.1, and our TeamCity server has started queuing builds for a number of closed PRs for no discernable reason. No changes are being pushed to these PRs, in fact some of the PRs's branches have been deleted.
I haven't been able to track down the specific details of what's going on, but I can see on the Gitea host filesystem that the directory under repositories/org/repo/refs/pull for the closed PR is getting re-created with the "head" file containing a commit hash that doesn't belong to that branch at all (it seems to always belong to our default 'main' branch instead).
Our only fix has been to constantly monitor TeamCity for queueing builds on closed PRs and canceling them, then fully Deleting the closed PR in Gitea. This is causing a significant problem for us at the moment, so if there's a commit I can cherry-pick to manually build and deploy a fix, we'd be very happy to do that.
This only applies to PRs that are closed, it is not happening with open or merged ones.
I found some issues/PRs that sound possibly related:
Gitea Version
1.19.1
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Screenshots
No response
Git Version
No response
Operating System
No response
How are you running Gitea?
Hand-built 1.19.1 with one local modification, running on an arm64 AWS EC2 instance.
Database
PostgreSQL
The text was updated successfully, but these errors were encountered: