@remogram/provider-github-api 0.1.0-beta.5 → 0.1.0-beta.8
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/index.js +13 -22
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
gitAheadBehind,
|
|
13
13
|
refsInventory,
|
|
14
14
|
crInventory,
|
|
15
|
-
|
|
15
|
+
buildMergePlanFromProviderFacts,
|
|
16
16
|
ERROR_CODES,
|
|
17
17
|
forgeError,
|
|
18
18
|
forgeIngestCapabilityFacts,
|
|
@@ -52,6 +52,7 @@ import {
|
|
|
52
52
|
normalizeStatusSetState,
|
|
53
53
|
statusSetIdempotencyScanCapabilityFacts,
|
|
54
54
|
MAX_OPEN_PULL_IDEMPOTENCY_PAGES,
|
|
55
|
+
assertWriteCommandConfigured,
|
|
55
56
|
} from '@remogram/core';
|
|
56
57
|
|
|
57
58
|
const PUBLIC_GITHUB_HOST = 'github.com';
|
|
@@ -434,10 +435,10 @@ export async function refsCompare(ctx, baseRef, headRef) {
|
|
|
434
435
|
}
|
|
435
436
|
const counts = gitAheadBehind(ctx.cwd, baseSha, headSha);
|
|
436
437
|
return {
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
438
|
+
compare_base_ref: sanitizeField(baseRef),
|
|
439
|
+
compare_base_sha: baseSha,
|
|
440
|
+
compare_head_ref: sanitizeField(headRef),
|
|
441
|
+
compare_head_sha: headSha,
|
|
441
442
|
...counts,
|
|
442
443
|
};
|
|
443
444
|
}
|
|
@@ -459,10 +460,10 @@ export async function prView(ctx, opts) {
|
|
|
459
460
|
url: sanitizeUrl(pr.html_url ?? pr.url),
|
|
460
461
|
title: sanitizeField(pr.title),
|
|
461
462
|
state: sanitizeField(pr.state),
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
463
|
+
forge_target_branch_ref: sanitizeField(pr.base?.ref),
|
|
464
|
+
forge_target_sha: sanitizeField(pr.base?.sha),
|
|
465
|
+
forge_source_branch_ref: sanitizeField(pr.head?.ref),
|
|
466
|
+
forge_source_sha: sanitizeField(pr.head?.sha),
|
|
466
467
|
mergeability: mergeability(pr),
|
|
467
468
|
};
|
|
468
469
|
}
|
|
@@ -549,7 +550,7 @@ export async function prChecks(ctx, opts) {
|
|
|
549
550
|
const mapped = [...mappedStatuses, ...mappedCheckRuns];
|
|
550
551
|
const checks_truncated = statusResult.truncated || checkRunResult.truncated;
|
|
551
552
|
return {
|
|
552
|
-
|
|
553
|
+
forge_source_sha: sha,
|
|
553
554
|
check_conclusion: summarizeChecks(mapped),
|
|
554
555
|
checks_truncated,
|
|
555
556
|
statuses: mapped,
|
|
@@ -557,18 +558,7 @@ export async function prChecks(ctx, opts) {
|
|
|
557
558
|
}
|
|
558
559
|
|
|
559
560
|
export async function mergePlan(ctx, opts) {
|
|
560
|
-
|
|
561
|
-
const checks = await prChecks(ctx, { number: view.pr_number });
|
|
562
|
-
let mergeOpts = opts;
|
|
563
|
-
if (opts.allowed_paths) {
|
|
564
|
-
try {
|
|
565
|
-
const crFilesBody = await crFiles(ctx, { number: view.pr_number });
|
|
566
|
-
mergeOpts = { ...opts, changed_paths: crFilesBody.changed_paths };
|
|
567
|
-
} catch {
|
|
568
|
-
// Fall back to local git diff in resolveMergePlanPathScope.
|
|
569
|
-
}
|
|
570
|
-
}
|
|
571
|
-
return buildMergePlanBodyFromFacts(ctx, view, checks, mergeOpts);
|
|
561
|
+
return buildMergePlanFromProviderFacts(ctx, opts, { prView, prChecks, crFiles });
|
|
572
562
|
}
|
|
573
563
|
|
|
574
564
|
export async function crFiles(ctx, { number }) {
|
|
@@ -1009,6 +999,7 @@ export async function findCommitStatusByContext(ctx, sha, context) {
|
|
|
1009
999
|
}
|
|
1010
1000
|
|
|
1011
1001
|
export async function statusSet(ctx, args) {
|
|
1002
|
+
assertWriteCommandConfigured(ctx.config, 'status_set');
|
|
1012
1003
|
const parsed = parseStatusSetArgs(args);
|
|
1013
1004
|
const existing = await findCommitStatusByContext(ctx, parsed.sha, parsed.context);
|
|
1014
1005
|
if (existing) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remogram/provider-github-api",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.8",
|
|
4
4
|
"description": "GitHub API provider for remogram",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,6 +22,6 @@
|
|
|
22
22
|
"node": ">=20"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@remogram/core": "0.1.0-beta.
|
|
25
|
+
"@remogram/core": "0.1.0-beta.8"
|
|
26
26
|
}
|
|
27
27
|
}
|