MCPcopy Index your code
hub / github.com/sourcebot-dev/sourcebot / serverGetAllRepos

Function serverGetAllRepos

packages/backend/src/bitbucket.ts:573–587  ·  view source on GitHub ↗
(client: BitbucketClient)

Source from the content-addressed store, hash-verified

571}
572
573async 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
589export function serverShouldExcludeRepo(repo: BitbucketRepository, config: BitbucketConnectionConfig): boolean {
590 const serverRepo = repo as ServerRepository;

Callers 1

Calls 2

measureFunction · 0.70
fetchWithRetryFunction · 0.70

Tested by

no test coverage detected