(client: BitbucketClient)
| 571 | } |
| 572 | |
| 573 | async function serverGetAllRepos(client: BitbucketClient): Promise<{repos: ServerRepository[], warnings: string[]}> { |
| 574 | logger.debug(`Fetching all repos from Bitbucket Server...`); |
| 575 | const path = `/rest/api/1.0/repos` as ServerGetRequestPath; |
| 576 | const { durationMs, data } = await measure(async () => { |
| 577 | const fetchFn = () => getPaginatedServer<ServerRepository>(path, async (url, start) => { |
| 578 | const { data } = await client.apiClient.GET(url, { |
| 579 | params: { query: { limit: 1000, start } } |
| 580 | }); |
| 581 | return data; |
| 582 | }); |
| 583 | return fetchWithRetry(fetchFn, `all repos`, logger); |
| 584 | }); |
| 585 | logger.debug(`Found ${data.length} total repos in ${durationMs}ms.`); |
| 586 | return { repos: data, warnings: [] }; |
| 587 | } |
| 588 | |
| 589 | export function serverShouldExcludeRepo(repo: BitbucketRepository, config: BitbucketConnectionConfig): boolean { |
| 590 | const serverRepo = repo as ServerRepository; |
no test coverage detected