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

Merged
merged 11 commits into from
Oct 4, 2024
Merged

Conversation

LordChunk
Copy link
Contributor

@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
Contributor 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
Contributor 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
Contributor 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 📨

@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 Sep 28, 2024
@denyskon denyskon added giteabot/update-branch Hint for the bot that it should update a PR with the latest state on main type/bug labels Oct 3, 2024
@GiteaBot GiteaBot removed the giteabot/update-branch Hint for the bot that it should update a PR with the latest state on main label Oct 3, 2024
@denyskon denyskon modified the milestones: 1.22.3, 1.23.0 Oct 3, 2024
@denyskon denyskon added the backport/v1.22 This PR should be backported to Gitea 1.22 label Oct 3, 2024
@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 Oct 3, 2024
@denyskon denyskon added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Oct 3, 2024
@techknowlogick techknowlogick merged commit 7e68bc8 into go-gitea:main Oct 4, 2024
26 checks passed
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Oct 4, 2024
@techknowlogick
Copy link
Member

Congrats on your first PR to the codebase, thanks so much!

@GiteaBot
Copy link
Contributor

GiteaBot commented Oct 4, 2024

I was unable to create a backport for 1.22. @LordChunk, please send one manually. 🍵

go run ./contrib/backport 31863
...  // fix git conflicts if any
go run ./contrib/backport --continue

@GiteaBot GiteaBot added the backport/manual No power to the bots! Create your backport yourself! label Oct 4, 2024
zjjhot added a commit to zjjhot/gitea that referenced this pull request Oct 8, 2024
* giteaofficial/main:
  [skip ci] Updated translations via Crowdin
  Allow filtering PRs by poster in the ListPullRequests API (go-gitea#32209)
  Fix bug when there are multiple triggers with workflow dispatch (go-gitea#32200)
  [skip ci] Updated licenses and gitignores
  [skip ci] Updated translations via Crowdin
  Upgrade htmx to 2.0.3 (go-gitea#32192)
  Enhance USER_DISABLED_FEATURES to allow disabling change username or full name (go-gitea#31959)
  [skip ci] Updated translations via Crowdin
  Add support for searching users by email (go-gitea#30908)
  Fix PR creation on forked repositories (go-gitea#31863)
  [skip ci] Updated translations via Crowdin
  Fixed race condition when deleting documents by repoId in ElasticSearch (go-gitea#32185)
  add {{TEST_MINIO_ENDPOINT}} for local testing "with/without" docker + fix pgsql testing doc (go-gitea#32105)
  [skip ci] Updated translations via Crowdin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/manual No power to the bots! Create your backport yourself! backport/v1.22 This PR should be backported to Gitea 1.22 lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. 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. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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