@codepulse-oss/github 0.0.0-stage → 3.0.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/dist/__tests__/attribution.test.d.ts +2 -0
- package/dist/__tests__/attribution.test.d.ts.map +1 -0
- package/dist/__tests__/attribution.test.js +34 -0
- package/dist/__tests__/attribution.test.js.map +1 -0
- package/dist/__tests__/device-flow.test.d.ts +2 -0
- package/dist/__tests__/device-flow.test.d.ts.map +1 -0
- package/dist/__tests__/device-flow.test.js +94 -0
- package/dist/__tests__/device-flow.test.js.map +1 -0
- package/dist/__tests__/phase3.test.d.ts +2 -0
- package/dist/__tests__/phase3.test.d.ts.map +1 -0
- package/dist/__tests__/phase3.test.js +203 -0
- package/dist/__tests__/phase3.test.js.map +1 -0
- package/dist/__tests__/v2-providers.test.d.ts +2 -0
- package/dist/__tests__/v2-providers.test.d.ts.map +1 -0
- package/dist/__tests__/v2-providers.test.js +54 -0
- package/dist/__tests__/v2-providers.test.js.map +1 -0
- package/dist/__tests__/v3-check-runs.test.d.ts +2 -0
- package/dist/__tests__/v3-check-runs.test.d.ts.map +1 -0
- package/dist/__tests__/v3-check-runs.test.js +43 -0
- package/dist/__tests__/v3-check-runs.test.js.map +1 -0
- package/dist/app-manifest.d.ts +38 -0
- package/dist/app-manifest.d.ts.map +1 -0
- package/dist/app-manifest.js +138 -0
- package/dist/app-manifest.js.map +1 -0
- package/dist/auth.d.ts +18 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +54 -0
- package/dist/auth.js.map +1 -0
- package/dist/babysitter.d.ts +25 -0
- package/dist/babysitter.d.ts.map +1 -0
- package/dist/babysitter.js +94 -0
- package/dist/babysitter.js.map +1 -0
- package/dist/check-runs.d.ts +44 -0
- package/dist/check-runs.d.ts.map +1 -0
- package/dist/check-runs.js +105 -0
- package/dist/check-runs.js.map +1 -0
- package/dist/commands.d.ts +27 -0
- package/dist/commands.d.ts.map +1 -0
- package/dist/commands.js +125 -0
- package/dist/commands.js.map +1 -0
- package/dist/commit-fix.d.ts +22 -0
- package/dist/commit-fix.d.ts.map +1 -0
- package/dist/commit-fix.js +67 -0
- package/dist/commit-fix.js.map +1 -0
- package/dist/device-flow.d.ts +64 -0
- package/dist/device-flow.d.ts.map +1 -0
- package/dist/device-flow.js +127 -0
- package/dist/device-flow.js.map +1 -0
- package/dist/hunk-mapper.d.ts +58 -0
- package/dist/hunk-mapper.d.ts.map +1 -0
- package/dist/hunk-mapper.js +239 -0
- package/dist/hunk-mapper.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/poller.d.ts +47 -0
- package/dist/poller.d.ts.map +1 -0
- package/dist/poller.js +174 -0
- package/dist/poller.js.map +1 -0
- package/dist/providers/bitbucket.d.ts +29 -0
- package/dist/providers/bitbucket.d.ts.map +1 -0
- package/dist/providers/bitbucket.js +63 -0
- package/dist/providers/bitbucket.js.map +1 -0
- package/dist/providers/gitlab.d.ts +29 -0
- package/dist/providers/gitlab.d.ts.map +1 -0
- package/dist/providers/gitlab.js +67 -0
- package/dist/providers/gitlab.js.map +1 -0
- package/dist/repo-cache.d.ts +15 -0
- package/dist/repo-cache.d.ts.map +1 -0
- package/dist/repo-cache.js +59 -0
- package/dist/repo-cache.js.map +1 -0
- package/dist/stacked-pr.d.ts +18 -0
- package/dist/stacked-pr.d.ts.map +1 -0
- package/dist/stacked-pr.js +22 -0
- package/dist/stacked-pr.js.map +1 -0
- package/package.json +35 -4
- package/README.md +0 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attribution.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/attribution.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { mapFindingsToGitHubPr } from '../index.js';
|
|
4
|
+
const SAMPLE_OUTPUT = {
|
|
5
|
+
verdict: 'approve',
|
|
6
|
+
summary: 'All checks passed.',
|
|
7
|
+
merge_gate: { passed: true, blockers_count: 0, high_count: 0, reason: 'Clean' },
|
|
8
|
+
findings: [],
|
|
9
|
+
next_steps: []
|
|
10
|
+
};
|
|
11
|
+
const SAMPLE_DIFF = `diff --git a/src/a.ts b/src/a.ts
|
|
12
|
+
--- a/src/a.ts
|
|
13
|
+
+++ b/src/a.ts
|
|
14
|
+
@@ -1,1 +1,2 @@
|
|
15
|
+
export const a = 1;
|
|
16
|
+
+export const b = 2;`;
|
|
17
|
+
test('PR attribution footer is included with token savings by default and completely hidden when attribution.enabled = false', () => {
|
|
18
|
+
const withFooter = mapFindingsToGitHubPr(SAMPLE_OUTPUT, SAMPLE_DIFF, {
|
|
19
|
+
tokenMetrics: {
|
|
20
|
+
analyzedFiles: 14,
|
|
21
|
+
rawDiffTokens: 10_000,
|
|
22
|
+
astSlicedTokens: 3_800
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
assert.ok(withFooter.summaryBody.includes('Reviewed by [CodePulse]'));
|
|
26
|
+
assert.ok(withFooter.summaryBody.includes('Analyzed 14 affected file(s) via AST Graph (~62% fewer tokens than full-diff dump)'));
|
|
27
|
+
const withoutFooter = mapFindingsToGitHubPr(SAMPLE_OUTPUT, SAMPLE_DIFF, {
|
|
28
|
+
attribution: { enabled: false },
|
|
29
|
+
tokenMetrics: { analyzedFiles: 14, tokenSavingsPercent: 62 }
|
|
30
|
+
});
|
|
31
|
+
assert.ok(!withoutFooter.summaryBody.includes('Reviewed by [CodePulse]'));
|
|
32
|
+
assert.ok(!withoutFooter.summaryBody.includes('fewer tokens than full-diff dump'));
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=attribution.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attribution.test.js","sourceRoot":"","sources":["../../src/__tests__/attribution.test.ts"],"names":[],"mappings":"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AAC,CAAC;AACrF,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"device-flow.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/device-flow.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { DEFAULT_GITHUB_DEVICE_CLIENT_ID, listAccessibleGitHubRepos, listOpenPullRequests, pollGitHubDeviceFlow, startGitHubDeviceFlow } from '../index.js';
|
|
4
|
+
test('GitHub Device Flow handles start, pending, slow_down, and authorized transitions', async () => {
|
|
5
|
+
assert.equal(DEFAULT_GITHUB_DEVICE_CLIENT_ID, 'Iv23liO2ym8AEequZMcc');
|
|
6
|
+
let pollStage = 0;
|
|
7
|
+
const mockFetch = async (url, init) => {
|
|
8
|
+
const u = String(url);
|
|
9
|
+
if (u.includes('/login/device/code')) {
|
|
10
|
+
assert.ok(String(init?.body).includes('client_id=Iv23liO2ym8AEequZMcc'));
|
|
11
|
+
return new Response(JSON.stringify({
|
|
12
|
+
device_code: 'dev-code-abc',
|
|
13
|
+
user_code: 'ABCD-1234',
|
|
14
|
+
verification_uri: 'https://github.com/login/device',
|
|
15
|
+
expires_in: 900,
|
|
16
|
+
interval: 5
|
|
17
|
+
}), { status: 200 });
|
|
18
|
+
}
|
|
19
|
+
pollStage++;
|
|
20
|
+
if (pollStage === 1) {
|
|
21
|
+
return new Response(JSON.stringify({ error: 'authorization_pending' }), { status: 200 });
|
|
22
|
+
}
|
|
23
|
+
if (pollStage === 2) {
|
|
24
|
+
return new Response(JSON.stringify({ error: 'slow_down', interval: 10 }), { status: 200 });
|
|
25
|
+
}
|
|
26
|
+
return new Response(JSON.stringify({ access_token: 'ghu_mock_device_token_999', token_type: 'bearer' }), { status: 200 });
|
|
27
|
+
};
|
|
28
|
+
const started = await startGitHubDeviceFlow({ fetchImpl: mockFetch });
|
|
29
|
+
assert.equal(started.userCode, 'ABCD-1234');
|
|
30
|
+
assert.equal(started.verificationUri, 'https://github.com/login/device');
|
|
31
|
+
const p1 = await pollGitHubDeviceFlow({ deviceCode: started.deviceCode, fetchImpl: mockFetch });
|
|
32
|
+
assert.equal(p1.status, 'pending');
|
|
33
|
+
const p2 = await pollGitHubDeviceFlow({ deviceCode: started.deviceCode, fetchImpl: mockFetch });
|
|
34
|
+
assert.equal(p2.status, 'slow_down');
|
|
35
|
+
assert.equal(p2.interval, 10);
|
|
36
|
+
const p3 = await pollGitHubDeviceFlow({ deviceCode: started.deviceCode, fetchImpl: mockFetch });
|
|
37
|
+
assert.equal(p3.status, 'authorized');
|
|
38
|
+
assert.equal(p3.accessToken, 'ghu_mock_device_token_999');
|
|
39
|
+
});
|
|
40
|
+
test('Repo Picker and Open PR Browser parse Octokit responses cleanly', async () => {
|
|
41
|
+
const mockOctokit = {
|
|
42
|
+
repos: {
|
|
43
|
+
listForAuthenticatedUser: async () => ({
|
|
44
|
+
data: [
|
|
45
|
+
{
|
|
46
|
+
id: 101,
|
|
47
|
+
full_name: 'ymorningstar/CodePulse',
|
|
48
|
+
owner: { login: 'ymorningstar' },
|
|
49
|
+
name: 'CodePulse',
|
|
50
|
+
private: false,
|
|
51
|
+
default_branch: 'main',
|
|
52
|
+
description: 'AI Review',
|
|
53
|
+
updated_at: '2026-12-05T00:00:00Z',
|
|
54
|
+
html_url: 'https://github.com/ymorningstar/CodePulse'
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
id: 102,
|
|
58
|
+
full_name: 'ymorningstar/private-billing',
|
|
59
|
+
owner: { login: 'ymorningstar' },
|
|
60
|
+
name: 'private-billing',
|
|
61
|
+
private: true,
|
|
62
|
+
default_branch: 'main',
|
|
63
|
+
description: null,
|
|
64
|
+
updated_at: '2026-12-05T00:00:00Z',
|
|
65
|
+
html_url: 'https://github.com/ymorningstar/private-billing'
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
})
|
|
69
|
+
},
|
|
70
|
+
pulls: {
|
|
71
|
+
list: async () => ({
|
|
72
|
+
data: [
|
|
73
|
+
{
|
|
74
|
+
number: 21,
|
|
75
|
+
title: 'Fix payment rounding',
|
|
76
|
+
user: { login: 'ymorningstar' },
|
|
77
|
+
head: { ref: 'fix/rounding', sha: 'sha21' },
|
|
78
|
+
base: { ref: 'main' },
|
|
79
|
+
updated_at: '2026-12-05T01:00:00Z',
|
|
80
|
+
html_url: 'https://github.com/ymorningstar/CodePulse/pull/21'
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
})
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
const repos = await listAccessibleGitHubRepos(mockOctokit);
|
|
87
|
+
assert.equal(repos.length, 2);
|
|
88
|
+
assert.equal(repos[1]?.private, true);
|
|
89
|
+
const pulls = await listOpenPullRequests(mockOctokit, 'ymorningstar', 'CodePulse');
|
|
90
|
+
assert.equal(pulls.length, 1);
|
|
91
|
+
assert.equal(pulls[0]?.number, 21);
|
|
92
|
+
assert.equal(pulls[0]?.headRef, 'fix/rounding');
|
|
93
|
+
});
|
|
94
|
+
//# sourceMappingURL=device-flow.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"device-flow.test.js","sourceRoot":"","sources":["../../src/__tests__/device-flow.test.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EACL,+BAA+B,EAC/B,yBAAyB,EACzB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,aAAa,CAAC;AAErB,IAAI,CAAC,kFAAkF,EAAE,KAAK,IAAI,EAAE;IAClG,MAAM,CAAC,KAAK,CAAC,+BAA+B,EAAE,sBAAsB,CAAC,CAAC;IAEtE,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,MAAM,SAAS,GAAiB,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE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CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;IACnC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;AAClD,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phase3.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/phase3.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import crypto from 'node:crypto';
|
|
4
|
+
import { CodePulseDatabase } from '@codepulse-oss/core';
|
|
5
|
+
import { GitHubRepoPoller, babysitPrThreads, createWebhookRouter, mapFindingsToGitHubPr, parsePrCommentCommand } from '../index.js';
|
|
6
|
+
test('Slash command and Arabic/English natural-language parser handles PR mentions', () => {
|
|
7
|
+
assert.equal(parsePrCommentCommand('/codepulse review')?.command, 'review');
|
|
8
|
+
assert.equal(parsePrCommentCommand('/adversarial focus on billing')?.command, 'adversarial');
|
|
9
|
+
assert.equal(parsePrCommentCommand('/autofix CP-SQL-001')?.command, 'autofix');
|
|
10
|
+
assert.equal(parsePrCommentCommand('/revalidate')?.command, 'revalidate');
|
|
11
|
+
assert.equal(parsePrCommentCommand('/describe')?.command, 'describe');
|
|
12
|
+
assert.equal(parsePrCommentCommand('/add_docs')?.command, 'add_docs');
|
|
13
|
+
assert.equal(parsePrCommentCommand('/codepulse add-docs')?.command, 'add_docs');
|
|
14
|
+
const ar = parsePrCommentCommand('@codepulse هل دالة الدفع آمنة من التكرار؟');
|
|
15
|
+
assert.equal(ar?.command, 'question');
|
|
16
|
+
assert.ok(ar?.args.includes('الدفع'));
|
|
17
|
+
// Ignore CodePulse's own summary/comments
|
|
18
|
+
assert.equal(parsePrCommentCommand('<!-- codepulse-summary -->\n## Summary'), null);
|
|
19
|
+
});
|
|
20
|
+
test('PR hunk mapper places inline suggestions inside diff hunks and overflows others to summary', () => {
|
|
21
|
+
const diff = `diff --git a/src/pay.ts b/src/pay.ts
|
|
22
|
+
--- a/src/pay.ts
|
|
23
|
+
+++ b/src/pay.ts
|
|
24
|
+
@@ -10,2 +10,3 @@ export function charge() {
|
|
25
|
+
const a = 1;
|
|
26
|
+
+ const fee = parseFloat(input) * 0.03;
|
|
27
|
+
return a;
|
|
28
|
+
}`;
|
|
29
|
+
const output = {
|
|
30
|
+
verdict: 'needs-attention',
|
|
31
|
+
summary: 'Found 2 issues.',
|
|
32
|
+
merge_gate: { passed: false, blockers_count: 0, high_count: 2, reason: '2 high issues' },
|
|
33
|
+
findings: [
|
|
34
|
+
{
|
|
35
|
+
id: 'f-inline',
|
|
36
|
+
severity: 'high',
|
|
37
|
+
confidence: 0.92,
|
|
38
|
+
category: 'finance',
|
|
39
|
+
title: 'Float currency multiplication',
|
|
40
|
+
body: 'Causes penny drift.',
|
|
41
|
+
file: 'src/pay.ts',
|
|
42
|
+
line_start: 11,
|
|
43
|
+
line_end: 11,
|
|
44
|
+
source: 'sast',
|
|
45
|
+
blast_radius: { risk_score: 70, direct_callers: [], affected_tests: [], impacted_files: [] },
|
|
46
|
+
recommendation: 'Use integer cents.',
|
|
47
|
+
patch_suggestion: 'const feeCents = Math.round(amountCents * 3 / 100);',
|
|
48
|
+
status: 'open'
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
id: 'f-outside',
|
|
52
|
+
severity: 'high',
|
|
53
|
+
confidence: 0.85,
|
|
54
|
+
category: 'auth',
|
|
55
|
+
title: 'Missing guard in unrelated line',
|
|
56
|
+
body: 'Outside PR hunk.',
|
|
57
|
+
file: 'src/pay.ts',
|
|
58
|
+
line_start: 80,
|
|
59
|
+
line_end: 82,
|
|
60
|
+
source: 'ai',
|
|
61
|
+
blast_radius: { risk_score: 60, direct_callers: [], affected_tests: [], impacted_files: [] },
|
|
62
|
+
recommendation: 'Add guard.',
|
|
63
|
+
status: 'open'
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
next_steps: ['Fix float math']
|
|
67
|
+
};
|
|
68
|
+
const mapped = mapFindingsToGitHubPr(output, diff);
|
|
69
|
+
assert.equal(mapped.inlineComments.length, 1);
|
|
70
|
+
assert.equal(mapped.inlineComments[0]?.line, 11);
|
|
71
|
+
assert.ok(mapped.inlineComments[0]?.body.includes('```suggestion'));
|
|
72
|
+
assert.equal(mapped.summaryFindings.length, 1);
|
|
73
|
+
assert.equal(mapped.summaryFindings[0]?.id, 'f-outside');
|
|
74
|
+
assert.ok(mapped.reviewEffortScore >= 1 && mapped.reviewEffortScore <= 5);
|
|
75
|
+
assert.ok(mapped.summaryBody.includes('Review Effort:'));
|
|
76
|
+
assert.ok(mapped.summaryBody.includes('Files Walkthrough'));
|
|
77
|
+
assert.ok(mapped.summaryBody.includes('src/pay.ts'));
|
|
78
|
+
});
|
|
79
|
+
test('PR Thread Babysitter resolves fixed threads across commit rounds', async () => {
|
|
80
|
+
const db = new CodePulseDatabase(':memory:');
|
|
81
|
+
try {
|
|
82
|
+
const repo = db.upsertRepo({ name: 'api', githubOwner: 'acme', githubRepo: 'api' });
|
|
83
|
+
const job1 = db.createJob({ repoId: repo.id, target: 'pr', mode: 'debate', prNumber: 42 });
|
|
84
|
+
db.saveFindings(job1.id, repo.id, [
|
|
85
|
+
{
|
|
86
|
+
id: 'f-sqli',
|
|
87
|
+
severity: 'critical',
|
|
88
|
+
confidence: 0.95,
|
|
89
|
+
category: 'security',
|
|
90
|
+
title: 'SQL injection',
|
|
91
|
+
body: 'Interpolated query',
|
|
92
|
+
file: 'src/db.ts',
|
|
93
|
+
line_start: 15,
|
|
94
|
+
line_end: 15,
|
|
95
|
+
source: 'sast',
|
|
96
|
+
rule_id: 'CP-SQL-001',
|
|
97
|
+
blast_radius: { risk_score: 90, direct_callers: [], affected_tests: [], impacted_files: [] },
|
|
98
|
+
recommendation: 'Parameterize query',
|
|
99
|
+
status: 'open'
|
|
100
|
+
}
|
|
101
|
+
]);
|
|
102
|
+
db.upsertPrThread({
|
|
103
|
+
id: `${repo.id}:pr42:f-sqli`,
|
|
104
|
+
repoId: repo.id,
|
|
105
|
+
prNumber: 42,
|
|
106
|
+
githubCommentId: null,
|
|
107
|
+
file: 'src/db.ts',
|
|
108
|
+
line: 15,
|
|
109
|
+
findingId: 'f-sqli',
|
|
110
|
+
status: 'open',
|
|
111
|
+
lastCommitSha: 'sha111',
|
|
112
|
+
roundNumber: 1
|
|
113
|
+
});
|
|
114
|
+
const cleanDiff = `diff --git a/src/db.ts b/src/db.ts
|
|
115
|
+
--- a/src/db.ts
|
|
116
|
+
+++ b/src/db.ts
|
|
117
|
+
@@ -14,2 +14,2 @@
|
|
118
|
+
- return db.query(\`SELECT * FROM users WHERE id = \${id}\`);
|
|
119
|
+
+ return db.query('SELECT * FROM users WHERE id = $1', [id]);`;
|
|
120
|
+
const cleanOutput = {
|
|
121
|
+
verdict: 'approve',
|
|
122
|
+
summary: 'Clean',
|
|
123
|
+
merge_gate: { passed: true, blockers_count: 0, high_count: 0, reason: 'Clean' },
|
|
124
|
+
findings: [],
|
|
125
|
+
next_steps: []
|
|
126
|
+
};
|
|
127
|
+
const res = await babysitPrThreads({
|
|
128
|
+
db,
|
|
129
|
+
repoId: repo.id,
|
|
130
|
+
owner: 'acme',
|
|
131
|
+
repo: 'api',
|
|
132
|
+
prNumber: 42,
|
|
133
|
+
headSha: 'sha222',
|
|
134
|
+
latestReview: cleanOutput,
|
|
135
|
+
prDiffText: cleanDiff
|
|
136
|
+
});
|
|
137
|
+
assert.deepEqual(res.resolvedThreads, [`${repo.id}:pr42:f-sqli`]);
|
|
138
|
+
assert.equal(db.getFinding('f-sqli')?.status, 'verified_fixed');
|
|
139
|
+
}
|
|
140
|
+
finally {
|
|
141
|
+
db.close();
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
test('Zero-port Poller & Webhook router detect new PR commits and slash commands without duplicates', async () => {
|
|
145
|
+
const db = new CodePulseDatabase(':memory:');
|
|
146
|
+
try {
|
|
147
|
+
const fakeOctokit = {
|
|
148
|
+
pulls: {
|
|
149
|
+
list: async () => ({
|
|
150
|
+
data: [
|
|
151
|
+
{
|
|
152
|
+
number: 7,
|
|
153
|
+
head: { sha: 'abc123', ref: 'feat/auth' },
|
|
154
|
+
base: { ref: 'main' }
|
|
155
|
+
}
|
|
156
|
+
]
|
|
157
|
+
})
|
|
158
|
+
},
|
|
159
|
+
issues: {
|
|
160
|
+
listComments: async () => ({
|
|
161
|
+
data: [
|
|
162
|
+
{ id: 1001, body: '/debate check auth' },
|
|
163
|
+
{ id: 1002, body: 'Looks good to me' }
|
|
164
|
+
]
|
|
165
|
+
})
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
const triggered = [];
|
|
169
|
+
const poller = new GitHubRepoPoller(fakeOctokit, db, (t) => {
|
|
170
|
+
triggered.push({ type: t.type, cmd: t.command?.command });
|
|
171
|
+
});
|
|
172
|
+
const first = await poller.pollRepoOnce('acme', 'app');
|
|
173
|
+
assert.equal(first.length, 2);
|
|
174
|
+
assert.equal(triggered[0]?.type, 'pull_request');
|
|
175
|
+
assert.equal(triggered[1]?.cmd, 'debate');
|
|
176
|
+
// Second poll with same SHA and comments triggers nothing
|
|
177
|
+
const second = await poller.pollRepoOnce('acme', 'app');
|
|
178
|
+
assert.equal(second.length, 0);
|
|
179
|
+
// Webhook HMAC verification
|
|
180
|
+
const secret = 'test-webhook-secret';
|
|
181
|
+
let webhookFired = false;
|
|
182
|
+
const webhooks = createWebhookRouter(secret, () => {
|
|
183
|
+
webhookFired = true;
|
|
184
|
+
});
|
|
185
|
+
const payloadStr = JSON.stringify({
|
|
186
|
+
action: 'opened',
|
|
187
|
+
pull_request: { number: 9, head: { sha: 'def456', ref: 'feat/x' }, base: { ref: 'main' } },
|
|
188
|
+
repository: { name: 'app', owner: { login: 'acme' } }
|
|
189
|
+
});
|
|
190
|
+
const sig = 'sha256=' + crypto.createHmac('sha256', secret).update(payloadStr).digest('hex');
|
|
191
|
+
await webhooks.verifyAndReceive({
|
|
192
|
+
id: 'evt-1',
|
|
193
|
+
name: 'pull_request',
|
|
194
|
+
signature: sig,
|
|
195
|
+
payload: payloadStr
|
|
196
|
+
});
|
|
197
|
+
assert.equal(webhookFired, true);
|
|
198
|
+
}
|
|
199
|
+
finally {
|
|
200
|
+
db.close();
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
//# sourceMappingURL=phase3.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phase3.test.js","sourceRoot":"","sources":["../../src/__tests__/phase3.test.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EACL,iBAAiB,EAElB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,aAAa,CAAC;AAErB,IAAI,CAAC,8EAA8E,EAAE,GAAG,EAAE;IACxF,MAAM,CAAC,KAAK,CAAC,qBAAqB,CAAC,mBAAmB,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC5E,MAAM,CAAC,KAAK,CAAC,qBAAqB,CAAC,+BAA+B,CAAC,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC;IAC7F,MAAM,CAAC,KAAK,CAAC,qBAAqB,CAAC,qBAAqB,CAAC,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;IAC/E,MAAM,CAAC,KAAK,CAAC,qBAAqB,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC;IAC1E,MAAM,CAAC,KAAK,CAAC,qBAAqB,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;IACtE,MAAM,CAAC,KAAK,CAAC,qBAAqB,CAAC,W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E,CAAC,KAAK,EAAE,CAAC;IACb,CAAC;AACH,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v2-providers.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/v2-providers.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import fs from 'node:fs/promises';
|
|
4
|
+
import os from 'node:os';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import { detectStackedPrChains, listAccessibleBitbucketRepos, listAccessibleGitLabProjects, pushGuardedCommitFixToPrBranch } from '../index.js';
|
|
7
|
+
test('v2.0 GitLab and Bitbucket adapters list projects and stacked PR chains link correctly', async () => {
|
|
8
|
+
const gl = await listAccessibleGitLabProjects({
|
|
9
|
+
baseUrl: 'https://gitlab.example.com/',
|
|
10
|
+
token: 'glpat-test',
|
|
11
|
+
fetchImpl: async () => new Response(JSON.stringify([
|
|
12
|
+
{ id: 7, name_with_namespace: 'org/core', path_with_namespace: 'org/core', web_url: 'https://gitlab.example.com/org/core', default_branch: 'main' }
|
|
13
|
+
]), { status: 200 })
|
|
14
|
+
});
|
|
15
|
+
assert.equal(gl[0]?.pathWithNamespace, 'org/core');
|
|
16
|
+
const bb = await listAccessibleBitbucketRepos({
|
|
17
|
+
token: 'bb-tok',
|
|
18
|
+
fetchImpl: async () => new Response(JSON.stringify({
|
|
19
|
+
values: [{ full_name: 'team/api', slug: 'api', workspace: { slug: 'team' }, mainbranch: { name: 'main' } }]
|
|
20
|
+
}), { status: 200 })
|
|
21
|
+
});
|
|
22
|
+
assert.equal(bb[0]?.fullName, 'team/api');
|
|
23
|
+
const stacked = detectStackedPrChains([
|
|
24
|
+
{ number: 101, title: 'Base auth', headRef: 'feat/auth', baseRef: 'main' },
|
|
25
|
+
{ number: 102, title: 'Stacked billing', headRef: 'feat/billing', baseRef: 'feat/auth' }
|
|
26
|
+
]);
|
|
27
|
+
assert.equal(stacked[0]?.isStacked, false);
|
|
28
|
+
assert.equal(stacked[1]?.isStacked, true);
|
|
29
|
+
assert.equal(stacked[1]?.parentPrNumber, 101);
|
|
30
|
+
});
|
|
31
|
+
test('v2.0 Guarded /commit-fix refuses protected main/master branches cleanly', async () => {
|
|
32
|
+
const dir = await fs.mkdtemp(path.join(os.tmpdir(), 'cp-v2-cfit-'));
|
|
33
|
+
try {
|
|
34
|
+
const blockedMain = await pushGuardedCommitFixToPrBranch({
|
|
35
|
+
repoPath: dir,
|
|
36
|
+
headRef: 'main',
|
|
37
|
+
findingId: 'f1',
|
|
38
|
+
optInPush: true
|
|
39
|
+
});
|
|
40
|
+
assert.equal(blockedMain.allowed, false);
|
|
41
|
+
assert.equal(blockedMain.pushed, false);
|
|
42
|
+
const blockedNoOptIn = await pushGuardedCommitFixToPrBranch({
|
|
43
|
+
repoPath: dir,
|
|
44
|
+
headRef: 'feat/fix-1',
|
|
45
|
+
findingId: 'f1',
|
|
46
|
+
optInPush: false
|
|
47
|
+
});
|
|
48
|
+
assert.equal(blockedNoOptIn.allowed, false);
|
|
49
|
+
}
|
|
50
|
+
finally {
|
|
51
|
+
await fs.rm(dir, { recursive: true, force: true });
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
//# sourceMappingURL=v2-providers.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v2-providers.test.js","sourceRoot":"","sources":["../../src/__tests__/v2-providers.test.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACL,qBAAqB,EACrB,4BAA4B,EAC5B,4BAA4B,EAC5B,8BAA8B,EAC/B,MAAM,aAAa,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,CAAC,CAAC;IACrD,CAAC;AACH,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v3-check-runs.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/v3-check-runs.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { buildValidatedReviewOutput } from '@codepulse-oss/core';
|
|
4
|
+
import { postGitHubCheckRun } from '../index.js';
|
|
5
|
+
test('postGitHubCheckRun posts line-level annotations and enforces configurable merge policy gate', async () => {
|
|
6
|
+
const output = buildValidatedReviewOutput('Security audit', [
|
|
7
|
+
{
|
|
8
|
+
id: 'crit-1',
|
|
9
|
+
severity: 'critical',
|
|
10
|
+
confidence: 0.95,
|
|
11
|
+
category: 'security',
|
|
12
|
+
title: 'Reachable SQL Injection',
|
|
13
|
+
body: 'Query uses string interpolation.',
|
|
14
|
+
file: 'src/routes/orders.ts',
|
|
15
|
+
line_start: 22,
|
|
16
|
+
line_end: 24,
|
|
17
|
+
rule_id: 'CP-AST-SQLI-TEMPLATE',
|
|
18
|
+
source: 'sast',
|
|
19
|
+
reachability: 'external_reachable',
|
|
20
|
+
blast_radius: { risk_score: 88, direct_callers: [], affected_tests: [], impacted_files: [] },
|
|
21
|
+
recommendation: 'Use parameterized query.',
|
|
22
|
+
status: 'open'
|
|
23
|
+
}
|
|
24
|
+
], []);
|
|
25
|
+
let capturedPayload = {};
|
|
26
|
+
const result = await postGitHubCheckRun({
|
|
27
|
+
owner: 'acme',
|
|
28
|
+
repo: 'web',
|
|
29
|
+
headSha: 'abc1234',
|
|
30
|
+
token: 'tok',
|
|
31
|
+
output,
|
|
32
|
+
policy: { failOnReachableCritical: true, minPatchCoverage: 80 },
|
|
33
|
+
fetchImpl: (async (_url, init) => {
|
|
34
|
+
capturedPayload = JSON.parse(String(init?.body ?? '{}'));
|
|
35
|
+
return new Response(JSON.stringify({ id: 9001, html_url: 'https://github.com/acme/web/runs/9001' }), { status: 201, headers: { 'Content-Type': 'application/json' } });
|
|
36
|
+
})
|
|
37
|
+
});
|
|
38
|
+
assert.equal(result.conclusion, 'failure');
|
|
39
|
+
assert.equal(result.annotationsPosted, 1);
|
|
40
|
+
assert.equal(result.checkRunId, 9001);
|
|
41
|
+
assert.equal(capturedPayload.conclusion, 'failure');
|
|
42
|
+
});
|
|
43
|
+
//# sourceMappingURL=v3-check-runs.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v3-check-runs.test.js","sourceRoot":"","sources":["../../src/__tests__/v3-check-runs.test.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,IAAI,CAAC,6FAA6F,EAAE,KAAK,IAAI,EAAE;IAC7G,MAAM,MAAM,GAAG,0BAA0B,CAAC,gBAAgB,EAAE;QAC1D;YACE,EAAE,EAAE,QAAQ;YACZ,QAAQ,EAAE,UAAU;YACpB,UAAU,EAAE,IAAI;YAChB,QAAQ,EAAE,UAAU;YACpB,KAAK,EAAE,yBAAyB;YAChC,IAAI,EAAE,kCAAkC;YACxC,IAAI,EAAE,sBAAsB;YAC5B,UAAU,EAAE,EAAE;YACd,QAAQ,EAAE,EAAE;YACZ,OAAO,EAAE,sBAAsB;YAC/B,MAAM,EAAE,MAAM;YACd,YAAY,EAAE,oBAAoB;YAClC,YAAY,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,cAAc,EAAE,EAAE,EAAE,cAAc,EAAE,EAAE,EAAE,cAAc,EAAE,EAAE,EAAE;YAC5F,cAAc,EAAE,0BAA0B;YAC1C,MAAM,EAAE,MAAM;SACf;KACF,EAAE,EAAE,CAAC,CAAC;IAEP,IAAI,eAAe,GAA4B,EAAE,CAAC;IAClD,MAAM,MAAM,GAAG,MAAM,kBAAkB,CAAC;QACtC,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,KAAK;QACX,OAAO,EAAE,SAAS;QAClB,KAAK,EAAE,KAAK;QACZ,MAAM;QACN,MAAM,EAAE,EAAE,uBAAuB,EAAE,IAAI,EAAE,gBAAgB,EAAE,EAAE,EAAE;QAC/D,SAAS,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;YAC/B,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,IAAI,IAAI,CAAC,CAA4B,CAAC;YACpF,OAAO,IAAI,QAAQ,CACjB,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,uCAAuC,EAAE,CAAC,EAC/E,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,EAAE,CACjE,CAAC;QACJ,CAAC,CAAiB;KACnB,CAAC,CAAC;IAEH,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;IAC3C,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,iBAAiB,EAAE,CAAC,CAAC,CAAC;IAC1C,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IACtC,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;AACtD,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export interface GitHubAppManifestOptions {
|
|
2
|
+
appName?: string;
|
|
3
|
+
baseUrl: string;
|
|
4
|
+
webhookUrl?: string;
|
|
5
|
+
org?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface GitHubAppCredentials {
|
|
8
|
+
appId: string;
|
|
9
|
+
slug?: string;
|
|
10
|
+
webhookSecret: string;
|
|
11
|
+
privateKey: string;
|
|
12
|
+
htmlUrl?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Build the official GitHub App Manifest payload requesting minimal permissions
|
|
16
|
+
* (`pull_requests: write`, `checks: write`, `contents: read`, `issues: write`, `metadata: read`)
|
|
17
|
+
* and PR/comment webhook events.
|
|
18
|
+
*/
|
|
19
|
+
export declare function buildGitHubAppManifest(options: GitHubAppManifestOptions): Record<string, unknown>;
|
|
20
|
+
/**
|
|
21
|
+
* Build an auto-submitting HTML page that redirects the user cleanly to
|
|
22
|
+
* `https://github.com/settings/apps/new` with the JSON manifest payload.
|
|
23
|
+
*/
|
|
24
|
+
export declare function renderGitHubManifestRedirectHtml(options: GitHubAppManifestOptions): string;
|
|
25
|
+
/**
|
|
26
|
+
* Exchange the temporary `code` from GitHub App Manifest callback for permanent
|
|
27
|
+
* App ID, Webhook Secret, and PEM Private Key.
|
|
28
|
+
*/
|
|
29
|
+
export declare function exchangeGitHubAppManifestCode(code: string, fetchImpl?: typeof fetch): Promise<GitHubAppCredentials>;
|
|
30
|
+
/**
|
|
31
|
+
* Persist exchanged GitHub App credentials locally in `.env` ONLY (never SQLite or git).
|
|
32
|
+
*/
|
|
33
|
+
export declare function persistGitHubAppCredentialsToEnv(envFilePath: string, creds: GitHubAppCredentials): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Strict timing-safe HMAC-SHA256 verification for GitHub `X-Hub-Signature-256`.
|
|
36
|
+
*/
|
|
37
|
+
export declare function verifyGitHubWebhookSignature(secret: string, rawPayload: string | Buffer, signatureHeader: string | undefined): boolean;
|
|
38
|
+
//# sourceMappingURL=app-manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-manifest.d.ts","sourceRoot":"","sources":["../src/app-manifest.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,wBAAwB;IACvC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,wBAAwB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAuBjG;AAED;;;GAGG;AACH,wBAAgB,gCAAgC,CAAC,OAAO,EAAE,wBAAwB,GAAG,MAAM,CAyB1F;AAED;;;GAGG;AACH,wBAAsB,6BAA6B,CACjD,IAAI,EAAE,MAAM,EACZ,SAAS,GAAE,OAAO,KAAwB,GACzC,OAAO,CAAC,oBAAoB,CAAC,CAkC/B;AAED;;GAEG;AACH,wBAAsB,gCAAgC,CACpD,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,oBAAoB,GAC1B,OAAO,CAAC,IAAI,CAAC,CAkCf;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,GAAG,MAAM,EAC3B,eAAe,EAAE,MAAM,GAAG,SAAS,GAClC,OAAO,CAYT"}
|