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

Fix PR creation on forked repositories #31863

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

LordChunk
Copy link

@LordChunk LordChunk commented Aug 18, 2024

Resolves #20475

@pull-request-size pull-request-size bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Aug 18, 2024
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Aug 18, 2024
@github-actions github-actions bot added modifies/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code labels Aug 18, 2024
routers/api/v1/repo/pull.go Outdated Show resolved Hide resolved
@LordChunk
Copy link
Author

@lunny It's not entirely clear to me what changes should still be made to this PR. Would you mind clarifying your previous comment?

@lunny
Copy link
Member

lunny commented Sep 5, 2024

@lunny It's not entirely clear to me what changes should still be made to this PR. Would you mind clarifying your previous comment?

The logic looks right. Could you have a test for that change?

@pull-request-size pull-request-size bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Sep 14, 2024
@LordChunk
Copy link
Author

LordChunk commented Sep 14, 2024

I've added a test which should test the new logic I added. I found it quite complicated to work our exactly how the test suite works, since I could not get single tests to run without getting this error:

Running tool: /usr/local/go/bin/go test -timeout 30s -tags 'sqlite sqlite_unlock_notify' -run ^TestPullCreatePrFromBaseToFork$ code.gitea.io/gitea/tests/integration -v
Environment variable $GITEA_CONF not set, use default: tests/sqlite.ini

sqlite3 requires: import _ "github.com/mattn/go-sqlite3" or -tags sqlite,sqlite_unlock_notify

FAIL  code.gitea.io/gitea/tests/integration 0.069s

The test as I've set it up right now is about the best that I could figure out. In case it doesn't quite work as intended, I have added a description of what I tried to make in the comment above the newly added test.

@lunny
Copy link
Member

lunny commented Sep 14, 2024

You can use make test-sqlite#Testxxxx to run the test locally.

@LordChunk
Copy link
Author

@lunny I've added a test which should cover the changes I've made. If you've got any comments or questions, please let me know 📨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. modifies/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pull request creation to forked repository via web api fails
3 participants