feat(repo): split repository creation limit into user and org scopes (#37872)

## Background

`MAX_CREATION_LIMIT` applies to whoever owns a new repository, with no
distinction between individual users and organizations. Admins who want
different limits for the two - most commonly "block personal repos but
let orgs create freely" - currently have to set per-user / per-org
overrides on every entity.

## Changes

Adds two new `[repository]` settings:

- `USER_MAX_CREATION_LIMIT`: global limit for individual users
- `ORG_MAX_CREATION_LIMIT`: global limit for organizations

`MAX_CREATION_LIMIT` is kept as a shortcut: when set, it becomes the
default value for both new keys. When the new keys are explicitly
configured, they take precedence. Deployments that only set
`MAX_CREATION_LIMIT` see behavior identical to now.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
Zettat123
2026-05-28 11:29:32 -06:00
committed by GitHub
parent 52fef74291
commit 49f88a4b9e
7 changed files with 137 additions and 18 deletions
+10 -1
View File
@@ -1024,9 +1024,18 @@ LEVEL = Info
;; Default private when using push-to-create
;DEFAULT_PUSH_CREATE_PRIVATE = true
;;
;; Global limit of repositories per user, applied at creation time. -1 means no limit
;; Global limit of repositories per user or org, applied at creation time. -1 means no limit
;; To configure independent limits for users and orgs, use USER_MAX_CREATION_LIMIT and ORG_MAX_CREATION_LIMIT
;MAX_CREATION_LIMIT = -1
;;
;; Global limit of repositories per user, applied at creation time. -1 means no limit
;; Takes precedence over MAX_CREATION_LIMIT when set
;USER_MAX_CREATION_LIMIT = -1
;;
;; Global limit of repositories per organization, applied at creation time. -1 means no limit
;; Takes precedence over MAX_CREATION_LIMIT when set
;ORG_MAX_CREATION_LIMIT = -1
;;
;; Preferred Licenses to place at the top of the List
;; The name here must match the filename in options/license or custom/options/license
;PREFERRED_LICENSES = Apache License 2.0,MIT License