Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions dashboard/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -1498,7 +1498,14 @@ function findDirectExecutable(command) {
}

function createExecutor({ command, packageRoot, buildInvocation }) {
return ({ repository, prompt, sessionId, resume, onOutput }) => {
return ({
repository,
artifactDirectories = [],
prompt,
sessionId,
resume,
onOutput
}) => {
const executable = findDirectExecutable(command);
if (!executable) {
throw new Error(
Expand All @@ -1510,7 +1517,10 @@ function createExecutor({ command, packageRoot, buildInvocation }) {
prompt,
sessionId,
resume,
additionalDirs: linkedDependencyDirectories(repository)
additionalDirs: [
...linkedDependencyDirectories(repository),
...artifactDirectories
]
});
const child = spawn(executable, invocation.args, {
cwd: repository,
Expand Down Expand Up @@ -2512,6 +2522,7 @@ export function createDashboardServer({
job.lastActivityAt = new Date().toISOString();
handle = executor({
repository: resolvedRepository,
artifactDirectories: job.artifactDirectory ? [job.artifactDirectory] : [],
prompt,
sessionId: job.id,
resume,
Expand Down
5 changes: 4 additions & 1 deletion test/dashboard-server.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -586,8 +586,10 @@ test("loads Azure DevOps intake and passes local screenshots without caching the
};
let loaderInput;
let receivedPrompt;
const executor = ({ prompt, onOutput }) => {
let receivedArtifactDirectories;
const executor = ({ prompt, artifactDirectories, onOutput }) => {
receivedPrompt = prompt;
receivedArtifactDirectories = artifactDirectories;
onOutput(
"stdout",
"FIXLAB_BUG|71|external|upstream-system|The upstream system owns the rejected request; no repository change is required.\n"
Expand Down Expand Up @@ -658,6 +660,7 @@ test("loads Azure DevOps intake and passes local screenshots without caching the
screenshotPath = pathLine?.slice(2);
assert.ok(screenshotPath);
assert.equal(existsSync(screenshotPath), true);
assert.deepEqual(receivedArtifactDirectories, [dirname(screenshotPath)]);
assert.match(receivedPrompt, /Loaded Azure DevOps selection/);
assert.match(
receivedPrompt,
Expand Down
Loading