Skip to content

Commit ec24f45

Browse files
committed
Analyze all PRs from release notes before LLM gating
1 parent a146a04 commit ec24f45

File tree

1 file changed

+6
-5
lines changed
  • docusaurus/scripts/strapi-release-analyzer

1 file changed

+6
-5
lines changed

docusaurus/scripts/strapi-release-analyzer/index.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -856,8 +856,9 @@ async function main() {
856856
const { releaseUrl } = parseArgs(rawArgs);
857857

858858
if (!releaseUrl) {
859-
console.error('❌ Usage: node index.js <github-release-url> [--no-cache] [--refresh] [--cache-dir=PATH] [--limit=N] [--strict=aggressive|balanced|conservative] [--model=NAME]');
860-
console.error('Example: node index.js https://github.com/strapi/strapi/releases/tag/v5.29.0 --strict=aggressive --limit=10');
859+
console.error('❌ Usage: node index.js <github-release-url> [--no-cache] [--refresh] [--cache-dir=PATH] [--limit=N-for-LLM] [--strict=aggressive|balanced|conservative] [--model=NAME]');
860+
console.error('Example: node index.js https://github.com/strapi/strapi/releases/tag/v5.29.0 --strict=aggressive');
861+
console.error('Note: All PRs are screened heuristically; --limit caps only LLM calls if provided.');
861862
process.exit(1);
862863
}
863864

@@ -891,8 +892,7 @@ async function main() {
891892
let skipped = 0;
892893

893894
const prList = Array.isArray(releaseInfo.prNumbers) ? releaseInfo.prNumbers : [];
894-
const limited = (OPTIONS.limit && OPTIONS.limit > 0) ? prList.slice(0, OPTIONS.limit) : prList;
895-
for (const prNumber of limited) {
895+
for (const prNumber of prList) {
896896
const prAnalysis = await analyzePR(prNumber);
897897

898898
if (!prAnalysis) {
@@ -905,7 +905,8 @@ async function main() {
905905
const impact = classifyImpact(prAnalysis);
906906

907907
const candidates = suggestCandidateDocs(llmsIndex, prAnalysis, 5);
908-
const runLLM = impact.verdict !== 'no';
908+
// Optional cap: apply limit only to LLM calls
909+
const runLLM = impact.verdict !== 'no' && (!OPTIONS.limit || analyses.filter(a => a.claudeSuggestions).length < OPTIONS.limit);
909910
const claudeSuggestions = runLLM
910911
? await generateDocSuggestionsWithClaude({
911912
...prAnalysis,

0 commit comments

Comments
 (0)