Skip to content

Commit c3188ff

Browse files
jamesadevineCopilot
andcommitted
fix(compile): copy NDJSON manifest to artifact, guard conclusion.js, align title-prefix
1. Copy safe-outputs-executed.ndjson into the safe_outputs artifact so the Conclusion job can find noop/missing-tool/missing-data entries. Without this, diagnostic signal reporting was silently skipped (pipeline-failure reporting was unaffected). 2. Extend bash guard to also check conclusion.js exists on disk before running node — handles download failures gracefully. 3. Align title-prefix with gh-aw: it is a prefix prepended to the pipeline name (${titlePrefix} ${pipelineName}), not a template with placeholder substitution. Matches gh-aw missing_issue_helpers. 4. Move JobVariable import to file-level (consistency with other IR imports). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 60f966b commit c3188ff

3 files changed

Lines changed: 14 additions & 19 deletions

File tree

scripts/ado-script/src/conclusion/__tests__/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ describe("conclusion/main", () => {
257257
"MyProject",
258258
expect.objectContaining({
259259
enabled: true,
260-
title: "[ado-aw] Agent noop",
260+
title: "[ado-aw] Agent noop feature reporter",
261261
workItemType: "Bug",
262262
areaPath: "MyProject\\Automation",
263263
tags: ["pipeline-failure", "automated"],

scripts/ado-script/src/conclusion/index.ts

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -370,21 +370,18 @@ function buildMissingDataReport(
370370
};
371371
}
372372

373-
function renderTitle(
374-
template: string | undefined,
373+
/**
374+
* Build the work-item title from the per-tool title-prefix.
375+
* Mirrors gh-aw's convention: `${titlePrefix} ${pipelineName}`.
376+
* When no prefix is configured, returns undefined so the caller
377+
* can fall back to the signal's built-in default title.
378+
*/
379+
function buildTitle(
380+
titlePrefix: string | undefined,
375381
pipelineName: string,
376-
signal: SignalKind,
377-
defaultTitle: string,
378382
): string | undefined {
379-
if (!template) return undefined;
380-
const signalLabel = signal.replaceAll("_", " ");
381-
const rendered = template
382-
.replaceAll("{pipeline_name}", pipelineName)
383-
.replaceAll("{pipeline-name}", pipelineName)
384-
.replaceAll("{pipeline}", pipelineName)
385-
.replaceAll("{signal}", signalLabel)
386-
.trim();
387-
return rendered || defaultTitle;
383+
if (!titlePrefix) return undefined;
384+
return `${titlePrefix} ${pipelineName}`.trim();
388385
}
389386

390387
function getToolConfigKey(kind: SignalKind): string {
@@ -407,11 +404,9 @@ function buildWorkItemConfig(
407404
// in fileSignal(). The field exists in WorkItemReportConfig for
408405
// callers outside conclusion.js (e.g. direct wit.ts consumers).
409406
enabled: true,
410-
title: renderTitle(
407+
title: buildTitle(
411408
toolConfig?.titlePrefix,
412409
config.pipelineName,
413-
signal.kind,
414-
signal.defaultTitle,
415410
),
416411
workItemType: toolConfig?.workItemType ?? "Task",
417412
areaPath: toolConfig?.areaPath,

src/compile/agentic_pipeline.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,10 +1124,10 @@ fn build_conclusion_job(
11241124
steps.push(Step::Task(download_artifact));
11251125

11261126
let conclusion_script = "\
1127-
if command -v node >/dev/null 2>&1; then\n \
1127+
if command -v node >/dev/null 2>&1 && [ -f /tmp/ado-aw-scripts/ado-script/conclusion.js ]; then\n \
11281128
node /tmp/ado-aw-scripts/ado-script/conclusion.js\n\
11291129
else\n \
1130-
echo \"##vso[task.logissue type=warning]Node.js not available; skipping conclusion reporting\"\n\
1130+
echo \"##vso[task.logissue type=warning]conclusion.js unavailable; skipping conclusion reporting\"\n\
11311131
fi\n";
11321132
let mut conclusion_step = bash("Report pipeline conclusion", conclusion_script);
11331133
conclusion_step = conclusion_step.with_condition(Condition::Always);

0 commit comments

Comments
 (0)