11package net.leanix.githubagent.client
22
33import feign.Response
4+ import io.github.resilience4j.retry.annotation.Retry
45import net.leanix.githubagent.config.FeignClientConfig
56import net.leanix.githubagent.dto.ArtifactsListResponse
67import net.leanix.githubagent.dto.GitHubAppResponse
@@ -30,45 +31,52 @@ interface GitHubClient {
3031 @RequestHeader(" Accept" ) accept : String = "application/vnd.github.v3+json"
3132 ): GitHubAppResponse
3233
34+ @Retry(name = " secondary_rate_limit" )
3335 @GetMapping(" /api/v3/app/installations" )
3436 fun getInstallations (
3537 @RequestHeader(" Authorization" ) jwt : String ,
3638 @RequestParam(" per_page" , defaultValue = " 30" ) perPage : Int ,
3739 @RequestParam(" page" , defaultValue = " 1" ) page : Int
3840 ): List <Installation >
3941
42+ @Retry(name = " secondary_rate_limit" )
4043 @GetMapping(" /api/v3/app/installations/{installationId}" )
4144 fun getInstallation (
4245 @PathVariable(" installationId" ) installationId : Long ,
4346 @RequestHeader(" Authorization" ) jwt : String
4447 ): Installation
4548
49+ @Retry(name = " secondary_rate_limit" )
4650 @PostMapping(" /api/v3/app/installations/{installationId}/access_tokens" )
4751 fun createInstallationToken (
4852 @PathVariable(" installationId" ) installationId : Long ,
4953 @RequestHeader(" Authorization" ) jwt : String ,
5054 @RequestBody emptyBody : String = ""
5155 ): InstallationTokenResponse
5256
57+ @Retry(name = " secondary_rate_limit" )
5358 @GetMapping(" /api/v3/organizations" )
5459 fun getOrganizations (
5560 @RequestHeader(" Authorization" ) jwt : String ,
5661 @RequestParam(" per_page" , defaultValue = " 30" ) perPage : Int ,
5762 @RequestParam(" since" , defaultValue = " 1" ) since : Int
5863 ): List <Organization >
5964
65+ @Retry(name = " secondary_rate_limit" )
6066 @GetMapping(" /api/v3/orgs/{org}/repos" )
6167 fun getRepositories (
6268 @PathVariable(" org" ) org : String ,
6369 @RequestHeader(" Authorization" ) token : String
6470 ): List <Repository >
6571
72+ @Retry(name = " secondary_rate_limit" )
6673 @GetMapping(" /api/v3/search/code" )
6774 fun searchManifestFiles (
6875 @RequestHeader(" Authorization" ) token : String ,
6976 @RequestParam(" q" ) query : String ,
7077 ): GitHubSearchResponse
7178
79+ @Retry(name = " secondary_rate_limit" )
7280 @GetMapping(" /api/v3/repos/{owner}/{repo}/actions/runs/{runId}/artifacts" )
7381 fun getRunArtifacts (
7482 @PathVariable(" owner" ) owner : String ,
@@ -77,6 +85,7 @@ interface GitHubClient {
7785 @RequestHeader(" Authorization" ) token : String
7886 ): ArtifactsListResponse
7987
88+ @Retry(name = " secondary_rate_limit" )
8089 @GetMapping(" /api/v3/repos/{owner}/{repo}/actions/artifacts/{artifactId}/zip" )
8190 fun downloadArtifact (
8291 @PathVariable(" owner" ) owner : String ,
0 commit comments