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

Check user/org repo limit instead of doer #34147

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

Conversation

DrMaxNix
Copy link
Contributor

@DrMaxNix DrMaxNix commented Apr 7, 2025

This PR tries to finally fix the bug mentioned in #30011 and #15504, where the user repo limit is checked when creating a repo in an organization.

Fix #30011


Please verify that this change makes sense, I don't know a lot about the gitea codebase, so I cannot overlook the security implications that this change will have for other parts of the code.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 7, 2025
@pull-request-size pull-request-size bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Apr 7, 2025
@github-actions github-actions bot added the modifies/go Pull requests that update Go code label Apr 7, 2025
Copy link
Contributor

@TheFox0x7 TheFox0x7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change looks reasonable to me, though I'm also not an expert.

@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 Apr 8, 2025
@wxiaoguang wxiaoguang added the backport/v1.23 This PR should be backported to Gitea 1.23 label Apr 8, 2025
@pull-request-size pull-request-size bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 8, 2025
@github-actions github-actions bot added the modifies/templates This PR modifies the template files label Apr 8, 2025
@wxiaoguang
Copy link
Contributor

I think we need a complete fix like this: 8b48d86

Use CanCreateRepoIn , it should be clearer than before and won't be abused.

@wxiaoguang
Copy link
Contributor

And let's add some tests: c654ade

@wxiaoguang wxiaoguang added this to the 1.24.0 milestone Apr 8, 2025
@wxiaoguang wxiaoguang removed the backport/v1.23 This PR should be backported to Gitea 1.23 label Apr 8, 2025
@lunny lunny changed the title Check user/org repo limit instead of doer (30011) Check user/org repo limit instead of doer Apr 8, 2025
@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 Apr 8, 2025
Copy link
Contributor

@wxiaoguang wxiaoguang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix merge conflict

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 modifies/templates This PR modifies the template files 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.

UI preventing org repo creation as well if user org limit is reached
5 participants