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
12 changes: 10 additions & 2 deletions report-app/src/app/pages/report-viewer/report-viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -461,13 +461,21 @@ <h4>{{ journey.name }}</h4>

<div class="app-details-section">
<h4>Debugging Tools</h4>

<button
class="neutral-button"
title="Download a ZIP for debugging. You can upload the ZIP to AI Studio for further analysis of a specific app."
(click)="downloadDebuggingZip(result)"
>
(click)="downloadDebuggingZip(result)">
Download ZIP for debugging
</button>

@let debugCommand = getDebugCommand(report, result);

@if (debugCommand) {
<p>To see the app locally, run the following command:</p>
<pre class="callout neutral code">{{debugCommand}}</pre>
}

@if (result.toolLogs && result.toolLogs.length > 0) {
<expansion-panel>
<expansion-panel-header>Tool Logs</expansion-panel-header>
Expand Down
14 changes: 14 additions & 0 deletions report-app/src/app/pages/report-viewer/report-viewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ import { ExpansionPanel } from '../../shared/expansion-panel/expansion-panel';
import { ExpansionPanelHeader } from '../../shared/expansion-panel/expansion-panel-header';
import { ProviderLabel } from '../../shared/provider-label';

const localReportRegex = /-l\d+$/;

@Component({
imports: [
StackedBarChart,
Expand Down Expand Up @@ -439,4 +441,16 @@ export class ReportViewer {
return 'failed';
}
}

protected getDebugCommand(
report: RunInfo,
result: AssessmentResult
): string | null {
// Only show the command for local reports.
if (!localReportRegex.test(report.group)) {
return null;
}

return `wcs run --prompt=${result.promptDef.name} --env=<path to ${report.details.summary.environmentId} config>`;
}
}
Loading