Skip to content

Conversation

@lunny
Copy link
Member

@lunny lunny commented Dec 18, 2025

Maybe fix #32018

  • Use gitrepo.GetMergeBase method instead of other two implementations.
  • Add FetchRemoteCommit so that we don't need to add many remote to the git repository to avoid possible git lock conflicts. A lock will start when invoke the function, it will be invoked when cross-repository comparing. The head repository will fetch the base repository's base commit id. In most situations, it should lock the fork repositories so that it should not become a bottleneck.
  • Improve GetCompareInfo to remove unnecessarily adding remote.
  • Remove unnecessary parameters of SignMerge.

@lunny lunny added the type/refactoring Existing code has been cleaned up. There should be no new functionality. label Dec 18, 2025
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Dec 18, 2025
@github-actions github-actions bot added the modifies/go Pull requests that update Go code label Dec 18, 2025
@lunny lunny marked this pull request as draft December 25, 2025 07:19
lafriks pushed a commit that referenced this pull request Dec 28, 2025
@lunny lunny changed the title Some refactors to reduce RepoPath Some refactors about GetMergeBase Dec 29, 2025
@github-actions github-actions bot added the modifies/api This PR adds API routes or modifies them label Jan 3, 2026
@lunny lunny marked this pull request as ready for review January 3, 2026 04:40
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jan 3, 2026
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jan 4, 2026
@wxiaoguang
Copy link
Contributor

CI failure is also related.

Do rerun the CI multiple times before merge to ensure there is no regression.

@wxiaoguang wxiaoguang marked this pull request as draft January 4, 2026 22:59
@wxiaoguang
Copy link
Contributor

CI failure is also related.

Do rerun the CI multiple times before merge to ensure there is no regression.

CI failure is still related

     pull_create_test.go:98: 
        	Error Trace:	/home/runner/work/gitea/gitea/tests/integration/integration_test.go:348
        	            				/home/runner/work/gitea/gitea/tests/integration/integration_test.go:160
        	            				/home/runner/work/gitea/gitea/tests/integration/pull_create_test.go:98
        	            				/home/runner/work/gitea/gitea/tests/integration/pull_create_test.go:399
        	            				/opt/hostedtoolcache/go/1.25.5/x64/src/sync/waitgroup.go:239
        	            				/opt/hostedtoolcache/go/1.25.5/x64/src/runtime/asm_amd64.s:1693
        	Error:      	Not equal: 
        	            	expected: 200
        	            	actual  : 500
        	Test:       	TestPullCreateParallel
        	Messages:   	Request: GET /user2/repo1/compare/master...user1/repo1:new-branch-3


    pull_create_test.go:416: 
        	Error Trace:	/home/runner/work/gitea/gitea/tests/integration/pull_create_test.go:416
        	            				/home/runner/work/gitea/gitea/tests/integration/git_helper_for_declarative_test.go:88
        	            				/home/runner/work/gitea/gitea/tests/integration/pull_create_test.go:384
        	Error:      	Not equal: 
        	            	expected: 8
        	            	actual  : 7
        	Test:       	TestPullCreateParallel
    pull_create_test.go:417: 
        	Error Trace:	/home/runner/work/gitea/gitea/tests/integration/pull_create_test.go:417
        	            				/home/runner/work/gitea/gitea/tests/integration/git_helper_for_declarative_test.go:88
        	            				/home/runner/work/gitea/gitea/tests/integration/pull_create_test.go:384
        	Error:      	Not equal: 
        	            	expected: 8
        	            	actual  : 7
        	Test:       	TestPullCreateParallel

@github-actions github-actions bot removed the modifies/api This PR adds API routes or modifies them label Jan 14, 2026
@lunny
Copy link
Member Author

lunny commented Jan 16, 2026

CI failure is also related.

Do rerun the CI multiple times before merge to ensure there is no regression.

Added a lock for the fetch operations to the repository and rerun the CI many times and all PASS.

@lunny lunny marked this pull request as ready for review January 17, 2026 05:12
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Jan 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/go Pull requests that update Go code reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. type/refactoring Existing code has been cleaned up. There should be no new functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GetCompareInfo, AddRemote: exit status 128 - error: could not lock config file config: File exists

5 participants