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

Function compileGithubConfig

packages/backend/src/repoCompileUtils.ts:57–89  ·  view source on GitHub ↗
(
    config: GithubConnectionConfig,
    connectionId: number,
    signal: AbortSignal)

Source from the content-addressed store, hash-verified

55}
56
57export const compileGithubConfig = async (
58 config: GithubConnectionConfig,
59 connectionId: number,
60 signal: AbortSignal): Promise<CompileResult> => {
61 const gitHubReposResult = await getGitHubReposFromConfig(config, signal);
62 const gitHubRepos = gitHubReposResult.repos;
63 const warnings = gitHubReposResult.warnings;
64
65 const hostUrl = (config.url ?? 'https://github.com').replace(/\/+$/, '');
66
67 const repos = gitHubRepos.map((repo) => {
68 const record = createGitHubRepoRecord({
69 repo,
70 hostUrl,
71 branches: config.revisions?.branches ?? undefined,
72 tags: config.revisions?.tags ?? undefined,
73 })
74
75 return {
76 ...record,
77 connections: {
78 create: {
79 connectionId: connectionId,
80 }
81 },
82 };
83 })
84
85 return {
86 repoData: repos,
87 warnings,
88 };
89}
90
91export const createGitHubRepoRecord = ({
92 repo,

Callers 1

runJobMethod · 0.85

Calls 2

getGitHubReposFromConfigFunction · 0.85
createGitHubRepoRecordFunction · 0.85

Tested by

no test coverage detected