MCPcopy Create free account
hub / github.com/sourcebot-dev/sourcebot / collectGerritConfig

Function collectGerritConfig

packages/setupWizard/src/gerrit.ts:6–37  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4import { multiInput } from './utils.js';
5
6export async function collectGerritConfig(): Promise<CollectResult> {
7 const url = await input({
8 message: 'Gerrit URL (e.g. https://gerrit.example.com)',
9 validate: (v) => {
10 if (!v?.trim()) {
11 return 'URL is required';
12 }
13 if (!/^https?:\/\//.test(v)) {
14 return 'Must start with http:// or https://';
15 }
16 return true;
17 },
18 });
19
20 const config: GerritConnectionConfig = {
21 type: 'gerrit',
22 url,
23 };
24
25 const indexAll = await confirm({
26 message: 'Index all projects?',
27 default: true,
28 });
29
30 if (!indexAll) {
31 config.projects = await multiInput({
32 message: 'Projects to index',
33 });
34 }
35
36 return { connections: [{ config }], env: {} };
37}

Callers 1

mainFunction · 0.85

Calls 1

multiInputFunction · 0.85

Tested by

no test coverage detected