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

Add permission check when creating PR #31033

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

Conversation

yp05327
Copy link
Contributor

@yp05327 yp05327 commented May 21, 2024

user should be a collaborator of the base repo to create a PR

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label May 21, 2024
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 21, 2024
@github-actions github-actions bot added modifies/translation modifies/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code labels May 21, 2024
@pull-request-size pull-request-size bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 21, 2024
@yp05327 yp05327 requested a review from lunny May 21, 2024 06:27
@yp05327 yp05327 changed the title Add permission check when create PR Add permission check when creating PR May 21, 2024
@yp05327 yp05327 marked this pull request as ready for review May 21, 2024 07:51
@yp05327
Copy link
Contributor Author

yp05327 commented May 21, 2024

Some tests using organization user as the PR poster.....It will take lots of time to fix them. 😕

@yp05327
Copy link
Contributor Author

yp05327 commented May 21, 2024

@Zettat123
The poster is org user in TestPullRequestTargetEvent, can it be converted into user4?

@Zettat123
Copy link
Contributor

Zettat123 commented May 21, 2024

@Zettat123 The poster is org user in TestPullRequestTargetEvent, can it be converted into user4?

My fault. It should be converted to an non-org user.
I think user4 is OK.

@pull-request-size pull-request-size bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 22, 2024
@lunny lunny added type/bug backport/v1.22 This PR should be backported to Gitea 1.22 labels May 22, 2024
@lunny lunny added this to the 1.23.0 milestone May 22, 2024
@lunny
Copy link
Member

lunny commented May 22, 2024

user should be a collaborator of the base repo to create a PR

He should be a collaborator of the base repository if he creates a PR from the same repository.
If he creates a PR from a forked repository, he should be a collaborator of the head repository.

@yp05327
Copy link
Contributor Author

yp05327 commented May 23, 2024

If he creates a PR from a forked repository, he should be a collaborator of the head repository.

This is not the Github's logic, Github's logic is checking base repo, not head repo (for public repos)

@yp05327
Copy link
Contributor Author

yp05327 commented May 23, 2024

See: yp05327/test#7

yp05328 is a collaborator of yp05327/test
but yp05328 is not a member of yp05327test

image

@pull-request-size pull-request-size bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 27, 2024
@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 May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/v1.22 This PR should be backported to Gitea 1.22 lgtm/need 1 This PR needs approval from one additional maintainer to be merged. modifies/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code modifies/translation size/L Denotes a PR that changes 100-499 lines, ignoring generated files. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants