Skip to content

Commit ed0ef41

Browse files
themr0cclaude
andauthored
[RHDHBUGS-2954]: Fix CQA/build-orchestrator infinite recursion (#2059)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 61c1d05 commit ed0ef41

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

build/scripts/build-orchestrator.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -661,9 +661,13 @@ async function main() {
661661
lycheeResult.errors = classifyErrors(lycheeResult.output, patterns);
662662
}
663663

664-
// Run CQA content quality assessment
665-
console.log('\nRunning CQA content quality assessment...');
666-
const cqaResult = await runCqa(repoRoot, args.verbose);
664+
// Run CQA content quality assessment (skip when invoked from CQA-14 to avoid recursion)
665+
const cqaResult = process.env.CQA_RUNNING
666+
? { status: 'passed', duration: 0, output: '', stats: { total: 0, pass: 0, fail: 0 } }
667+
: await (async () => {
668+
console.log('\nRunning CQA content quality assessment...');
669+
return runCqa(repoRoot, args.verbose);
670+
})();
667671

668672
const totalDuration = Math.round((Date.now() - totalStart) / 1000);
669673

build/scripts/cqa/checks/cqa-14-no-broken-links.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,12 @@ function getLycheeIssues(root) {
9090

9191
try {
9292
// Run build orchestrator (builds fresh HTML + runs lychee with remapping)
93+
// Set CQA_RUNNING to prevent build-orchestrator from running CQA again (recursion)
9394
execFileSync('node', ['build/scripts/build-orchestrator.js', '-b', 'main'], { // NOSONAR — fixed args, no user input
9495
cwd: root,
9596
stdio: 'pipe',
9697
timeout: 600000, // 10 minutes
98+
env: { ...process.env, CQA_RUNNING: '1' },
9799
});
98100
} catch {
99101
// Build may exit non-zero if lychee finds broken links — that's expected

0 commit comments

Comments
 (0)