@oss-autopilot/core 0.52.0 → 0.53.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/cli.bundle.cjs +50 -41
- package/dist/cli.js +19 -1
- package/dist/core/github.d.ts +5 -0
- package/dist/core/github.js +27 -22
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/utils.d.ts +6 -0
- package/dist/core/utils.js +9 -0
- package/package.json +4 -2
- package/dist/cli.bundle.cjs.map +0 -7
- package/dist/core/test-utils.d.ts +0 -12
- package/dist/core/test-utils.js +0 -74
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared test factories for oss-autopilot.
|
|
3
|
-
*
|
|
4
|
-
* Centralises mock object construction so that when types gain new required
|
|
5
|
-
* fields we only update one place. Every factory accepts a `Partial<T>`
|
|
6
|
-
* override bag — callers only specify the fields relevant to their test.
|
|
7
|
-
*/
|
|
8
|
-
import type { FetchedPR, DailyDigest } from './types.js';
|
|
9
|
-
import type { CapacityAssessment } from '../formatters/json.js';
|
|
10
|
-
export declare function makeFetchedPR(overrides?: Partial<FetchedPR>): FetchedPR;
|
|
11
|
-
export declare function makeDailyDigest(overrides?: Partial<DailyDigest>): DailyDigest;
|
|
12
|
-
export declare function makeCapacityAssessment(overrides?: Partial<CapacityAssessment>): CapacityAssessment;
|
package/dist/core/test-utils.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared test factories for oss-autopilot.
|
|
3
|
-
*
|
|
4
|
-
* Centralises mock object construction so that when types gain new required
|
|
5
|
-
* fields we only update one place. Every factory accepts a `Partial<T>`
|
|
6
|
-
* override bag — callers only specify the fields relevant to their test.
|
|
7
|
-
*/
|
|
8
|
-
// ---------------------------------------------------------------------------
|
|
9
|
-
// FetchedPR
|
|
10
|
-
// ---------------------------------------------------------------------------
|
|
11
|
-
export function makeFetchedPR(overrides = {}) {
|
|
12
|
-
const repo = overrides.repo ?? 'owner/repo';
|
|
13
|
-
const number = overrides.number ?? 1;
|
|
14
|
-
return {
|
|
15
|
-
id: 1,
|
|
16
|
-
url: `https://github.com/${repo}/pull/${number}`,
|
|
17
|
-
repo,
|
|
18
|
-
number,
|
|
19
|
-
title: 'Test PR',
|
|
20
|
-
status: 'waiting_on_maintainer',
|
|
21
|
-
waitReason: 'pending_review',
|
|
22
|
-
stalenessTier: 'active',
|
|
23
|
-
displayLabel: '[Waiting on Maintainer]',
|
|
24
|
-
displayDescription: 'Awaiting review',
|
|
25
|
-
createdAt: '2025-06-01T00:00:00Z',
|
|
26
|
-
updatedAt: '2025-06-15T00:00:00Z',
|
|
27
|
-
daysSinceActivity: 2,
|
|
28
|
-
ciStatus: 'passing',
|
|
29
|
-
failingCheckNames: [],
|
|
30
|
-
classifiedChecks: [],
|
|
31
|
-
hasMergeConflict: false,
|
|
32
|
-
reviewDecision: 'approved',
|
|
33
|
-
hasUnrespondedComment: false,
|
|
34
|
-
hasIncompleteChecklist: false,
|
|
35
|
-
maintainerActionHints: [],
|
|
36
|
-
...overrides,
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
// ---------------------------------------------------------------------------
|
|
40
|
-
// DailyDigest
|
|
41
|
-
// ---------------------------------------------------------------------------
|
|
42
|
-
export function makeDailyDigest(overrides = {}) {
|
|
43
|
-
return {
|
|
44
|
-
generatedAt: '2025-06-20T00:00:00Z',
|
|
45
|
-
openPRs: [],
|
|
46
|
-
needsAddressingPRs: [],
|
|
47
|
-
waitingOnMaintainerPRs: [],
|
|
48
|
-
recentlyClosedPRs: [],
|
|
49
|
-
recentlyMergedPRs: [],
|
|
50
|
-
shelvedPRs: [],
|
|
51
|
-
autoUnshelvedPRs: [],
|
|
52
|
-
summary: {
|
|
53
|
-
totalActivePRs: 0,
|
|
54
|
-
totalNeedingAttention: 0,
|
|
55
|
-
totalMergedAllTime: 0,
|
|
56
|
-
mergeRate: 0,
|
|
57
|
-
},
|
|
58
|
-
...overrides,
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
// ---------------------------------------------------------------------------
|
|
62
|
-
// CapacityAssessment
|
|
63
|
-
// ---------------------------------------------------------------------------
|
|
64
|
-
export function makeCapacityAssessment(overrides = {}) {
|
|
65
|
-
return {
|
|
66
|
-
hasCapacity: true,
|
|
67
|
-
activePRCount: 3,
|
|
68
|
-
maxActivePRs: 10,
|
|
69
|
-
shelvedPRCount: 0,
|
|
70
|
-
criticalIssueCount: 0,
|
|
71
|
-
reason: 'You have capacity',
|
|
72
|
-
...overrides,
|
|
73
|
-
};
|
|
74
|
-
}
|