mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-10-13 03:58:33 +00:00
fix legacy regression runner invocation
This commit is contained in:
parent
11063a60e0
commit
b147ad04df
2 changed files with 19 additions and 1 deletions
|
|
@ -775,7 +775,7 @@ export async function refreshBaseRefLine(
|
|||
// CLI fallback when migrating guidance generated for an external store.
|
||||
const legacyRunner =
|
||||
block.match(/or `([^`\n]+?) detect-changes --scope compare --base-ref\b/)?.[1] ??
|
||||
'.gitnexus/run.cjs';
|
||||
'node .gitnexus/run.cjs';
|
||||
const mergeBaseGuidance = regressionReviewGuidance(defaultBranch, legacyRunner);
|
||||
let newBlock = block.replace(
|
||||
/For regression review of target branch "(?:[^"\\]|\\.)*"/,
|
||||
|
|
|
|||
|
|
@ -1636,6 +1636,24 @@ For regression review: \`detect_changes({scope: "compare", base_ref: "main"})\`
|
|||
}
|
||||
});
|
||||
|
||||
it('uses Node for a legacy line without a CLI fallback (#3509)', async () => {
|
||||
const dir = await fs.mkdtemp(path.join(os.tmpdir(), 'gn-review-no-runner-'));
|
||||
try {
|
||||
const seed = `<!-- gitnexus:start -->
|
||||
For regression review: \`detect_changes({scope: "compare", base_ref: "main"})\`.
|
||||
<!-- gitnexus:end -->
|
||||
`;
|
||||
await fs.writeFile(path.join(dir, 'CLAUDE.md'), seed, 'utf-8');
|
||||
|
||||
expect((await refreshBaseRefLine(dir, 'develop')).files).toEqual(['CLAUDE.md']);
|
||||
const after = await fs.readFile(path.join(dir, 'CLAUDE.md'), 'utf-8');
|
||||
expect(after).toContain('`node .gitnexus/run.cjs detect-changes');
|
||||
expect(after).toContain('base_ref: "<merge-base SHA>"');
|
||||
} finally {
|
||||
await fs.rm(dir, { recursive: true, force: true });
|
||||
}
|
||||
});
|
||||
|
||||
it('threads defaultBranch through generateAIContextFiles into AGENTS.md and CLAUDE.md (#243)', async () => {
|
||||
const subDir = await fs.mkdtemp(path.join(os.tmpdir(), 'gn-default-branch-'));
|
||||
const subStorage = path.join(subDir, '.gitnexus');
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue