@@ -25,7 +25,14 @@ import { printLine } from '../../output/io'
2525import { styles } from '../../output/presentation'
2626import { bytes , printDocument , sanitize } from '../../output/render'
2727import { CliUsageError , LocalRefusal } from './local-errors'
28- import { codeSpan , type Diagnostic , findingsOutput , markdownCell , summaryMarker } from './source-ui'
28+ import {
29+ codeSpan ,
30+ type Diagnostic ,
31+ errorBullets ,
32+ findingsOutput ,
33+ markdownCell ,
34+ summaryMarker ,
35+ } from './source-ui'
2936
3037/** One change of a workspace apply's plan. */
3138type WorkspacePlanChange = ApplyWorkspaceSourceResponse [ 'data' ] [ 'plan' ] [ number ]
@@ -142,12 +149,13 @@ const SERVER_WORDS = {
142149/**
143150 * A status as the Markdown a step summary or `--summary-file` holds: the local changes, what
144151 * changed on the server (the drift a scheduled job opens an issue for), the plan's one line and
145- * the next command.
152+ * the next command; the plan's error findings follow it, as an apply's summary lists them .
146153 */
147154function statusMarkdown < Plan > (
148155 heading : string ,
149156 report : StatusReport < Plan > ,
150- planLine : ( plan : Plan ) => string
157+ planLine : ( plan : Plan ) => string ,
158+ findings : readonly Diagnostic [ ]
151159) : string {
152160 const lines = [ `### Sim status: ${ markdownCell ( heading ) } ` , '' ]
153161 if ( report . local . length === 0 ) lines . push ( 'No local changes.' )
@@ -187,6 +195,8 @@ function statusMarkdown<Plan>(
187195 lines . push ( `Server not checked${ report . note ? `: ${ markdownCell ( report . note ) } ` : '.' } ` )
188196 }
189197 if ( report . plan ) lines . push ( '' , markdownCell ( planLine ( report . plan ) ) )
198+ const errors = findings . filter ( ( finding ) => finding . severity === 'error' )
199+ if ( errors . length > 0 ) lines . push ( '' , '**Errors**' , '' , ...errorBullets ( errors ) )
190200 if ( report . next ) lines . push ( '' , `Next: ${ codeSpan ( report . next . command ) } ` )
191201 return lines . join ( '\n' )
192202}
@@ -205,7 +215,7 @@ export function printStatusReport<Plan>(
205215 findings : readonly Diagnostic [ ] ,
206216 summaryFile ?: string
207217) : void {
208- publishSummary ( ( ) => statusMarkdown ( heading , report , planLine ) , {
218+ publishSummary ( ( ) => statusMarkdown ( heading , report , planLine , findings ) , {
209219 file : summaryFile ,
210220 marker : summaryMarker ( report . dir ) ,
211221 } )
0 commit comments