The owner has already reached the limit of 100 repositories. #1

Closed
opened 2024-02-23 01:50:54 +01:00 by Benjamin_Loison · 10 comments
![image](/attachments/b1b17d6f-a713-44f3-8af6-2e35e2eead84) https://codeberg.org/Benjamin_Loison https://codeberg.org/repo/create
777 KiB
Author
Owner

Linking to the own most issues repository would be nice. As there is no such Sort when filtering with the UI, let us make a Python script:

Listing all users having more (in case of priviledged users) or exactly the limit of repositories to study if they are already abusing. According to https://codeberg.org/explore/users there are about 1,503 * 15 = 22,545. users/search does not seem to list the number of repostories, but repos/search gives the owner.

Explain them the purposes of all my repositories.

Could argue that most of time do not actually fork code if I do not modify or refer precisely to it to not uselessly overload, could have exceptional manual increase to 1,000 ideally 10,000, how would I do if I was them?

image

Source: https://gitea.lemnoslife.com/admin/users/21/edit

So on https://codeberg.org/admin/users/74932/edit for them.

Got it with:

import requests
import json

GIT_INSTANCE_URL = 'https://codeberg.org'
# With `read:user` scope.
TOKEN = 'CENSORED'

headers = {
    'Authorization': f'token {TOKEN}'
}

def getApi(url):
    response = requests.get(f'{GIT_INSTANCE_URL}/api/v1/{url}', headers = headers)
    return response.json()

print(json.dumps(getApi(f'user'), indent = 4))

Note that https://codeberg.org/admin/ requires authentication and with my account I get Forbidden.

If they increase my repository limit, stating in the error message that can request manual increase would be nice.

Linking to the own most issues repository would be nice. As there is [no such `Sort` when filtering with the UI](https://codeberg.org/Benjamin_Loison?tab=repositories), let us make a Python script: Listing all users having more (in case of priviledged users) or exactly the limit of repositories to study if they are already abusing. According to https://codeberg.org/explore/users there are about 1,503 * 15 = 22,545. `users/search` does not seem to list the number of repostories, but `repos/search` gives the owner. Explain them the purposes of all my repositories. Could argue that most of time do not actually fork code if I do not modify or refer precisely to it to not uselessly overload, could have exceptional manual increase to 1,000 ideally 10,000, how would I do if I was them? ![image](/attachments/5872a8ad-7cf4-40f5-8d11-e591e9252b18) Source: https://gitea.lemnoslife.com/admin/users/21/edit So on https://codeberg.org/admin/users/74932/edit for them. Got it with: ```py import requests import json GIT_INSTANCE_URL = 'https://codeberg.org' # With `read:user` scope. TOKEN = 'CENSORED' headers = { 'Authorization': f'token {TOKEN}' } def getApi(url): response = requests.get(f'{GIT_INSTANCE_URL}/api/v1/{url}', headers = headers) return response.json() print(json.dumps(getApi(f'user'), indent = 4)) ``` Note that https://codeberg.org/admin/ requires authentication and with my account I get `Forbidden`. If they increase my repository limit, stating in the error message that can request manual increase would be nice.
Author
Owner

Verified decreasing issue number with the following algorithm on first 50 issues of Annihilation_mod:

issues = getApi(f'repos/{repositoryFullName}/issues?state=all&limit=50')
lastIssueNumber = None
for issue in issues:
    issueNumber = issue['number']
    if lastIssueNumber is not None and lastIssueNumber != issueNumber + 1:
        print(f'Not expected order, got {issueNumber}!')
        break
    lastIssueNumber = issueNumber
Verified decreasing issue number with the following algorithm on first 50 issues of [Annihilation_mod](https://codeberg.org/Benjamin_Loison/Annihilation_mod): ```py issues = getApi(f'repos/{repositoryFullName}/issues?state=all&limit=50') lastIssueNumber = None for issue in issues: issueNumber = issue['number'] if lastIssueNumber is not None and lastIssueNumber != issueNumber + 1: print(f'Not expected order, got {issueNumber}!') break lastIssueNumber = issueNumber ```
Author
Owner
import requests
import json
from tqdm import tqdm

GIT_INSTANCE_URL = 'https://codeberg.org'
# With `read:{user,repository,issue}` scopes.
TOKEN = 'CENSORED'

headers = {
    'Authorization': f'token {TOKEN}'
}

def getApi(url, params):
    response = requests.get(f'{GIT_INSTANCE_URL}/api/v1/{url}', headers = headers, params = params)
    return response.json()

page = 1
unsortedRepositoriesIssues = {}
repositoryParams = {
    'limit': 50,
}
repositoryIssueParams = {
    'state': 'all',
    'limit': 1,
}
while True:
    repositoryParams['page'] = page
    repositories = getApi(f'user/repos', repositoryParams)
    if repositories == []:
        break
    
    for repository in tqdm(repositories):
        repositoryFullName = repository['full_name']
        repositoryIssues = getApi(f'repos/{repositoryFullName}/issues', repositoryIssueParams)
        if repositoryIssues != []:
            repositoryName = repository['name']
            maximalRepositoryIssueNumber = repositoryIssues[0]['number']
            unsortedRepositoriesIssues[repositoryName] = maximalRepositoryIssueNumber
    page += 1

sortedRepositoriesIssues = dict(sorted(unsortedRepositoriesIssues.items(), key = lambda item: item[1]))

print(json.dumps(sortedRepositoriesIssues, indent = 4))

Example of many repositories having the most issues: Benjamin_Loison/firefox.

```py import requests import json from tqdm import tqdm GIT_INSTANCE_URL = 'https://codeberg.org' # With `read:{user,repository,issue}` scopes. TOKEN = 'CENSORED' headers = { 'Authorization': f'token {TOKEN}' } def getApi(url, params): response = requests.get(f'{GIT_INSTANCE_URL}/api/v1/{url}', headers = headers, params = params) return response.json() page = 1 unsortedRepositoriesIssues = {} repositoryParams = { 'limit': 50, } repositoryIssueParams = { 'state': 'all', 'limit': 1, } while True: repositoryParams['page'] = page repositories = getApi(f'user/repos', repositoryParams) if repositories == []: break for repository in tqdm(repositories): repositoryFullName = repository['full_name'] repositoryIssues = getApi(f'repos/{repositoryFullName}/issues', repositoryIssueParams) if repositoryIssues != []: repositoryName = repository['name'] maximalRepositoryIssueNumber = repositoryIssues[0]['number'] unsortedRepositoriesIssues[repositoryName] = maximalRepositoryIssueNumber page += 1 sortedRepositoriesIssues = dict(sorted(unsortedRepositoriesIssues.items(), key = lambda item: item[1])) print(json.dumps(sortedRepositoriesIssues, indent = 4)) ``` Example of many repositories having the most issues: [Benjamin_Loison/firefox](https://codeberg.org/Benjamin_Loison/firefox).
Author
Owner

Do I have the same limitation on my own Gitea instance? It does not seem to. Otherwise would have soon noticed it with my current user.

Do I have the same limitation on my own Gitea instance? It does not seem to. Otherwise would have soon noticed it with my current user.
Author
Owner
import requests
import json

GIT_INSTANCE_URL = 'https://codeberg.org'
# With `read:repository` scope.
TOKEN = 'CENSORED'

headers = {
    'Authorization': f'token {TOKEN}'
}

def getApi(url, params):
    response = requests.get(f'{GIT_INSTANCE_URL}/api/v1/{url}', headers = headers, params = params)
    return response.json()
    
repositories = {}

page = 1
while True:
    reposData = getApi('repos/search', {'limit': 50, 'page': page})
    repos = reposData['data']
    if repos == []:
        break
    for repo in repos:
        login = repo['owner']['login']
        repositories[login] = repositories.get(login, 0) + 1
    print(page, sum(repositories.values()))
    page += 1

with open('repositories.json', 'w') as f:
    json.dump(repositories, f, indent = 4)

with open('repositories.json') as f:
    repositories = json.load(f)

for user in repositories:
    numberofRepositories = repositories[user]
    if numberofRepositories >= 100:
        print(user, numberofRepositories)

There are about 20 * 4,323 = 86,460 repositories according to https://codeberg.org/explore/repos. Found 86,592 with above algorithm.

Only:

  • sciss 183
  • MBSolutions 444

seem reachable and having exceeded this limit. Both have been active in the last 2 weeks.

https://codeberg.org claims 125,129 projects and 98,121 users.

```py import requests import json GIT_INSTANCE_URL = 'https://codeberg.org' # With `read:repository` scope. TOKEN = 'CENSORED' headers = { 'Authorization': f'token {TOKEN}' } def getApi(url, params): response = requests.get(f'{GIT_INSTANCE_URL}/api/v1/{url}', headers = headers, params = params) return response.json() repositories = {} page = 1 while True: reposData = getApi('repos/search', {'limit': 50, 'page': page}) repos = reposData['data'] if repos == []: break for repo in repos: login = repo['owner']['login'] repositories[login] = repositories.get(login, 0) + 1 print(page, sum(repositories.values())) page += 1 with open('repositories.json', 'w') as f: json.dump(repositories, f, indent = 4) with open('repositories.json') as f: repositories = json.load(f) for user in repositories: numberofRepositories = repositories[user] if numberofRepositories >= 100: print(user, numberofRepositories) ``` There are about 20 * 4,323 = 86,460 repositories according to https://codeberg.org/explore/repos. Found 86,592 with above algorithm. Only: - sciss 183 - MBSolutions 444 seem reachable and having exceeded this limit. Both have been active in the last 2 weeks. https://codeberg.org claims 125,129 projects and 98,121 users.
Author
Owner

I asked on Codeberg Matrix:

Hello, I am new to this Matrix but not to Codeberg (I joined on Dec 5, 2022). I now have 100 repositories on Codeberg with my username Benjamin_Loison. I am unable to create any more repository at codeberg.org/repo/create as I reached the limit (more precisely I get The owner has already reached the limit of 100 repositories.). Would it be possible to increase to 1,000 or even 10,000 the Maximum Number of Repositories for my account please? As far as I understand it should be doable for an admin at codeberg.org/admin/users/74932/edit. I mainly reached the limit as I fork repositories (without code importation if I do not refer to it precisely or modify it) to write down issues I have related to them, Benjamin_Loison/firefox/issues is a typical example of how I use repositories. Thank you in advance.

EDIT: Let me know if it is not the right place or right way of asking.

[I asked on Codeberg Matrix](https://matrix.to/#/!wkyjxWeAOBpKMvHbno:matrix.org/$RHZM-E8FsCAQPC8Sar9kDTYjvRUoiFcnaKEezO7TFgI): > Hello, I am new to this Matrix but not to Codeberg ([I joined on Dec 5, 2022](https://codeberg.org/Benjamin_Loison)). [I now have 100 repositories](https://codeberg.org/Benjamin_Loison?tab=repositories) on Codeberg with [my username Benjamin\_Loison](https://codeberg.org/Benjamin_Loison). I am unable to create any more repository at [codeberg.org/repo/create](https://codeberg.org/repo/create) as I reached the limit (more precisely I get `The owner has already reached the limit of 100 repositories.`). Would it be possible to increase to 1,000 or even 10,000 the `Maximum Number of Repositories` for my account please? [As far as I understand](https://gitea.lemnoslife.com/Benjamin_Loison/codeberg/issues/1) it should be doable for an admin at [codeberg.org/admin/users/74932/edit](https://codeberg.org/admin/users/74932/edit). I mainly reached the limit as I _fork_ repositories (without code importation if I do not refer to it precisely or modify it) to write down issues I have related to them, [Benjamin\_Loison/firefox/issues](https://codeberg.org/Benjamin_Loison/firefox/issues) is a typical example of how I use repositories. Thank you in advance. > > **EDIT**: Let me know if it is not the right place or right way of asking.
Author
Owner

Note that the most repositories user have 468.

Note that the most repositories user have 468.
Author
Owner

I do not notice anymore the error message on https://codeberg.org/repo/create following the treatment of my request.

I do not notice anymore the error message on https://codeberg.org/repo/create following [the treatment of my request](https://codeberg.org/Codeberg-e.V./requests/issues/212#issuecomment-1728870).
Author
Owner

Note that it is unclear to me how we can retrieve the current user number of repositories limit.

Looking at the source code seems to be the most appropriate way to answer this question.

/user API endpoint does not return this information, even when selecting All (public, private, and limited) instead of Public only on codeberg.org/user/settings/applications.

Note that it is unclear to me how we can retrieve the current user number of repositories limit. Looking at the source code seems to be the most appropriate way to answer this question. `/user` API endpoint does not return this information, even when selecting `All (public, private, and limited) ` instead of `Public only` on [codeberg.org/user/settings/applications](https://codeberg.org/user/settings/applications).
Author
Owner
Related to [Benjamin-Loison/opentimestamps-client/issues/12](https://github.com/Benjamin-Loison/opentimestamps-client/issues/12).
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Benjamin_Loison/codeberg#1
No description provided.