Class GiteaApiClient

Object
GiteaApiClient

@Component public class GiteaApiClient extends Object
REST client for the Gitea API. Uses a dedicated RestTemplate (not the vitruvioRestTemplate) with Authorization: token header for Gitea authentication.
  • Constructor Details

    • GiteaApiClient

      public GiteaApiClient()
  • Method Details

    • testConnection

      public String testConnection(String baseUrl, String token)
      Tests connectivity by calling the authenticated user endpoint.
      Returns:
      the authenticated username
      Throws:
      GiteaApiClient.GiteaApiException - if the connection or authentication fails
    • listRepos

      public List<GiteaRepo> listRepos(String baseUrl, String token)
      Lists all repositories accessible to the authenticated user. Paginates through all pages automatically.
    • listBranches

      public List<String> listBranches(String baseUrl, String token, String repoFullName)
      Lists branches for a specific repository.
    • listDeployTeamRepos

      public List<GiteaRepo> listDeployTeamRepos(String baseUrl, String token)
      Lists repositories that belong to the "deploy" team of the "davinti" org. Only repos owned by "davinti" are returned.
    • getCommitStatus

      public String getCommitStatus(String baseUrl, String token, String repoFullName, String sha)
      Returns the combined commit status for a given SHA. Gitea returns: "success", "pending", "failure", "error", or "warning".
      Returns:
      the combined state string, or null if no statuses exist