gitgrip 0.2.3 → 0.3.0
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 +75 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +3 -10
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/pr/create.d.ts.map +1 -1
- package/dist/commands/pr/create.js +29 -8
- package/dist/commands/pr/create.js.map +1 -1
- package/dist/commands/pr/merge.d.ts.map +1 -1
- package/dist/commands/pr/merge.js +40 -33
- package/dist/commands/pr/merge.js.map +1 -1
- package/dist/commands/pr/status.d.ts.map +1 -1
- package/dist/commands/pr/status.js +15 -11
- package/dist/commands/pr/status.js.map +1 -1
- package/dist/index.js +1 -17
- package/dist/index.js.map +1 -1
- package/dist/lib/github.d.ts +28 -4
- package/dist/lib/github.d.ts.map +1 -1
- package/dist/lib/github.js +65 -126
- package/dist/lib/github.js.map +1 -1
- package/dist/lib/linker.d.ts +19 -4
- package/dist/lib/linker.d.ts.map +1 -1
- package/dist/lib/linker.js +107 -16
- package/dist/lib/linker.js.map +1 -1
- package/dist/lib/manifest.d.ts +14 -16
- package/dist/lib/manifest.d.ts.map +1 -1
- package/dist/lib/manifest.js +49 -57
- package/dist/lib/manifest.js.map +1 -1
- package/dist/lib/platform/azure-devops.d.ts +83 -0
- package/dist/lib/platform/azure-devops.d.ts.map +1 -0
- package/dist/lib/platform/azure-devops.js +378 -0
- package/dist/lib/platform/azure-devops.js.map +1 -0
- package/dist/lib/platform/github.d.ts +82 -0
- package/dist/lib/platform/github.d.ts.map +1 -0
- package/dist/lib/platform/github.js +285 -0
- package/dist/lib/platform/github.js.map +1 -0
- package/dist/lib/platform/gitlab.d.ts +82 -0
- package/dist/lib/platform/gitlab.d.ts.map +1 -0
- package/dist/lib/platform/gitlab.js +331 -0
- package/dist/lib/platform/gitlab.js.map +1 -0
- package/dist/lib/platform/index.d.ts +60 -0
- package/dist/lib/platform/index.d.ts.map +1 -0
- package/dist/lib/platform/index.js +132 -0
- package/dist/lib/platform/index.js.map +1 -0
- package/dist/lib/platform/types.d.ts +162 -0
- package/dist/lib/platform/types.d.ts.map +1 -0
- package/dist/lib/platform/types.js +5 -0
- package/dist/lib/platform/types.js.map +1 -0
- package/dist/types.d.ts +39 -5
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -1
- package/dist/commands/migrate.d.ts +0 -17
- package/dist/commands/migrate.d.ts.map +0 -1
- package/dist/commands/migrate.js +0 -180
- package/dist/commands/migrate.js.map +0 -1
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Azure DevOps hosting platform adapter
|
|
3
|
+
*/
|
|
4
|
+
import { execSync } from 'child_process';
|
|
5
|
+
/**
|
|
6
|
+
* Azure DevOps platform adapter implementing the HostingPlatform interface
|
|
7
|
+
*/
|
|
8
|
+
export class AzureDevOpsPlatform {
|
|
9
|
+
type = 'azure-devops';
|
|
10
|
+
token = null;
|
|
11
|
+
config;
|
|
12
|
+
baseUrl;
|
|
13
|
+
constructor(config) {
|
|
14
|
+
this.config = config ?? { type: 'azure-devops' };
|
|
15
|
+
this.baseUrl = this.config.baseUrl ?? 'https://dev.azure.com';
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Get Azure DevOps token from environment or az CLI
|
|
19
|
+
*/
|
|
20
|
+
async getToken() {
|
|
21
|
+
if (this.token) {
|
|
22
|
+
return this.token;
|
|
23
|
+
}
|
|
24
|
+
// Try environment variable first
|
|
25
|
+
if (process.env.AZURE_DEVOPS_TOKEN) {
|
|
26
|
+
this.token = process.env.AZURE_DEVOPS_TOKEN;
|
|
27
|
+
return this.token;
|
|
28
|
+
}
|
|
29
|
+
// Alternative env var name
|
|
30
|
+
if (process.env.AZURE_DEVOPS_EXT_PAT) {
|
|
31
|
+
this.token = process.env.AZURE_DEVOPS_EXT_PAT;
|
|
32
|
+
return this.token;
|
|
33
|
+
}
|
|
34
|
+
// Try az CLI to get PAT
|
|
35
|
+
try {
|
|
36
|
+
// Note: az devops configure --use-git-aliases doesn't provide token directly
|
|
37
|
+
// Users typically need to use a PAT stored in env var
|
|
38
|
+
const output = execSync('az account get-access-token --resource 499b84ac-1321-427f-aa17-267ca6975798 --query accessToken -o tsv 2>/dev/null', { encoding: 'utf-8' });
|
|
39
|
+
if (output.trim()) {
|
|
40
|
+
this.token = output.trim();
|
|
41
|
+
return this.token;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
// az CLI not available or not authenticated
|
|
46
|
+
}
|
|
47
|
+
throw new Error('Azure DevOps token not found. Set AZURE_DEVOPS_TOKEN environment variable or use az login');
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Make authenticated API request to Azure DevOps
|
|
51
|
+
*/
|
|
52
|
+
async apiRequest(method, org, project, endpoint, body, apiVersion = '7.0') {
|
|
53
|
+
const token = await this.getToken();
|
|
54
|
+
const url = `${this.baseUrl}/${org}/${project}/_apis${endpoint}?api-version=${apiVersion}`;
|
|
55
|
+
// Azure DevOps uses Basic auth with PAT (user can be empty)
|
|
56
|
+
const authHeader = Buffer.from(`:${token}`).toString('base64');
|
|
57
|
+
const options = {
|
|
58
|
+
method,
|
|
59
|
+
headers: {
|
|
60
|
+
'Authorization': `Basic ${authHeader}`,
|
|
61
|
+
'Content-Type': 'application/json',
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
if (body) {
|
|
65
|
+
options.body = JSON.stringify(body);
|
|
66
|
+
}
|
|
67
|
+
const response = await fetch(url, options);
|
|
68
|
+
if (!response.ok) {
|
|
69
|
+
const errorText = await response.text();
|
|
70
|
+
throw new Error(`Azure DevOps API error (${response.status}): ${errorText}`);
|
|
71
|
+
}
|
|
72
|
+
return response.json();
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Parse Azure DevOps context from owner string
|
|
76
|
+
* Format: "org/project" where owner is org and repo is separate
|
|
77
|
+
*/
|
|
78
|
+
parseContext(owner, repo) {
|
|
79
|
+
// In Azure DevOps, the "owner" from our URL parsing is actually "org/project"
|
|
80
|
+
const parts = owner.split('/');
|
|
81
|
+
if (parts.length >= 2) {
|
|
82
|
+
return {
|
|
83
|
+
organization: parts[0],
|
|
84
|
+
project: parts.slice(1).join('/'),
|
|
85
|
+
repository: repo,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
// Fallback: owner is org, and we use repo as both project and repo
|
|
89
|
+
return {
|
|
90
|
+
organization: owner,
|
|
91
|
+
project: repo,
|
|
92
|
+
repository: repo,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Create a pull request
|
|
97
|
+
*/
|
|
98
|
+
async createPullRequest(owner, repo, head, base, title, body = '', draft = false) {
|
|
99
|
+
const ctx = this.parseContext(owner, repo);
|
|
100
|
+
const pr = await this.apiRequest('POST', ctx.organization, ctx.project, `/git/repositories/${ctx.repository}/pullrequests`, {
|
|
101
|
+
sourceRefName: `refs/heads/${head}`,
|
|
102
|
+
targetRefName: `refs/heads/${base}`,
|
|
103
|
+
title,
|
|
104
|
+
description: body,
|
|
105
|
+
isDraft: draft,
|
|
106
|
+
});
|
|
107
|
+
const webUrl = `${this.baseUrl}/${ctx.organization}/${ctx.project}/_git/${ctx.repository}/pullrequest/${pr.pullRequestId}`;
|
|
108
|
+
return {
|
|
109
|
+
number: pr.pullRequestId,
|
|
110
|
+
url: webUrl,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Get pull request details
|
|
115
|
+
*/
|
|
116
|
+
async getPullRequest(owner, repo, pullNumber) {
|
|
117
|
+
const ctx = this.parseContext(owner, repo);
|
|
118
|
+
const pr = await this.apiRequest('GET', ctx.organization, ctx.project, `/git/repositories/${ctx.repository}/pullrequests/${pullNumber}`);
|
|
119
|
+
// Map Azure DevOps status to our unified state
|
|
120
|
+
let state = 'open';
|
|
121
|
+
let merged = false;
|
|
122
|
+
if (pr.status === 'completed') {
|
|
123
|
+
state = 'closed';
|
|
124
|
+
// Azure DevOps merges on completion (or could be closed without merge)
|
|
125
|
+
// Check merge status to determine
|
|
126
|
+
merged = pr.mergeStatus === 'succeeded';
|
|
127
|
+
}
|
|
128
|
+
else if (pr.status === 'abandoned') {
|
|
129
|
+
state = 'closed';
|
|
130
|
+
}
|
|
131
|
+
// Azure DevOps mergeability
|
|
132
|
+
const mergeable = pr.mergeStatus === 'succeeded' || pr.mergeStatus === 'queued';
|
|
133
|
+
const webUrl = `${this.baseUrl}/${ctx.organization}/${ctx.project}/_git/${ctx.repository}/pullrequest/${pr.pullRequestId}`;
|
|
134
|
+
return {
|
|
135
|
+
number: pr.pullRequestId,
|
|
136
|
+
url: webUrl,
|
|
137
|
+
title: pr.title,
|
|
138
|
+
body: pr.description ?? '',
|
|
139
|
+
state,
|
|
140
|
+
merged,
|
|
141
|
+
mergeable,
|
|
142
|
+
head: {
|
|
143
|
+
ref: pr.sourceRefName.replace('refs/heads/', ''),
|
|
144
|
+
sha: pr.lastMergeSourceCommit?.commitId ?? '',
|
|
145
|
+
},
|
|
146
|
+
base: {
|
|
147
|
+
ref: pr.targetRefName.replace('refs/heads/', ''),
|
|
148
|
+
},
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Update pull request description
|
|
153
|
+
*/
|
|
154
|
+
async updatePullRequestBody(owner, repo, pullNumber, body) {
|
|
155
|
+
const ctx = this.parseContext(owner, repo);
|
|
156
|
+
await this.apiRequest('PATCH', ctx.organization, ctx.project, `/git/repositories/${ctx.repository}/pullrequests/${pullNumber}`, { description: body });
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Merge (complete) a pull request
|
|
160
|
+
*/
|
|
161
|
+
async mergePullRequest(owner, repo, pullNumber, options = {}) {
|
|
162
|
+
const ctx = this.parseContext(owner, repo);
|
|
163
|
+
try {
|
|
164
|
+
// Get current PR to get the last merge source commit
|
|
165
|
+
const pr = await this.getPullRequest(owner, repo, pullNumber);
|
|
166
|
+
// Azure DevOps "complete" action
|
|
167
|
+
const completeOptions = {
|
|
168
|
+
status: 'completed',
|
|
169
|
+
lastMergeSourceCommit: { commitId: pr.head.sha },
|
|
170
|
+
completionOptions: {},
|
|
171
|
+
};
|
|
172
|
+
if (options.deleteBranch) {
|
|
173
|
+
completeOptions.completionOptions.deleteSourceBranch = true;
|
|
174
|
+
}
|
|
175
|
+
// Map merge method
|
|
176
|
+
if (options.method === 'squash') {
|
|
177
|
+
completeOptions.completionOptions.squashMerge = true;
|
|
178
|
+
}
|
|
179
|
+
else if (options.method === 'rebase') {
|
|
180
|
+
completeOptions.completionOptions.mergeStrategy = 'rebase';
|
|
181
|
+
}
|
|
182
|
+
await this.apiRequest('PATCH', ctx.organization, ctx.project, `/git/repositories/${ctx.repository}/pullrequests/${pullNumber}`, completeOptions);
|
|
183
|
+
return true;
|
|
184
|
+
}
|
|
185
|
+
catch {
|
|
186
|
+
return false;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Find PR by branch name
|
|
191
|
+
*/
|
|
192
|
+
async findPRByBranch(owner, repo, branch) {
|
|
193
|
+
const ctx = this.parseContext(owner, repo);
|
|
194
|
+
const response = await this.apiRequest('GET', ctx.organization, ctx.project, `/git/repositories/${ctx.repository}/pullrequests?searchCriteria.sourceRefName=refs/heads/${encodeURIComponent(branch)}&searchCriteria.status=active`);
|
|
195
|
+
if (response.value && response.value.length > 0) {
|
|
196
|
+
const pr = response.value[0];
|
|
197
|
+
const webUrl = `${this.baseUrl}/${ctx.organization}/${ctx.project}/_git/${ctx.repository}/pullrequest/${pr.pullRequestId}`;
|
|
198
|
+
return {
|
|
199
|
+
number: pr.pullRequestId,
|
|
200
|
+
url: webUrl,
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
return null;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Check if PR is approved
|
|
207
|
+
*/
|
|
208
|
+
async isPullRequestApproved(owner, repo, pullNumber) {
|
|
209
|
+
const reviews = await this.getPullRequestReviews(owner, repo, pullNumber);
|
|
210
|
+
// Azure DevOps: vote 10 = approved, 5 = approved with suggestions
|
|
211
|
+
const hasApproval = reviews.some((r) => r.state === 'APPROVED' || r.state === 'APPROVED_WITH_SUGGESTIONS');
|
|
212
|
+
const hasRejection = reviews.some((r) => r.state === 'REJECTED' || r.state === 'WAITING_FOR_AUTHOR');
|
|
213
|
+
return hasApproval && !hasRejection;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Get PR reviewers/votes
|
|
217
|
+
*/
|
|
218
|
+
async getPullRequestReviews(owner, repo, pullNumber) {
|
|
219
|
+
const ctx = this.parseContext(owner, repo);
|
|
220
|
+
const pr = await this.apiRequest('GET', ctx.organization, ctx.project, `/git/repositories/${ctx.repository}/pullrequests/${pullNumber}`);
|
|
221
|
+
return (pr.reviewers ?? []).map((reviewer) => {
|
|
222
|
+
// Map Azure DevOps vote to state
|
|
223
|
+
let state;
|
|
224
|
+
switch (reviewer.vote) {
|
|
225
|
+
case 10:
|
|
226
|
+
state = 'APPROVED';
|
|
227
|
+
break;
|
|
228
|
+
case 5:
|
|
229
|
+
state = 'APPROVED_WITH_SUGGESTIONS';
|
|
230
|
+
break;
|
|
231
|
+
case -10:
|
|
232
|
+
state = 'REJECTED';
|
|
233
|
+
break;
|
|
234
|
+
case -5:
|
|
235
|
+
state = 'WAITING_FOR_AUTHOR';
|
|
236
|
+
break;
|
|
237
|
+
default:
|
|
238
|
+
state = 'PENDING';
|
|
239
|
+
}
|
|
240
|
+
return {
|
|
241
|
+
state,
|
|
242
|
+
user: reviewer.displayName || reviewer.uniqueName,
|
|
243
|
+
};
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Get build status for a commit/PR
|
|
248
|
+
*/
|
|
249
|
+
async getStatusChecks(owner, repo, ref) {
|
|
250
|
+
const ctx = this.parseContext(owner, repo);
|
|
251
|
+
try {
|
|
252
|
+
// Get builds for this commit
|
|
253
|
+
const response = await this.apiRequest('GET', ctx.organization, ctx.project, `/build/builds?repositoryId=${ctx.repository}&repositoryType=TfsGit&$top=5`, undefined, '7.0');
|
|
254
|
+
if (!response.value || response.value.length === 0) {
|
|
255
|
+
return { state: 'success', statuses: [] };
|
|
256
|
+
}
|
|
257
|
+
// Find builds for this ref/commit
|
|
258
|
+
const builds = response.value;
|
|
259
|
+
// Aggregate status
|
|
260
|
+
const hasFailure = builds.some((b) => b.result === 'failed' || b.result === 'canceled');
|
|
261
|
+
const hasInProgress = builds.some((b) => b.status !== 'completed');
|
|
262
|
+
let state;
|
|
263
|
+
if (hasFailure) {
|
|
264
|
+
state = 'failure';
|
|
265
|
+
}
|
|
266
|
+
else if (hasInProgress) {
|
|
267
|
+
state = 'pending';
|
|
268
|
+
}
|
|
269
|
+
else {
|
|
270
|
+
state = 'success';
|
|
271
|
+
}
|
|
272
|
+
return {
|
|
273
|
+
state,
|
|
274
|
+
statuses: builds.map((b) => ({
|
|
275
|
+
context: 'azure-pipeline',
|
|
276
|
+
state: b.result ?? b.status,
|
|
277
|
+
})),
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
catch {
|
|
281
|
+
// No builds or API error
|
|
282
|
+
return { state: 'success', statuses: [] };
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Parse Azure DevOps URL to extract org/project/repo
|
|
287
|
+
*/
|
|
288
|
+
parseRepoUrl(url) {
|
|
289
|
+
// SSH format: git@ssh.dev.azure.com:v3/org/project/repo
|
|
290
|
+
const sshMatch = url.match(/git@ssh\.dev\.azure\.com:v3\/([^/]+)\/([^/]+)\/(.+?)(?:\.git)?$/);
|
|
291
|
+
if (sshMatch) {
|
|
292
|
+
return {
|
|
293
|
+
owner: `${sshMatch[1]}/${sshMatch[2]}`, // org/project
|
|
294
|
+
repo: sshMatch[3],
|
|
295
|
+
project: sshMatch[2],
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
// HTTPS format: https://dev.azure.com/org/project/_git/repo
|
|
299
|
+
const httpsMatch = url.match(/https?:\/\/dev\.azure\.com\/([^/]+)\/([^/]+)\/_git\/(.+?)(?:\.git)?$/);
|
|
300
|
+
if (httpsMatch) {
|
|
301
|
+
return {
|
|
302
|
+
owner: `${httpsMatch[1]}/${httpsMatch[2]}`, // org/project
|
|
303
|
+
repo: httpsMatch[3],
|
|
304
|
+
project: httpsMatch[2],
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
// Legacy visualstudio.com format: https://org.visualstudio.com/project/_git/repo
|
|
308
|
+
const legacyMatch = url.match(/https?:\/\/([^.]+)\.visualstudio\.com\/([^/]+)\/_git\/(.+?)(?:\.git)?$/);
|
|
309
|
+
if (legacyMatch) {
|
|
310
|
+
return {
|
|
311
|
+
owner: `${legacyMatch[1]}/${legacyMatch[2]}`, // org/project
|
|
312
|
+
repo: legacyMatch[3],
|
|
313
|
+
project: legacyMatch[2],
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
// Check custom base URL
|
|
317
|
+
if (this.config.baseUrl && this.config.baseUrl !== 'https://dev.azure.com') {
|
|
318
|
+
const host = new URL(this.config.baseUrl).host;
|
|
319
|
+
const escapedHost = host.replace(/\./g, '\\.');
|
|
320
|
+
const customRegex = new RegExp(`https?://${escapedHost}/([^/]+)/([^/]+)/_git/(.+?)(?:\\.git)?$`);
|
|
321
|
+
const customMatch = url.match(customRegex);
|
|
322
|
+
if (customMatch) {
|
|
323
|
+
return {
|
|
324
|
+
owner: `${customMatch[1]}/${customMatch[2]}`,
|
|
325
|
+
repo: customMatch[3],
|
|
326
|
+
project: customMatch[2],
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
return null;
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Check if URL matches Azure DevOps
|
|
334
|
+
*/
|
|
335
|
+
matchesUrl(url) {
|
|
336
|
+
if (url.includes('dev.azure.com'))
|
|
337
|
+
return true;
|
|
338
|
+
if (url.includes('visualstudio.com'))
|
|
339
|
+
return true;
|
|
340
|
+
if (url.includes('ssh.dev.azure.com'))
|
|
341
|
+
return true;
|
|
342
|
+
// Check against configured base URL (for Azure DevOps Server)
|
|
343
|
+
if (this.config.baseUrl && this.config.baseUrl !== 'https://dev.azure.com') {
|
|
344
|
+
const host = new URL(this.config.baseUrl).host;
|
|
345
|
+
if (url.includes(host))
|
|
346
|
+
return true;
|
|
347
|
+
}
|
|
348
|
+
return false;
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* Generate HTML comment for linked PR tracking
|
|
352
|
+
*/
|
|
353
|
+
generateLinkedPRComment(links) {
|
|
354
|
+
const prLinks = links.map((pr) => `${pr.repoName}!${pr.number}`).join(',');
|
|
355
|
+
return `<!-- codi-repo:links:${prLinks} -->`;
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* Parse linked PRs from PR description
|
|
359
|
+
*/
|
|
360
|
+
parseLinkedPRComment(body) {
|
|
361
|
+
const match = body.match(/<!-- codi-repo:links:(.+?) -->/);
|
|
362
|
+
if (!match) {
|
|
363
|
+
return [];
|
|
364
|
+
}
|
|
365
|
+
const links = match[1].split(',');
|
|
366
|
+
return links.map((link) => {
|
|
367
|
+
const [repoName, numStr] = link.split(/[#!]/);
|
|
368
|
+
return { repoName, number: parseInt(numStr, 10) };
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* Create a new Azure DevOps platform instance
|
|
374
|
+
*/
|
|
375
|
+
export function createAzureDevOpsPlatform(config) {
|
|
376
|
+
return new AzureDevOpsPlatform(config);
|
|
377
|
+
}
|
|
378
|
+
//# sourceMappingURL=azure-devops.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"azure-devops.js","sourceRoot":"","sources":["../../../src/lib/platform/azure-devops.ts"],"names":[],"mappings":"AAAA;;G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U,yBAAyB,CAAC,MAAuB;IAC/D,OAAO,IAAI,mBAAmB,CAAC,MAAM,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { HostingPlatform, PlatformType, PlatformConfig, ParsedRepoInfo, PullRequest, PRCreateResult, PRMergeOptions, PRReview, StatusCheckResult } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* GitHub platform adapter implementing the HostingPlatform interface
|
|
4
|
+
*/
|
|
5
|
+
export declare class GitHubPlatform implements HostingPlatform {
|
|
6
|
+
readonly type: PlatformType;
|
|
7
|
+
private octokit;
|
|
8
|
+
private config;
|
|
9
|
+
constructor(config?: PlatformConfig);
|
|
10
|
+
/**
|
|
11
|
+
* Get GitHub token from environment or gh CLI
|
|
12
|
+
*/
|
|
13
|
+
getToken(): Promise<string>;
|
|
14
|
+
/**
|
|
15
|
+
* Get or create Octokit instance
|
|
16
|
+
*/
|
|
17
|
+
private getOctokit;
|
|
18
|
+
/**
|
|
19
|
+
* Create a pull request
|
|
20
|
+
*/
|
|
21
|
+
createPullRequest(owner: string, repo: string, head: string, base: string, title: string, body?: string, draft?: boolean): Promise<PRCreateResult>;
|
|
22
|
+
/**
|
|
23
|
+
* Get pull request details
|
|
24
|
+
*/
|
|
25
|
+
getPullRequest(owner: string, repo: string, pullNumber: number): Promise<PullRequest>;
|
|
26
|
+
/**
|
|
27
|
+
* Update pull request body
|
|
28
|
+
*/
|
|
29
|
+
updatePullRequestBody(owner: string, repo: string, pullNumber: number, body: string): Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* Merge a pull request
|
|
32
|
+
*/
|
|
33
|
+
mergePullRequest(owner: string, repo: string, pullNumber: number, options?: PRMergeOptions): Promise<boolean>;
|
|
34
|
+
/**
|
|
35
|
+
* Find PR by branch name
|
|
36
|
+
*/
|
|
37
|
+
findPRByBranch(owner: string, repo: string, branch: string): Promise<PRCreateResult | null>;
|
|
38
|
+
/**
|
|
39
|
+
* Check if PR is approved
|
|
40
|
+
*/
|
|
41
|
+
isPullRequestApproved(owner: string, repo: string, pullNumber: number): Promise<boolean>;
|
|
42
|
+
/**
|
|
43
|
+
* Get PR reviews
|
|
44
|
+
*/
|
|
45
|
+
getPullRequestReviews(owner: string, repo: string, pullNumber: number): Promise<PRReview[]>;
|
|
46
|
+
/**
|
|
47
|
+
* Get status checks for a commit
|
|
48
|
+
*/
|
|
49
|
+
getStatusChecks(owner: string, repo: string, ref: string): Promise<StatusCheckResult>;
|
|
50
|
+
/**
|
|
51
|
+
* Parse GitHub URL to extract owner/repo
|
|
52
|
+
*/
|
|
53
|
+
parseRepoUrl(url: string): ParsedRepoInfo | null;
|
|
54
|
+
/**
|
|
55
|
+
* Check if URL matches GitHub
|
|
56
|
+
*/
|
|
57
|
+
matchesUrl(url: string): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Generate HTML comment for linked PR tracking
|
|
60
|
+
*/
|
|
61
|
+
generateLinkedPRComment(links: {
|
|
62
|
+
repoName: string;
|
|
63
|
+
number: number;
|
|
64
|
+
}[]): string;
|
|
65
|
+
/**
|
|
66
|
+
* Parse linked PRs from PR body
|
|
67
|
+
*/
|
|
68
|
+
parseLinkedPRComment(body: string): {
|
|
69
|
+
repoName: string;
|
|
70
|
+
number: number;
|
|
71
|
+
}[];
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Get a GitHub platform instance (cached by config)
|
|
75
|
+
* @deprecated Use getPlatformAdapter('github', config) from platform/index.ts instead
|
|
76
|
+
*/
|
|
77
|
+
export declare function getGitHubPlatform(config?: PlatformConfig): GitHubPlatform;
|
|
78
|
+
/**
|
|
79
|
+
* Create a new GitHub platform instance (for custom configurations)
|
|
80
|
+
*/
|
|
81
|
+
export declare function createGitHubPlatform(config?: PlatformConfig): GitHubPlatform;
|
|
82
|
+
//# sourceMappingURL=github.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../../../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