GET /orgs/{org}/repos lists only repos of an organization that enable code #12210

Closed
opened 2025-11-02 10:02:13 -06:00 by GiteaMirror · 8 comments
Owner

Originally created by @VicOsewe on GitHub (Dec 15, 2023).

Description

The REST API only returns repos with codeview enabled in the settings.

Gitea Version

1.21.0

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

Running inside Docker container.

Database

PostgreSQL

Originally created by @VicOsewe on GitHub (Dec 15, 2023). ### Description The REST API only returns repos with `codeview` enabled in the settings. ### Gitea Version 1.21.0 ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? Running inside Docker container. ### Database PostgreSQL
GiteaMirror added the type/bugmodifies/api labels 2025-11-02 10:02:13 -06:00
Author
Owner

@lunny commented on GitHub (Dec 25, 2023):

It's by design. Github also doesn't support list all repositories. https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#list-organization-repositories

@lunny commented on GitHub (Dec 25, 2023): It's by design. Github also doesn't support list all repositories. https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#list-organization-repositories
Author
Owner

@KlavsKlavsen commented on GitHub (Dec 27, 2023):

@lunny where in above link to github does it state that it doesn't in fact list all repositories? (it states that it returns all types by default)
and where in gitea docs does it state that getrepos - specificly does not in fact support returning all repos? Its not even that its not the default to return all (as it is for github) - its not possible to list the repos if codeview isn't enabled for it.

@KlavsKlavsen commented on GitHub (Dec 27, 2023): @lunny where in above link to github does it state that it doesn't in fact list all repositories? (it states that it returns all types by default) and where in gitea docs does it state that getrepos - specificly does not in fact support returning all repos? Its not even that its not the default to return all (as it is for github) - its not possible to list the repos if codeview isn't enabled for it.
Author
Owner

@eeyrjmr commented on GitHub (Dec 27, 2023):

@lunny where in above link to github does it state that it doesn't in fact list all repositories? (it states that it returns all types by default) and where in gitea docs does it state that getrepos - specificly does not in fact support returning all repos? Its not even that its not the default to return all (as it is for github) - its not possible to list the repos if codeview isn't enabled for it.

by the fact github doesn't has the concept of disabling codeview thus all repositories return code.
You could say Gitea offering a non-codeview repository is an enhancement (a good one) and thus this request is more of an enhancement not a bug

@eeyrjmr commented on GitHub (Dec 27, 2023): > @lunny where in above link to github does it state that it doesn't in fact list all repositories? (it states that it returns all types by default) and where in gitea docs does it state that getrepos - specificly does not in fact support returning all repos? Its not even that its not the default to return all (as it is for github) - its not possible to list the repos if codeview isn't enabled for it. by the fact github doesn't has the concept of disabling codeview thus all repositories return code. You could say Gitea offering a non-codeview repository is an enhancement (a good one) and thus this request is more of an enhancement not a bug
Author
Owner

@KlavsKlavsen commented on GitHub (Dec 27, 2023):

seriously? so you call it ListRepos.. and it doesn't in fact list all repos - and you consider that a feature?

a repo is MORE than code (in both gitea and github) - and in github you get ALL repos - unless you choose repos of a specific type.

Suggested solution IMHO would be to:
1)add a "type" filter - and default to all (like github does) - or
2)remove the (un-mentioned in docs) filtering of repos shown, based on if they have code or not.

We'll gladly contribute a PR to remove the filtering out of repos that don't have "codeview" enabled - so it does what the docs say it does (and what you would expect).

Or do you seriously mean that the codeview setting - decides wether or not it is in fact a repo? (and thus should decide if its shown in repolist endpoint) ? If so - pls. expain why its still shown in repolist in UI?

If its shown in repolist in UI - it should be returned in repolist from API by default.

@KlavsKlavsen commented on GitHub (Dec 27, 2023): seriously? so you call it ListRepos.. and it doesn't in fact list all repos - and you consider that a feature? a repo is MORE than code (in both gitea and github) - and in github you get ALL repos - unless you choose repos of a specific type. Suggested solution IMHO would be to: 1)add a "type" filter - and default to all (like github does) - or 2)remove the (un-mentioned in docs) filtering of repos shown, based on if they have code or not. We'll gladly contribute a PR to remove the filtering out of repos that don't have "codeview" enabled - so it does what the docs say it does (and what you would expect). Or do you seriously mean that the codeview setting - decides wether or not it is in fact a repo? (and thus should decide if its shown in repolist endpoint) ? If so - pls. expain why its still shown in repolist in UI? If its shown in repolist in UI - it should be returned in repolist from API by default.
Author
Owner

@GiteaBot commented on GitHub (Jan 26, 2024):

We close issues that need feedback from the author if there were no new comments for a month. 🍵

@GiteaBot commented on GitHub (Jan 26, 2024): We close issues that need feedback from the author if there were no new comments for a month. :tea:
Author
Owner

@KlavsKlavsen commented on GitHub (Jan 26, 2024):

This isn't waiting on feedback from me afaik?

@KlavsKlavsen commented on GitHub (Jan 26, 2024): This isn't waiting on feedback from me afaik?
Author
Owner

@delvh commented on GitHub (Jan 26, 2024):

I do tend to agree that it seems rather weird that ListOrgRepos only returns repos where code is enabled.

@KlavsKlavsen the issue was closed because the label was never removed.
This seems to be caused especially by a miscommunication:
I think lunny's focus was the does not list **all** repos, while yours and the focus of the issue reporter was on only repos with code enabled.

However, as I said, I consider this to be a bug as well, thus I'm reopening this issue and removing the label.
PR fixes are always welcome.

@delvh commented on GitHub (Jan 26, 2024): I do tend to agree that it seems rather weird that `ListOrgRepos` only returns repos where code is enabled. @KlavsKlavsen the issue was closed because the label was never removed. This seems to be caused especially by a miscommunication: I think lunny's focus was the `does not list **all** repos`, while yours and the focus of the issue reporter was on `only repos with code enabled`. However, as I said, I consider this to be a bug as well, thus I'm reopening this issue and removing the label. PR fixes are always welcome.
Author
Owner

@KlavsKlavsen commented on GitHub (Jan 26, 2024):

Great. I'll ask @VicOsewe to submit a PR, removing the limitation (so docs can stay the same :) - she's also an employee of Obmondo.com

@KlavsKlavsen commented on GitHub (Jan 26, 2024): Great. I'll ask @VicOsewe to submit a PR, removing the limitation (so docs can stay the same :) - she's also an employee of Obmondo.com
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#12210