@yemi33/minions 0.1.40 → 0.1.42
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/CHANGELOG.md +10 -0
- package/dashboard.js +19 -3
- package/engine/queries.js +11 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dashboard.js
CHANGED
|
@@ -2935,11 +2935,27 @@ What would you like to discuss or change? When you're happy, say "approve" and I
|
|
|
2935
2935
|
|
|
2936
2936
|
if (prs.some(p => p.id === prId || p.url === url)) return jsonReply(res, 400, { error: 'PR already tracked' });
|
|
2937
2937
|
|
|
2938
|
+
// Auto-detect PR metadata from GitHub
|
|
2939
|
+
let prTitle = title || '';
|
|
2940
|
+
let prAuthor = '';
|
|
2941
|
+
let prBranch = '';
|
|
2942
|
+
const ghMatch = url.match(/github\.com\/([^/]+)\/([^/]+)\/pull\/(\d+)/);
|
|
2943
|
+
if (ghMatch && !prTitle) {
|
|
2944
|
+
try {
|
|
2945
|
+
const { execSync } = require('child_process');
|
|
2946
|
+
const json = execSync(`gh pr view ${ghMatch[3]} --repo ${ghMatch[1]}/${ghMatch[2]} --json title,author,headRefName`, { encoding: 'utf8', timeout: 10000, windowsHide: true });
|
|
2947
|
+
const data = JSON.parse(json);
|
|
2948
|
+
prTitle = data.title || prTitle;
|
|
2949
|
+
prAuthor = data.author?.login || '';
|
|
2950
|
+
prBranch = data.headRefName || '';
|
|
2951
|
+
} catch {}
|
|
2952
|
+
}
|
|
2953
|
+
|
|
2938
2954
|
prs.push({
|
|
2939
2955
|
id: prId,
|
|
2940
|
-
title: (
|
|
2941
|
-
agent: 'human',
|
|
2942
|
-
branch:
|
|
2956
|
+
title: (prTitle || 'Linked PR #' + prNum).slice(0, 120),
|
|
2957
|
+
agent: prAuthor || 'human',
|
|
2958
|
+
branch: prBranch,
|
|
2943
2959
|
reviewStatus: autoObserve ? 'pending' : 'none',
|
|
2944
2960
|
status: autoObserve ? 'active' : 'linked',
|
|
2945
2961
|
created: new Date().toISOString().slice(0, 10),
|
package/engine/queries.js
CHANGED
|
@@ -266,6 +266,17 @@ function getPullRequests(config) {
|
|
|
266
266
|
allPrs.push(pr);
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
|
+
// Also read central pull-requests.json (for manually linked PRs without a project)
|
|
270
|
+
const centralPath = path.join(MINIONS_DIR, 'pull-requests.json');
|
|
271
|
+
const centralPrs = safeJson(centralPath);
|
|
272
|
+
if (centralPrs) {
|
|
273
|
+
for (const pr of centralPrs) {
|
|
274
|
+
if (!allPrs.some(p => p.id === pr.id)) {
|
|
275
|
+
pr._project = 'central';
|
|
276
|
+
allPrs.push(pr);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
269
280
|
allPrs.sort((a, b) => (b.created || '').localeCompare(a.created || ''));
|
|
270
281
|
return allPrs;
|
|
271
282
|
}
|
package/package.json
CHANGED