@jmanuelcorral/bond-app 0.1.6 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +78 -15
- package/app/mods/bond-agents/main.js +3 -3
- package/app/mods/bond-agents/model.js +24 -2
- package/app/mods/bond-board/main.js +327 -18
- package/app/mods/bond-board/model.js +74 -6
- package/app/mods/bond-settings/main.js +66 -3
- package/bin/bond-app.js +3 -2
- package/package.json +1 -1
- package/runner/versions.env +3 -1
- package/scripts/app-install.ts +262 -26
- package/src/cli.ts +512 -21
- package/src/config.ts +15 -3
- package/src/core/agy-login.ts +2 -1
- package/src/core/delivery.ts +122 -5
- package/src/core/doctor.ts +757 -0
- package/src/core/hub-session.ts +108 -91
- package/src/core/hub.ts +40 -8
- package/src/core/orchestrator.ts +755 -119
- package/src/core/paths.ts +107 -0
- package/src/core/permissions.ts +143 -0
- package/src/core/pr-source.ts +147 -0
- package/src/core/service-windows.ts +180 -0
- package/src/core/service.ts +861 -0
- package/src/core/setup-install.ts +1401 -0
- package/src/db/database.ts +13 -6
- package/src/db/ticket-repo.ts +29 -7
- package/src/runner/azure-devops-client.ts +113 -3
- package/src/runner/docker-client.ts +34 -0
- package/src/runner/github-client.ts +118 -0
- package/src/server/app.ts +94 -7
- package/src/types.ts +11 -0
package/src/db/database.ts
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import { DatabaseSync } from 'node:sqlite';
|
|
2
2
|
import fs from 'node:fs';
|
|
3
3
|
import path from 'node:path';
|
|
4
|
+
import { restrictPathSync } from '../core/permissions.ts';
|
|
4
5
|
|
|
5
6
|
export function initDatabase(dbPath: string): DatabaseSync {
|
|
6
7
|
if (dbPath !== ':memory:') {
|
|
7
8
|
const dir = path.dirname(path.resolve(dbPath));
|
|
8
|
-
// N8: Only create with 0700 if directory does not exist yet; never
|
|
9
|
+
// N8: Only create with 0700 / user ACL if directory does not exist yet; never alter pre-existing directories
|
|
9
10
|
if (!fs.existsSync(dir)) {
|
|
10
11
|
fs.mkdirSync(dir, { recursive: true, mode: 0o700 });
|
|
12
|
+
try {
|
|
13
|
+
restrictPathSync(dir, 0o700);
|
|
14
|
+
} catch {
|
|
15
|
+
// ignore
|
|
16
|
+
}
|
|
11
17
|
}
|
|
12
18
|
}
|
|
13
19
|
|
|
@@ -17,13 +23,13 @@ export function initDatabase(dbPath: string): DatabaseSync {
|
|
|
17
23
|
if (dbPath !== ':memory:') {
|
|
18
24
|
db.exec('PRAGMA journal_mode = WAL;');
|
|
19
25
|
try {
|
|
20
|
-
if (fs.existsSync(dbPath))
|
|
26
|
+
if (fs.existsSync(dbPath)) restrictPathSync(dbPath, 0o600);
|
|
21
27
|
const walPath = `${dbPath}-wal`;
|
|
22
|
-
if (fs.existsSync(walPath))
|
|
28
|
+
if (fs.existsSync(walPath)) restrictPathSync(walPath, 0o600);
|
|
23
29
|
const shmPath = `${dbPath}-shm`;
|
|
24
|
-
if (fs.existsSync(shmPath))
|
|
30
|
+
if (fs.existsSync(shmPath)) restrictPathSync(shmPath, 0o600);
|
|
25
31
|
} catch {
|
|
26
|
-
// ignore
|
|
32
|
+
// ignore permission errors
|
|
27
33
|
}
|
|
28
34
|
}
|
|
29
35
|
db.exec('PRAGMA foreign_keys = ON;');
|
|
@@ -187,7 +193,8 @@ export function initDatabase(dbPath: string): DatabaseSync {
|
|
|
187
193
|
}
|
|
188
194
|
// P5: a ticket points at an existing hub or lists its repos. Old one-repo tickets keep
|
|
189
195
|
// `repos` NULL and read as a list of one (repo_url, base_branch): nothing to rewrite.
|
|
190
|
-
|
|
196
|
+
// Plan bond-app-ticket-desde-pr: source_pr_url (the PR or branch a ticket starts from).
|
|
197
|
+
for (const col of ['hub_url', 'hub_base', 'repos', 'repo_agents', 'issue_url', 'story', 'source_pr_url']) {
|
|
191
198
|
if (!ticketCols.some((c) => c.name === col)) db.exec(`ALTER TABLE tickets ADD COLUMN ${col} TEXT;`);
|
|
192
199
|
}
|
|
193
200
|
// P9: team_engine ('hc' | 'herdr'). Existing tickets are backfilled to 'herdr' (legacy TUI mode);
|
package/src/db/ticket-repo.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { DatabaseSync } from 'node:sqlite';
|
|
|
2
2
|
import { randomUUID } from 'node:crypto';
|
|
3
3
|
import { REPO_NAME_RE } from '../core/hub.ts';
|
|
4
4
|
import { azureRepoUrl, parseAzureRepoUrl } from '../core/repo-host.ts';
|
|
5
|
+
import { parseSourceUrl, prTicketId } from '../core/pr-source.ts';
|
|
5
6
|
import {
|
|
6
7
|
validateGitHubUrl,
|
|
7
8
|
isValidAgent,
|
|
@@ -82,9 +83,11 @@ export function normalizeLayout(rawInput: LayoutInput): TicketLayout {
|
|
|
82
83
|
if (input.repos !== undefined && !hasRepos) throw new Error("Field 'repos' must be an array");
|
|
83
84
|
|
|
84
85
|
if (hasHub) {
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
const rawHubUrl = String(input.hub_url).trim();
|
|
87
|
+
const azure = parseAzureRepoUrl(rawHubUrl);
|
|
88
|
+
const hubUrl = azure ? azureRepoUrl(azure) : rawHubUrl;
|
|
89
|
+
if (!validateGitHubUrl(hubUrl) && !azure) {
|
|
90
|
+
throw new Error(`Invalid hub_url '${hubUrl}'. Only https://github.com/<owner>/<repo>[.git] or https://dev.azure.com/<org>/<project>/_git/<repo> URLs are allowed.`);
|
|
88
91
|
}
|
|
89
92
|
const hubBase = input.hub_base || 'main';
|
|
90
93
|
if (!validateBranchName(hubBase)) throw new Error(`Invalid hub_base '${hubBase}'`);
|
|
@@ -190,9 +193,20 @@ export class TicketRepository {
|
|
|
190
193
|
|
|
191
194
|
// D1: the linked issue decides the id unless one is given explicitly; the same issue
|
|
192
195
|
// cannot back two tickets.
|
|
193
|
-
|
|
196
|
+
// Plan bond-app-ticket-desde-pr (D3): a PR names the ticket the same way, and a PR
|
|
197
|
+
// backs one ticket only (the id, and the stored URL for a caller-given id).
|
|
198
|
+
const sourceUrl = input.source_pr_url ? String(input.source_pr_url).trim() : null;
|
|
199
|
+
const source = sourceUrl ? parseSourceUrl(sourceUrl) : null;
|
|
200
|
+
if (sourceUrl && !source) throw new Error(`Invalid source_pr_url '${sourceUrl}': a GitHub or Azure Repos PR or branch URL`);
|
|
201
|
+
if (source && !input.target_branch) throw new Error("A ticket from a PR or branch needs its 'target_branch'");
|
|
202
|
+
if (source?.kind === 'pr' && this.db.prepare('SELECT id FROM tickets WHERE source_pr_url = ?').get(sourceUrl)) {
|
|
203
|
+
throw new Error(`There is already a ticket for this pull request: ${sourceUrl}`);
|
|
204
|
+
}
|
|
205
|
+
const derivedId = input.id ? null : issueTicketId(input.issue_url) ?? prTicketId(source);
|
|
194
206
|
if (derivedId && this.db.prepare('SELECT 1 FROM tickets WHERE id = ?').get(derivedId)) {
|
|
195
|
-
throw new Error(
|
|
207
|
+
throw new Error(source && !issueTicketId(input.issue_url)
|
|
208
|
+
? `There is already a ticket for this pull request: ${derivedId}`
|
|
209
|
+
: `There is already a ticket for this issue: ${derivedId}`);
|
|
196
210
|
}
|
|
197
211
|
const id = input.id || derivedId || `ticket-${randomUUID().slice(0, 8)}`;
|
|
198
212
|
const now = new Date().toISOString();
|
|
@@ -246,8 +260,8 @@ export class TicketRepository {
|
|
|
246
260
|
INSERT INTO tickets (
|
|
247
261
|
id, title, description, repo_url, base_branch, target_branch,
|
|
248
262
|
budget_usd, timeout_minutes, agent, model, prompt, verify_commands,
|
|
249
|
-
hub_url, hub_base, repos, repo_agents, issue_url, story, team_engine, bondify, docker, status, created_at, updated_at
|
|
250
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
263
|
+
hub_url, hub_base, repos, repo_agents, issue_url, story, source_pr_url, team_engine, bondify, docker, status, created_at, updated_at
|
|
264
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
251
265
|
`);
|
|
252
266
|
|
|
253
267
|
const teamEngine = input.team_engine === 'herdr' ? 'herdr' : 'hc';
|
|
@@ -271,6 +285,7 @@ export class TicketRepository {
|
|
|
271
285
|
Object.keys(repoAgents).length ? JSON.stringify(repoAgents) : null,
|
|
272
286
|
input.issue_url ? String(input.issue_url).trim() : null,
|
|
273
287
|
input.story ?? null,
|
|
288
|
+
sourceUrl,
|
|
274
289
|
teamEngine,
|
|
275
290
|
bondify ? 1 : 0,
|
|
276
291
|
input.docker === true ? 1 : 0,
|
|
@@ -315,6 +330,12 @@ export class TicketRepository {
|
|
|
315
330
|
repos: existing.hub_url || existing.mode === 'single' ? null : existing.repos,
|
|
316
331
|
};
|
|
317
332
|
const layoutKeys = LAYOUT_KEYS.filter((k) => (updates as Record<string, unknown>)[k] !== undefined);
|
|
333
|
+
// Plan bond-app-ticket-desde-pr: a ticket bound to a PR or branch keeps that repo and
|
|
334
|
+
// those branches (they are the PR's); the link itself is not editable either.
|
|
335
|
+
if (existing.source_pr_url && (layoutKeys.length > 0 || (updates.target_branch !== undefined && updates.target_branch !== existing.target_branch))) {
|
|
336
|
+
throw new Error('This ticket works on an existing PR or branch: its repo and branches come from it');
|
|
337
|
+
}
|
|
338
|
+
delete (updates as Record<string, unknown>).source_pr_url;
|
|
318
339
|
if (layoutKeys.length > 0) {
|
|
319
340
|
// Review M5: a partial change keeps the rest of the same kind of layout (a new
|
|
320
341
|
// repo_url keeps its base, hub_base alone keeps the hub); another kind replaces it.
|
|
@@ -437,6 +458,7 @@ export class TicketRepository {
|
|
|
437
458
|
description: row.description ? String(row.description) : undefined,
|
|
438
459
|
issue_url: row.issue_url ? String(row.issue_url) : null,
|
|
439
460
|
story: row.story === null || row.story === undefined ? null : String(row.story),
|
|
461
|
+
source_pr_url: row.source_pr_url ? String(row.source_pr_url) : null,
|
|
440
462
|
repo_url: repoUrl,
|
|
441
463
|
base_branch: baseBranch,
|
|
442
464
|
hub_url: hubUrl,
|
|
@@ -70,9 +70,9 @@ export class AzureDevOpsClient {
|
|
|
70
70
|
* Who the PAT belongs to in that organization (connectionData). Throws a clear error on
|
|
71
71
|
* a wrong PAT or organization: the caller shows it in Ajustes.
|
|
72
72
|
*/
|
|
73
|
-
async whoAmI(pat: string, orgUrl: string): Promise<{ name: string; email?: string }> {
|
|
73
|
+
async whoAmI(pat: string, orgUrl: string): Promise<{ name: string; email?: string; id?: string }> {
|
|
74
74
|
const res = await this.call(pat, 'GET', `${orgUrl}/_apis/connectionData?${API}-preview`);
|
|
75
|
-
const user = (res.data as { authenticatedUser?: { providerDisplayName?: string; properties?: { Account?: { $value?: string } } } } | null)?.authenticatedUser;
|
|
75
|
+
const user = (res.data as { authenticatedUser?: { id?: string; providerDisplayName?: string; properties?: { Account?: { $value?: string } } } } | null)?.authenticatedUser;
|
|
76
76
|
if (res.status !== 200 || !user || !user.providerDisplayName || user.providerDisplayName === 'Anonymous') {
|
|
77
77
|
throw new AzureDevOpsApiError(
|
|
78
78
|
res.status === 401 || res.status === 203 || !user || user?.providerDisplayName === 'Anonymous'
|
|
@@ -82,7 +82,7 @@ export class AzureDevOpsClient {
|
|
|
82
82
|
);
|
|
83
83
|
}
|
|
84
84
|
const email = user.properties?.Account?.$value;
|
|
85
|
-
return { name: user.providerDisplayName, ...(email ? { email } : {}) };
|
|
85
|
+
return { name: user.providerDisplayName, ...(email ? { email } : {}), ...(user.id ? { id: user.id } : {}) };
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
/**
|
|
@@ -131,6 +131,116 @@ export class AzureDevOpsClient {
|
|
|
131
131
|
return out.sort((a, b) => `${a.project}/${a.name}`.localeCompare(`${b.project}/${b.name}`));
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
+
/** The web URL of a PR (what the user copies from the browser). */
|
|
135
|
+
pullRequestWebUrl(repoUrl: string, id: number): string {
|
|
136
|
+
const ref = this.ref(repoUrl);
|
|
137
|
+
return `${ref.orgUrl}/${ref.project}/_git/${ref.repo}/pullrequest/${id}`;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Plan bond-app-ticket-desde-pr P1: one pull request, for a ticket that starts from it —
|
|
142
|
+
* its branches, state, whether it comes from a fork, and its title and description.
|
|
143
|
+
*/
|
|
144
|
+
async getPullRequest(pat: string, repoUrl: string, id: number): Promise<{
|
|
145
|
+
number: number; url: string; title: string; body: string; head: string; base: string;
|
|
146
|
+
state: 'open' | 'closed' | 'merged'; draft: boolean; is_fork: boolean; author?: string;
|
|
147
|
+
}> {
|
|
148
|
+
const ref = this.ref(repoUrl);
|
|
149
|
+
const res = await this.call(pat, 'GET', this.repoApi(ref, `/pullrequests/${id}?${API}`));
|
|
150
|
+
if (res.status !== 200) {
|
|
151
|
+
const msg = (res.data as { message?: string } | null)?.message || `HTTP ${res.status}`;
|
|
152
|
+
throw new AzureDevOpsApiError(`Azure DevOps pull request ${id}: ${msg}`, res.status);
|
|
153
|
+
}
|
|
154
|
+
const d = res.data as {
|
|
155
|
+
pullRequestId: number; title?: string; description?: string; status?: string; isDraft?: boolean;
|
|
156
|
+
sourceRefName?: string; targetRefName?: string; forkSource?: unknown; createdBy?: { displayName?: string };
|
|
157
|
+
};
|
|
158
|
+
const branch = (r?: string) => String(r ?? '').replace(/^refs\/heads\//, '');
|
|
159
|
+
return {
|
|
160
|
+
number: d.pullRequestId,
|
|
161
|
+
url: this.pullRequestWebUrl(repoUrl, d.pullRequestId),
|
|
162
|
+
title: d.title || '',
|
|
163
|
+
body: String(d.description ?? '').slice(0, 8000),
|
|
164
|
+
head: branch(d.sourceRefName),
|
|
165
|
+
base: branch(d.targetRefName),
|
|
166
|
+
state: d.status === 'active' ? 'open' : d.status === 'completed' ? 'merged' : 'closed',
|
|
167
|
+
draft: Boolean(d.isDraft),
|
|
168
|
+
is_fork: Boolean(d.forkSource),
|
|
169
|
+
...(d.createdBy?.displayName ? { author: d.createdBy.displayName } : {}),
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* P1: active pull requests of one project (`project` as it appears in the URLs) or, with
|
|
175
|
+
* `repoUrl`, of one repo. Newest first, as Azure returns them.
|
|
176
|
+
*/
|
|
177
|
+
async listActivePullRequests(pat: string, orgUrl: string, scope: { project?: string; repoUrl?: string; creatorId?: string; reviewerId?: string }): Promise<Array<{
|
|
178
|
+
url: string; number: number; title: string; repo_url: string; author?: string; updated_at?: string; draft: boolean;
|
|
179
|
+
}>> {
|
|
180
|
+
const who = (scope.creatorId ? `&searchCriteria.creatorId=${encodeURIComponent(scope.creatorId)}` : '')
|
|
181
|
+
+ (scope.reviewerId ? `&searchCriteria.reviewerId=${encodeURIComponent(scope.reviewerId)}` : '');
|
|
182
|
+
const q = `?searchCriteria.status=active${who}&$top=50&${API}`;
|
|
183
|
+
const url = scope.repoUrl
|
|
184
|
+
? this.repoApi(this.ref(scope.repoUrl), `/pullrequests${q}`)
|
|
185
|
+
: `${orgUrl}/${scope.project}/_apis/git/pullrequests${q}`;
|
|
186
|
+
const res = await this.call(pat, 'GET', url);
|
|
187
|
+
if (res.status !== 200) throw new AzureDevOpsApiError(`Azure DevOps pull requests: HTTP ${res.status}`, res.status);
|
|
188
|
+
const rows = (res.data as { value?: Array<{
|
|
189
|
+
pullRequestId?: number; title?: string; isDraft?: boolean; creationDate?: string;
|
|
190
|
+
createdBy?: { displayName?: string }; repository?: { name?: string; project?: { name?: string } };
|
|
191
|
+
}> } | null)?.value ?? [];
|
|
192
|
+
const out: Array<{ url: string; number: number; title: string; repo_url: string; author?: string; updated_at?: string; draft: boolean }> = [];
|
|
193
|
+
for (const r of rows) {
|
|
194
|
+
if (!r?.pullRequestId || !r.repository?.name || !r.repository.project?.name) continue;
|
|
195
|
+
const repoUrl = `${orgUrl}/${encodeURIComponent(r.repository.project.name)}/_git/${encodeURIComponent(r.repository.name)}`;
|
|
196
|
+
out.push({
|
|
197
|
+
url: this.pullRequestWebUrl(repoUrl, r.pullRequestId),
|
|
198
|
+
number: r.pullRequestId,
|
|
199
|
+
title: r.title || '',
|
|
200
|
+
repo_url: repoUrl,
|
|
201
|
+
...(r.createdBy?.displayName ? { author: r.createdBy.displayName } : {}),
|
|
202
|
+
...(r.creationDate ? { updated_at: r.creationDate } : {}),
|
|
203
|
+
draft: Boolean(r.isDraft),
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
return out;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/** P1: the active PR whose source is `branch` in that repo (a branch URL that already has one). */
|
|
210
|
+
async findActivePullRequestByHead(pat: string, repoUrl: string, branch: string): Promise<number | null> {
|
|
211
|
+
const ref = this.ref(repoUrl);
|
|
212
|
+
const q = `?searchCriteria.sourceRefName=${encodeURIComponent(`refs/heads/${branch}`)}&searchCriteria.status=active&$top=5&${API}`;
|
|
213
|
+
const res = await this.call(pat, 'GET', this.repoApi(ref, `/pullrequests${q}`));
|
|
214
|
+
if (res.status !== 200) return null;
|
|
215
|
+
return (res.data as { value?: Array<{ pullRequestId?: number }> } | null)?.value?.[0]?.pullRequestId ?? null;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/** P1: the repo's default branch (the base of a ticket started from a bare branch). */
|
|
219
|
+
async getDefaultBranch(pat: string, repoUrl: string): Promise<string> {
|
|
220
|
+
const ref = this.ref(repoUrl);
|
|
221
|
+
const res = await this.call(pat, 'GET', this.repoApi(ref, `?${API}`));
|
|
222
|
+
if (res.status !== 200) throw new AzureDevOpsApiError(`Azure DevOps repository: HTTP ${res.status}`, res.status);
|
|
223
|
+
return String((res.data as { defaultBranch?: string } | null)?.defaultBranch ?? 'refs/heads/main').replace(/^refs\/heads\//, '');
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/** P1: whether the repo is a bond hub (`hub.toml` at its root) at `branch`. */
|
|
227
|
+
async isHub(pat: string, repoUrl: string, branch?: string): Promise<boolean> {
|
|
228
|
+
const ref = this.ref(repoUrl);
|
|
229
|
+
const v = branch ? `&versionDescriptor.version=${encodeURIComponent(branch)}&versionDescriptor.versionType=branch` : '';
|
|
230
|
+
const res = await this.call(pat, 'GET', this.repoApi(ref, `/items?path=${encodeURIComponent('/hub.toml')}${v}&${API}`));
|
|
231
|
+
return res.status === 200;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/** P5: read `hub.toml` at `branch` (or default branch), or null if absent/unreadable. */
|
|
235
|
+
async getHubToml(pat: string, repoUrl: string, branch?: string): Promise<string | null> {
|
|
236
|
+
const ref = this.ref(repoUrl);
|
|
237
|
+
const v = branch ? `&versionDescriptor.version=${encodeURIComponent(branch)}&versionDescriptor.versionType=branch` : '';
|
|
238
|
+
const res = await this.call(pat, 'GET', this.repoApi(ref, `/items?path=${encodeURIComponent('/hub.toml')}&includeContent=true${v}&${API}`));
|
|
239
|
+
if (res.status !== 200 || !res.data || typeof res.data !== 'object') return null;
|
|
240
|
+
const content = (res.data as { content?: unknown }).content;
|
|
241
|
+
return typeof content === 'string' ? content : null;
|
|
242
|
+
}
|
|
243
|
+
|
|
134
244
|
private async branchSha(pat: string, ref: AzureRepoRef, branch: string): Promise<string | null> {
|
|
135
245
|
const res = await this.call(pat, 'GET', this.repoApi(ref, `/refs?filter=${encodeURIComponent(`heads/${branch}`)}&${API}`));
|
|
136
246
|
if (res.status !== 200) throw new AzureDevOpsApiError(`Azure DevOps refs: HTTP ${res.status}`, res.status);
|
|
@@ -48,6 +48,13 @@ export interface DockerNetworkSummary {
|
|
|
48
48
|
instanceId?: string;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
+
export interface ExecStreamHandle {
|
|
52
|
+
stdout: NodeJS.ReadableStream;
|
|
53
|
+
stderr: NodeJS.ReadableStream;
|
|
54
|
+
kill: () => void;
|
|
55
|
+
done: Promise<number | null>;
|
|
56
|
+
}
|
|
57
|
+
|
|
51
58
|
export class DockerClient {
|
|
52
59
|
async createNetwork(runId: string, instanceId?: string): Promise<string> {
|
|
53
60
|
const networkName = `bond-net-${runId}`;
|
|
@@ -346,6 +353,33 @@ export class DockerClient {
|
|
|
346
353
|
}
|
|
347
354
|
}
|
|
348
355
|
|
|
356
|
+
execStream(containerName: string, command: string[], user?: string): ExecStreamHandle {
|
|
357
|
+
const args = ['exec'];
|
|
358
|
+
if (user) {
|
|
359
|
+
args.push('-u', user);
|
|
360
|
+
}
|
|
361
|
+
args.push(containerName, ...command);
|
|
362
|
+
|
|
363
|
+
const child = spawn('docker', args, { stdio: ['ignore', 'pipe', 'pipe'] });
|
|
364
|
+
const done = new Promise<number | null>((resolve) => {
|
|
365
|
+
child.on('close', (code) => resolve(code));
|
|
366
|
+
child.on('error', () => resolve(null));
|
|
367
|
+
});
|
|
368
|
+
const kill = () => {
|
|
369
|
+
try {
|
|
370
|
+
child.kill('SIGTERM');
|
|
371
|
+
} catch {
|
|
372
|
+
// ignore
|
|
373
|
+
}
|
|
374
|
+
};
|
|
375
|
+
return {
|
|
376
|
+
stdout: child.stdout,
|
|
377
|
+
stderr: child.stderr,
|
|
378
|
+
kill,
|
|
379
|
+
done,
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
|
|
349
383
|
async stopAndRemoveContainer(containerName: string, networkName?: string): Promise<number> {
|
|
350
384
|
const t0 = Date.now();
|
|
351
385
|
try {
|
|
@@ -159,6 +159,17 @@ export class GitHubClient {
|
|
|
159
159
|
return res.status === 200;
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
+
/** P5: read hub.toml at `ref` (or default branch), or null if absent/unreadable. */
|
|
163
|
+
async getHubToml(token: string, owner: string, repo: string, ref?: string): Promise<string | null> {
|
|
164
|
+
if (!/^[A-Za-z0-9_.-]+$/.test(owner) || !/^[A-Za-z0-9_.-]+$/.test(repo)) return null;
|
|
165
|
+
const q = ref ? `?ref=${encodeURIComponent(ref)}` : '';
|
|
166
|
+
const res = await this.call(token, 'GET', `/repos/${owner}/${repo}/contents/hub.toml${q}`);
|
|
167
|
+
if (res.status !== 200 || !res.data || typeof res.data !== 'object') return null;
|
|
168
|
+
const content = (res.data as { content?: unknown }).content;
|
|
169
|
+
if (typeof content !== 'string') return null;
|
|
170
|
+
return Buffer.from(content.replace(/\n/g, ''), 'base64').toString('utf8');
|
|
171
|
+
}
|
|
172
|
+
|
|
162
173
|
/** P7: check if a remote branch exists on GitHub. */
|
|
163
174
|
async remoteBranchExists(token: string, owner: string, repo: string, branch: string): Promise<boolean> {
|
|
164
175
|
const res = await this.call(token, 'GET', `/repos/${owner}/${repo}/branches/${encodeURIComponent(branch)}`);
|
|
@@ -284,6 +295,113 @@ export class GitHubClient {
|
|
|
284
295
|
return false;
|
|
285
296
|
}
|
|
286
297
|
|
|
298
|
+
/**
|
|
299
|
+
* Plan bond-app-ticket-desde-pr P1: one pull request, for a ticket that starts from it —
|
|
300
|
+
* its branches, state, whether it comes from a fork, and its title and description.
|
|
301
|
+
*/
|
|
302
|
+
async getPullRequest(token: string, owner: string, repo: string, number: number): Promise<{
|
|
303
|
+
number: number; url: string; title: string; body: string; head: string; base: string;
|
|
304
|
+
state: 'open' | 'closed' | 'merged'; draft: boolean; is_fork: boolean; author?: string;
|
|
305
|
+
}> {
|
|
306
|
+
const res = await this.call(token, 'GET', `/repos/${owner}/${repo}/pulls/${number}`);
|
|
307
|
+
if (res.status !== 200) {
|
|
308
|
+
const msg = (res.data as { message?: string } | null)?.message || `HTTP ${res.status}`;
|
|
309
|
+
throw new GitHubApiError(`Failed to fetch GitHub pull request ${owner}/${repo}#${number}: ${msg}`, res.status);
|
|
310
|
+
}
|
|
311
|
+
const d = res.data as {
|
|
312
|
+
number: number; html_url: string; title?: string; body?: string | null; state?: string; merged?: boolean; merged_at?: string | null; draft?: boolean;
|
|
313
|
+
user?: { login?: string };
|
|
314
|
+
head?: { ref?: string; repo?: { full_name?: string } | null };
|
|
315
|
+
base?: { ref?: string; repo?: { full_name?: string } | null };
|
|
316
|
+
};
|
|
317
|
+
const headRepo = String(d.head?.repo?.full_name ?? '').toLowerCase();
|
|
318
|
+
const baseRepo = String(d.base?.repo?.full_name ?? `${owner}/${repo}`).toLowerCase();
|
|
319
|
+
return {
|
|
320
|
+
number: d.number,
|
|
321
|
+
url: d.html_url,
|
|
322
|
+
title: d.title || '',
|
|
323
|
+
body: String(d.body ?? '').slice(0, 8000),
|
|
324
|
+
head: String(d.head?.ref ?? ''),
|
|
325
|
+
base: String(d.base?.ref ?? ''),
|
|
326
|
+
state: d.merged || d.merged_at ? 'merged' : d.state === 'open' ? 'open' : 'closed',
|
|
327
|
+
draft: Boolean(d.draft),
|
|
328
|
+
// A deleted fork leaves head.repo null: still not a branch of this repo.
|
|
329
|
+
is_fork: headRepo !== baseRepo,
|
|
330
|
+
...(d.user?.login ? { author: d.user.login } : {}),
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* P1: open pull requests — the ones that involve the token's owner (author, assignee,
|
|
336
|
+
* reviewer, mentioned) or, with `repo` (`owner/repo`), all open ones of that repo —
|
|
337
|
+
* narrowed by `q` (GitHub's search over title and body). Most recently updated first.
|
|
338
|
+
*/
|
|
339
|
+
async searchPullRequests(token: string, q: string, repo?: { owner: string; repo: string }, mine?: 'assigned' | 'author'): Promise<Array<{
|
|
340
|
+
url: string; number: number; title: string; owner: string; repo: string; author?: string; updated_at?: string; draft: boolean;
|
|
341
|
+
}>> {
|
|
342
|
+
// «Asignadas a mí» = revisor pedido o asignado (dos búsquedas: GitHub no hace OR de
|
|
343
|
+
// calificadores); «Mías» = autor. Sin filtro: las que te implican, o todas las del repo.
|
|
344
|
+
if (mine === 'assigned') {
|
|
345
|
+
const [review, assignee] = await Promise.all([
|
|
346
|
+
this.searchPullRequestsWith(token, q, repo, 'review-requested:@me'),
|
|
347
|
+
this.searchPullRequestsWith(token, q, repo, 'assignee:@me'),
|
|
348
|
+
]);
|
|
349
|
+
const seen = new Set<string>();
|
|
350
|
+
return [...review, ...assignee]
|
|
351
|
+
.filter((p) => (seen.has(p.url) ? false : (seen.add(p.url), true)))
|
|
352
|
+
.sort((a, b) => String(b.updated_at ?? '').localeCompare(String(a.updated_at ?? '')));
|
|
353
|
+
}
|
|
354
|
+
return this.searchPullRequestsWith(token, q, repo, mine === 'author' ? 'author:@me' : repo ? null : 'involves:@me');
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
private async searchPullRequestsWith(token: string, q: string, repo: { owner: string; repo: string } | undefined, who: string | null): Promise<Array<{
|
|
358
|
+
url: string; number: number; title: string; owner: string; repo: string; author?: string; updated_at?: string; draft: boolean;
|
|
359
|
+
}>> {
|
|
360
|
+
const terms = ['is:pr', 'is:open', ...(repo ? [`repo:${repo.owner}/${repo.repo}`] : []), ...(who ? [who] : []), ...q.trim().split(/\s+/).filter(Boolean).slice(0, 10)];
|
|
361
|
+
const res = await this.call(token, 'GET', `/search/issues?q=${encodeURIComponent(terms.join(' '))}&sort=updated&order=desc&per_page=30`);
|
|
362
|
+
if (res.status !== 200) {
|
|
363
|
+
const msg = (res.data as { message?: string } | null)?.message || `HTTP ${res.status}`;
|
|
364
|
+
throw new GitHubApiError(`Failed to search GitHub pull requests: ${msg}`, res.status);
|
|
365
|
+
}
|
|
366
|
+
const items = Array.isArray((res.data as { items?: unknown })?.items) ? (res.data as { items: Array<Record<string, unknown>> }).items : [];
|
|
367
|
+
const out: Array<{ url: string; number: number; title: string; owner: string; repo: string; author?: string; updated_at?: string; draft: boolean }> = [];
|
|
368
|
+
for (const row of items) {
|
|
369
|
+
const url = String(row?.html_url ?? '');
|
|
370
|
+
const m = /^https:\/\/github\.com\/([A-Za-z0-9_.-]+)\/([A-Za-z0-9_.-]+)\/pull\/([1-9][0-9]*)$/.exec(url);
|
|
371
|
+
if (!m) continue;
|
|
372
|
+
const author = String((row?.user as { login?: string } | undefined)?.login ?? '');
|
|
373
|
+
out.push({
|
|
374
|
+
url,
|
|
375
|
+
number: parseInt(m[3], 10),
|
|
376
|
+
title: String(row?.title ?? ''),
|
|
377
|
+
owner: m[1],
|
|
378
|
+
repo: m[2],
|
|
379
|
+
...(author ? { author } : {}),
|
|
380
|
+
...(row?.updated_at ? { updated_at: String(row.updated_at) } : {}),
|
|
381
|
+
draft: Boolean(row?.draft),
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
return out;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
/** P1: the open PR whose head is `branch` in that repo (a branch URL that already has one). */
|
|
388
|
+
async findOpenPullRequestByHead(token: string, owner: string, repo: string, branch: string): Promise<number | null> {
|
|
389
|
+
const res = await this.call(token, 'GET', `/repos/${owner}/${repo}/pulls?head=${encodeURIComponent(`${owner}:${branch}`)}&state=open&per_page=5`);
|
|
390
|
+
if (res.status !== 200 || !Array.isArray(res.data)) return null;
|
|
391
|
+
const first = (res.data as Array<{ number?: number }>)[0];
|
|
392
|
+
return first?.number ?? null;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
/** P1: the repo's default branch (the base of a ticket started from a bare branch). */
|
|
396
|
+
async getDefaultBranch(token: string, owner: string, repo: string): Promise<string> {
|
|
397
|
+
const res = await this.call(token, 'GET', `/repos/${owner}/${repo}`);
|
|
398
|
+
if (res.status !== 200) {
|
|
399
|
+
const msg = (res.data as { message?: string } | null)?.message || `HTTP ${res.status}`;
|
|
400
|
+
throw new GitHubApiError(`Failed to read GitHub repo ${owner}/${repo}: ${msg}`, res.status);
|
|
401
|
+
}
|
|
402
|
+
return String((res.data as { default_branch?: string }).default_branch || 'main');
|
|
403
|
+
}
|
|
404
|
+
|
|
287
405
|
/** P7: delete a remote branch from GitHub. */
|
|
288
406
|
async deleteRemoteBranch(token: string, owner: string, repo: string, branch: string): Promise<boolean> {
|
|
289
407
|
const res = await this.call(token, 'DELETE', `/repos/${owner}/${repo}/git/refs/heads/${encodeURIComponent(branch)}`);
|
package/src/server/app.ts
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
ValidationError,
|
|
7
7
|
RebuildInProgressError,
|
|
8
8
|
GitHubCredentialMissingError,
|
|
9
|
+
SourceError,
|
|
9
10
|
UnmergedBranchError,
|
|
10
11
|
NotFoundError,
|
|
11
12
|
ConflictError,
|
|
@@ -17,9 +18,11 @@ import { GitHubApiError } from '../runner/github-client.ts';
|
|
|
17
18
|
import { JiraApiError } from '../runner/jira-client.ts';
|
|
18
19
|
import { validateAptExtra, validateToolGroups } from '../runner/tool-catalog.ts';
|
|
19
20
|
import { normalizeAzureOrgUrl } from '../runner/azure-devops-client.ts';
|
|
20
|
-
import {
|
|
21
|
+
import { githubParts } from '../core/hub.ts';
|
|
22
|
+
import { azureRepoUrl, parseAzureRepoUrl, validateRepoUrl } from '../core/repo-host.ts';
|
|
21
23
|
import { keepPiKeys } from '../db/settings-repo.ts';
|
|
22
24
|
import { listProviderModels, normalizeProviderBase, ProviderModelsError } from '../core/setup.ts';
|
|
25
|
+
import { runDoctor, type DoctorDeps, type DoctorOptions, type DoctorReport } from '../core/doctor.ts';
|
|
23
26
|
import { InvalidStateTransitionError } from '../core/state-machine.ts';
|
|
24
27
|
import {
|
|
25
28
|
isValidAgent,
|
|
@@ -38,6 +41,9 @@ import {
|
|
|
38
41
|
export interface ServerHooks {
|
|
39
42
|
/** Stop like Ctrl+C and start again with the same argv and environment (Ajustes «Reiniciar»). */
|
|
40
43
|
onRestart?: () => void;
|
|
44
|
+
/** Injectable doctor runner / deps for tests. */
|
|
45
|
+
runDoctor?: (opts: DoctorOptions) => Promise<DoctorReport>;
|
|
46
|
+
doctorDeps?: DoctorDeps;
|
|
41
47
|
}
|
|
42
48
|
|
|
43
49
|
export function createServer(orchestrator: Orchestrator, hooks: ServerHooks = {}): Server {
|
|
@@ -162,15 +168,23 @@ export function createServer(orchestrator: Orchestrator, hooks: ServerHooks = {}
|
|
|
162
168
|
if (method === 'POST') {
|
|
163
169
|
const body = (await readJson()) as unknown as CreateTicketInput;
|
|
164
170
|
// P5: a ticket names one repo (repo_url), a list (repos) or an existing hub (hub_url).
|
|
165
|
-
if (!body.title || (!body.repo_url && !body.repos && !body.hub_url)) {
|
|
171
|
+
if (!body.source_pr_url && (!body.title || (!body.repo_url && !body.repos && !body.hub_url))) {
|
|
166
172
|
sendJson(400, { error: "Field 'title' and one of 'repo_url', 'repos' or 'hub_url' are required" });
|
|
167
173
|
return;
|
|
168
174
|
}
|
|
169
175
|
try {
|
|
170
|
-
|
|
176
|
+
// Plan bond-app-ticket-desde-pr P1: from a PR or branch, bond-app resolves it and
|
|
177
|
+
// takes repo, branches, id (and title/story if missing) from it.
|
|
178
|
+
const ticket = body.source_pr_url
|
|
179
|
+
? await orchestrator.createTicketFromSource(body)
|
|
180
|
+
: orchestrator.ticketRepo.create(body);
|
|
171
181
|
sendJson(201, ticket);
|
|
172
182
|
} catch (err: unknown) {
|
|
173
|
-
|
|
183
|
+
if (err instanceof SourceError) {
|
|
184
|
+
sendJson(err.status, { error: err.code === 'ticket_invalid' ? err.message : err.code, code: err.code, detail: err.message });
|
|
185
|
+
} else {
|
|
186
|
+
sendJson(400, { error: (err as Error).message });
|
|
187
|
+
}
|
|
174
188
|
}
|
|
175
189
|
return;
|
|
176
190
|
}
|
|
@@ -281,6 +295,32 @@ export function createServer(orchestrator: Orchestrator, hooks: ServerHooks = {}
|
|
|
281
295
|
return;
|
|
282
296
|
}
|
|
283
297
|
|
|
298
|
+
// Plan bond-app-ticket-desde-pr P1: PRs abiertas para empezar un ticket (GitHub: las que
|
|
299
|
+
// te implican o las de un repo; Azure: las activas del repo o de los proyectos de la org).
|
|
300
|
+
if (pathname === '/api/v1/prs/search' && method === 'GET') {
|
|
301
|
+
const q = String(parsedUrl.searchParams.get('q') || '').slice(0, 200);
|
|
302
|
+
const repo = String(parsedUrl.searchParams.get('repo') || '').slice(0, 500) || undefined;
|
|
303
|
+
// Filtros del alta: host (github | azure) y de quién (assigned = asignadas a mí, author = mías).
|
|
304
|
+
const hostParam = parsedUrl.searchParams.get('host');
|
|
305
|
+
const mineParam = parsedUrl.searchParams.get('mine');
|
|
306
|
+
const host = hostParam === 'github' || hostParam === 'azure' ? hostParam : undefined;
|
|
307
|
+
const mine = mineParam === 'assigned' || mineParam === 'author' ? mineParam : undefined;
|
|
308
|
+
sendJson(200, await orchestrator.searchPullRequests(q, repo, { host, mine }));
|
|
309
|
+
return;
|
|
310
|
+
}
|
|
311
|
+
// P1: qué hay detrás de la URL de una PR o rama (repo, ramas, estado, fork, hub, texto).
|
|
312
|
+
if (pathname === '/api/v1/prs/resolve' && method === 'GET') {
|
|
313
|
+
const url = String(parsedUrl.searchParams.get('url') || '').trim();
|
|
314
|
+
const hubUrl = String(parsedUrl.searchParams.get('hub_url') || '').trim() || undefined;
|
|
315
|
+
try {
|
|
316
|
+
sendJson(200, await orchestrator.resolveSource(url, hubUrl));
|
|
317
|
+
} catch (err: unknown) {
|
|
318
|
+
if (err instanceof SourceError) sendJson(err.status, { error: err.code, detail: err.message });
|
|
319
|
+
else throw err;
|
|
320
|
+
}
|
|
321
|
+
return;
|
|
322
|
+
}
|
|
323
|
+
|
|
284
324
|
// Alta de ticket (Dónde): favoritos, recientes, Azure Repos y GitHub en una lista.
|
|
285
325
|
if (pathname === '/api/v1/repos/suggest' && method === 'GET') {
|
|
286
326
|
const q = String(parsedUrl.searchParams.get('q') || '').slice(0, 100);
|
|
@@ -307,10 +347,40 @@ export function createServer(orchestrator: Orchestrator, hooks: ServerHooks = {}
|
|
|
307
347
|
// Plan bond-app-ajustes-imagen P4: ¿trae el repo devcontainer? (pre-marca «Docker en el run»).
|
|
308
348
|
// Alta en tres bloques: y ¿es un hub (hub.toml)? (el alta pasa sola a modo hub).
|
|
309
349
|
if (pathname === '/api/v1/repos/devcontainer' && method === 'GET') {
|
|
310
|
-
const
|
|
311
|
-
const repo = String(parsedUrl.searchParams.get('repo') || '');
|
|
350
|
+
const rawUrl = String(parsedUrl.searchParams.get('url') || '').trim();
|
|
312
351
|
const ref = String(parsedUrl.searchParams.get('ref') || '').trim() || undefined;
|
|
313
|
-
if (
|
|
352
|
+
if (ref && !/^[A-Za-z0-9._\/-]{1,200}$/.test(ref)) {
|
|
353
|
+
sendJson(400, { error: 'repo_invalid' });
|
|
354
|
+
return;
|
|
355
|
+
}
|
|
356
|
+
let owner = String(parsedUrl.searchParams.get('owner') || '');
|
|
357
|
+
let repo = String(parsedUrl.searchParams.get('repo') || '');
|
|
358
|
+
if (rawUrl) {
|
|
359
|
+
const az = parseAzureRepoUrl(rawUrl);
|
|
360
|
+
if (az) {
|
|
361
|
+
const repoUrl = azureRepoUrl(az);
|
|
362
|
+
const access = orchestrator.repoAccessFor(repoUrl);
|
|
363
|
+
if (!access.token) {
|
|
364
|
+
sendJson(200, { devcontainer: false, hub: false, checked: false });
|
|
365
|
+
return;
|
|
366
|
+
}
|
|
367
|
+
try {
|
|
368
|
+
const hub = await orchestrator.azure.isHub(access.token, repoUrl, ref);
|
|
369
|
+
sendJson(200, { devcontainer: false, hub, checked: true });
|
|
370
|
+
} catch {
|
|
371
|
+
sendJson(200, { devcontainer: false, hub: false, checked: false });
|
|
372
|
+
}
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
375
|
+
const gh = githubParts(rawUrl);
|
|
376
|
+
if (!gh) {
|
|
377
|
+
sendJson(400, { error: 'repo_invalid' });
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
owner = gh.owner;
|
|
381
|
+
repo = gh.repo;
|
|
382
|
+
}
|
|
383
|
+
if (!/^[A-Za-z0-9_.-]+$/.test(owner) || !/^[A-Za-z0-9_.-]+$/.test(repo)) {
|
|
314
384
|
sendJson(400, { error: 'repo_invalid' });
|
|
315
385
|
return;
|
|
316
386
|
}
|
|
@@ -976,6 +1046,23 @@ export function createServer(orchestrator: Orchestrator, hooks: ServerHooks = {}
|
|
|
976
1046
|
}
|
|
977
1047
|
}
|
|
978
1048
|
|
|
1049
|
+
// P4 (instalador): installation diagnostics report (no secrets).
|
|
1050
|
+
if (pathname === '/api/v1/doctor' && method === 'GET') {
|
|
1051
|
+
const report = await (hooks.runDoctor ?? runDoctor)({
|
|
1052
|
+
port: orchestrator.config.port,
|
|
1053
|
+
host: orchestrator.config.host,
|
|
1054
|
+
dataDir: orchestrator.config.dataDir,
|
|
1055
|
+
runnerImage: orchestrator.config.runnerImage,
|
|
1056
|
+
deps: {
|
|
1057
|
+
checkHealth: async () => ({ ok: true, statusCode: 200 }),
|
|
1058
|
+
fetchSetupState: async () => await orchestrator.getSetupState(),
|
|
1059
|
+
...hooks.doctorDeps,
|
|
1060
|
+
},
|
|
1061
|
+
});
|
|
1062
|
+
sendJson(200, report);
|
|
1063
|
+
return;
|
|
1064
|
+
}
|
|
1065
|
+
|
|
979
1066
|
// W-P1 (wizard): aggregated setup state. GET says what is missing; PUT stores the
|
|
980
1067
|
// agent selection and setup_done (only via an explicit write). No credentials here:
|
|
981
1068
|
// the aggregate only says whether each piece is configured (D13 summaries).
|
package/src/types.ts
CHANGED
|
@@ -84,6 +84,12 @@ export interface Ticket {
|
|
|
84
84
|
issue_url?: string | null;
|
|
85
85
|
/** P7: user story read from the linked issue (or given). */
|
|
86
86
|
story?: string | null;
|
|
87
|
+
/**
|
|
88
|
+
* Plan bond-app-ticket-desde-pr (D3): the remote work the ticket starts from — a PR's web
|
|
89
|
+
* URL, or a branch URL (GitHub `/tree/<b>`, Azure `?version=GB<b>`) when it has no PR.
|
|
90
|
+
* With it, `target_branch` is that existing branch and the run works on it.
|
|
91
|
+
*/
|
|
92
|
+
source_pr_url?: string | null;
|
|
87
93
|
/** The single repo (mode `single`), or the first one of the session for display. */
|
|
88
94
|
repo_url: string;
|
|
89
95
|
base_branch: string;
|
|
@@ -122,6 +128,11 @@ export interface CreateTicketInput {
|
|
|
122
128
|
/** P7: linked GitHub issue URL. */
|
|
123
129
|
issue_url?: string;
|
|
124
130
|
story?: string;
|
|
131
|
+
/**
|
|
132
|
+
* Plan bond-app-ticket-desde-pr (D3): a PR or branch URL to start from. `POST /tickets`
|
|
133
|
+
* resolves it and fills repo, branches, id and (if missing) title and story from it.
|
|
134
|
+
*/
|
|
135
|
+
source_pr_url?: string;
|
|
125
136
|
/** One of: repo_url (single repo), repos (list; two or more create a hub) or hub_url. */
|
|
126
137
|
repo_url?: string;
|
|
127
138
|
base_branch?: string;
|