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

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

Closed
VicOsewe opened this issue Dec 15, 2023 · 8 comments · Fixed by #30817
Closed

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

VicOsewe opened this issue Dec 15, 2023 · 8 comments · Fixed by #30817
Labels
modifies/api This PR adds API routes or modifies them type/bug

Comments

@VicOsewe
Copy link

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

@lunny lunny added type/proposal The new feature has not been accepted yet but needs to be discussed first. and removed type/bug labels Dec 25, 2023
@lunny
Copy link
Member

lunny commented 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 lunny added the issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail label Dec 25, 2023
@KlavsKlavsen
Copy link

@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.

@eeyrjmr
Copy link
Contributor

eeyrjmr commented 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

@KlavsKlavsen
Copy link

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.

@GiteaBot
Copy link
Collaborator

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

@KlavsKlavsen
Copy link

This isn't waiting on feedback from me afaik?

@delvh
Copy link
Member

delvh commented 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 delvh reopened this Jan 26, 2024
@delvh delvh added type/bug modifies/api This PR adds API routes or modifies them and removed type/proposal The new feature has not been accepted yet but needs to be discussed first. issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail labels Jan 26, 2024
@delvh delvh changed the title ListOrgRepos - list the repositories of an organization(GET /orgs/{org}/repos) does not list ALL repos. GET /orgs/{org}/repos lists only repos of an organization that enable code Jan 26, 2024
@KlavsKlavsen
Copy link

KlavsKlavsen commented 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

lunny pushed a commit that referenced this issue May 3, 2024
…30817)

We should be listing all repositories by default.

Fixes #28483.
GiteaBot pushed a commit to GiteaBot/gitea that referenced this issue May 3, 2024
wxiaoguang pushed a commit that referenced this issue May 3, 2024
…30817) (#30848)

Backport #30817 by kemzeb

We should be listing all repositories by default.

Fixes #28483.

Co-authored-by: Kemal Zebari <60799661+kemzeb@users.noreply.github.com>
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Aug 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
modifies/api This PR adds API routes or modifies them type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants