harness / gitness

Gitness is an Open Source developer platform with Source Control management, Continuous Integration and Continuous Delivery.
https://gitness.com
Apache License 2.0
31.89k stars 2.78k forks source link

Gitness Api #3526

Closed Rutik7066 closed 1 month ago

Rutik7066 commented 1 month ago

I am having a problem fetching all repos of the project and personal repos (I don't know if gitness supports personal repos which do not belong to any project but only belong to the user like GitHub). I have checked all endpoints, but unfortunately, I did not find anything useful.

bradrydzewski commented 1 month ago

I don't know if gitness supports personal repos which do not belong to any project but only belong to the user like GitHub

The short answer is no. There is no concept of a personal repository in Gitness.

Like GitHub, all repositories in Gitness must belong to a namespace (e.g. github.com/bradrydzewski would be the equivalent of gitness.com/bradrydzewski). The main difference is that GitHub creates a namespace automatically for every user account and GItness does not. If you want a personal namespace in Gitness, you would create a project with only you as the member.

Rutik7066 commented 1 month ago

How do I fetch all repositories belonging to the project?

bradrydzewski commented 1 month ago

This is the endpoint for returning a list of all project (space) repositories

http://localhost:3000/api/v1/spaces/{space}/+/repos?page=1&limit=20

Note that the Gitness user interface uses the API. So when in doubt, you can use Chrome Developer Tools to determine which endpoints are being called to fetch data.

Screenshot 2024-06-04 at 10 47 35 AM

There is also an interactive Swagger frontend that you can use to explore the API

http://localhost:3000/swagger#/space/listRepos