@oss-autopilot/core 3.20.2 → 3.20.3
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 +38 -38
- package/dist/core/daily-logic.d.ts +6 -0
- package/dist/core/daily-logic.js +6 -0
- package/dist/core/github-stats.js +18 -5
- package/package.json +3 -3
|
@@ -116,6 +116,12 @@ export declare function assessCapacity(activePRs: FetchedPR[], maxActivePRs: num
|
|
|
116
116
|
* Note: Recently closed PRs are informational only and excluded from this list.
|
|
117
117
|
* They are available separately in digest.recentlyClosedPRs (#156).
|
|
118
118
|
*
|
|
119
|
+
* A maintainer question in a closing comment therefore never raises
|
|
120
|
+
* needs_response — the closed PR is listed, but nobody is told it asked
|
|
121
|
+
* something. ponytail: closed PRs surface in recentlyClosedPRs only; add a
|
|
122
|
+
* closing-comment scan (own fetch path, own dismiss semantics) when a closing
|
|
123
|
+
* comment gets missed a second time.
|
|
124
|
+
*
|
|
119
125
|
* @param prs - Active (non-shelved) PRs to check
|
|
120
126
|
* @param lastDigestAt - ISO timestamp of previous digest (for "new contribution" detection)
|
|
121
127
|
* @returns Ordered actionable issues grouped by priority
|
package/dist/core/daily-logic.js
CHANGED
|
@@ -255,6 +255,12 @@ export function assessCapacity(activePRs, maxActivePRs, shelvedPRCount) {
|
|
|
255
255
|
* Note: Recently closed PRs are informational only and excluded from this list.
|
|
256
256
|
* They are available separately in digest.recentlyClosedPRs (#156).
|
|
257
257
|
*
|
|
258
|
+
* A maintainer question in a closing comment therefore never raises
|
|
259
|
+
* needs_response — the closed PR is listed, but nobody is told it asked
|
|
260
|
+
* something. ponytail: closed PRs surface in recentlyClosedPRs only; add a
|
|
261
|
+
* closing-comment scan (own fetch path, own dismiss semantics) when a closing
|
|
262
|
+
* comment gets missed a second time.
|
|
263
|
+
*
|
|
258
264
|
* @param prs - Active (non-shelved) PRs to check
|
|
259
265
|
* @param lastDigestAt - ISO timestamp of previous digest (for "new contribution" detection)
|
|
260
266
|
* @returns Ordered actionable issues grouped by priority
|
|
@@ -171,8 +171,16 @@ export function fetchUserClosedPRCounts(octokit, githubUsername, starFilter) {
|
|
|
171
171
|
}
|
|
172
172
|
/**
|
|
173
173
|
* Shared helper: search for recent PRs and filter out own repos.
|
|
174
|
+
*
|
|
175
|
+
* Callers pass an `updated:>={since}` query rather than `closed:`/`merged:`.
|
|
176
|
+
* GitHub's search index populates the close/merge date facets separately from
|
|
177
|
+
* the `closed_at`/`merged_at` payload fields, and a PR can be indexed for
|
|
178
|
+
* `updated:` while its close-date facet is missing — such a PR silently
|
|
179
|
+
* vanishes from any `closed:>=X` filter even though the API returns a correct
|
|
180
|
+
* `closed_at`. `updated` is the sort key, so it is always indexed. We narrow to
|
|
181
|
+
* the real window here with `dateOf`.
|
|
174
182
|
*/
|
|
175
|
-
async function fetchRecentPRs(octokit, config, query, label, days, mapItem) {
|
|
183
|
+
async function fetchRecentPRs(octokit, config, query, label, days, mapItem, dateOf) {
|
|
176
184
|
if (!config.githubUsername) {
|
|
177
185
|
warn(MODULE, `Skipping recently ${label} PRs fetch: no githubUsername configured. Run /setup-oss to configure.`);
|
|
178
186
|
return [];
|
|
@@ -197,6 +205,11 @@ async function fetchRecentPRs(octokit, config, query, label, days, mapItem) {
|
|
|
197
205
|
// Skip own repos
|
|
198
206
|
if (isOwnRepo(parsed.owner, config.githubUsername))
|
|
199
207
|
continue;
|
|
208
|
+
// The query bounds on `updated`, so an old PR that just got a comment can
|
|
209
|
+
// come back. Narrow to the actual close/merge window here.
|
|
210
|
+
const date = dateOf(item);
|
|
211
|
+
if (!date || date < since)
|
|
212
|
+
continue;
|
|
200
213
|
const repo = `${parsed.owner}/${parsed.repo}`;
|
|
201
214
|
results.push(mapItem(item, { owner: parsed.owner, repo, number: parsed.number }));
|
|
202
215
|
}
|
|
@@ -208,7 +221,7 @@ async function fetchRecentPRs(octokit, config, query, label, days, mapItem) {
|
|
|
208
221
|
* Returns lightweight ClosedPR objects for surfacing in the daily digest.
|
|
209
222
|
*/
|
|
210
223
|
export async function fetchRecentlyClosedPRs(octokit, config, days = 7) {
|
|
211
|
-
return fetchRecentPRs(octokit, config, 'is:pr is:closed is:unmerged is:public author:{username}
|
|
224
|
+
return fetchRecentPRs(octokit, config, 'is:pr is:closed is:unmerged is:public author:{username} updated:>={since}', 'closed', days, (item, { repo, number }) => ({
|
|
212
225
|
url: item.html_url,
|
|
213
226
|
repo,
|
|
214
227
|
number,
|
|
@@ -216,14 +229,14 @@ export async function fetchRecentlyClosedPRs(octokit, config, days = 7) {
|
|
|
216
229
|
closedAt: item.closed_at || '',
|
|
217
230
|
// Free on the search result — feeds the outcome ledger (#1461).
|
|
218
231
|
openedAt: item.created_at || undefined,
|
|
219
|
-
}));
|
|
232
|
+
}), (item) => item.closed_at);
|
|
220
233
|
}
|
|
221
234
|
/**
|
|
222
235
|
* Fetch PRs merged in the last N days.
|
|
223
236
|
* Returns lightweight MergedPR objects for surfacing as wins in the dashboard.
|
|
224
237
|
*/
|
|
225
238
|
export async function fetchRecentlyMergedPRs(octokit, config, days = 7) {
|
|
226
|
-
return fetchRecentPRs(octokit, config, 'is:pr is:merged is:public author:{username}
|
|
239
|
+
return fetchRecentPRs(octokit, config, 'is:pr is:merged is:public author:{username} updated:>={since}', 'merged', days, (item, { repo, number }) => {
|
|
227
240
|
const mergedAt = item.pull_request?.merged_at;
|
|
228
241
|
if (!mergedAt) {
|
|
229
242
|
warn(MODULE, `merged_at missing for merged PR ${item.html_url}${item.closed_at ? ', falling back to closed_at' : ', no date available'}`);
|
|
@@ -237,7 +250,7 @@ export async function fetchRecentlyMergedPRs(octokit, config, days = 7) {
|
|
|
237
250
|
// Free on the search result — feeds the outcome ledger (#1461).
|
|
238
251
|
openedAt: item.created_at || undefined,
|
|
239
252
|
};
|
|
240
|
-
});
|
|
253
|
+
}, (item) => item.pull_request?.merged_at || item.closed_at);
|
|
241
254
|
}
|
|
242
255
|
async function fetchPRsSince(octokit, config, adapter, since) {
|
|
243
256
|
if (!config.githubUsername) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oss-autopilot/core",
|
|
3
|
-
"version": "3.20.
|
|
3
|
+
"version": "3.20.3",
|
|
4
4
|
"description": "CLI and core library for managing open source contributions",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
"node": ">=22.0.0"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@octokit/plugin-retry": "^8.1.
|
|
56
|
-
"@octokit/plugin-throttling": "^11.0.
|
|
55
|
+
"@octokit/plugin-retry": "^8.1.1",
|
|
56
|
+
"@octokit/plugin-throttling": "^11.0.5",
|
|
57
57
|
"@octokit/rest": "^22.0.1",
|
|
58
58
|
"@oss-scout/core": "^1.5.2",
|
|
59
59
|
"commander": "^15.0.0",
|