knotserver: always show pipeline errors #432

merged
opened by winter.bsky.social targeting master from winter.bsky.social/core: push-luoyqwkpromz

IMO, we shouldn't make errors opt-in to actually show upon push, at least not if/until we have a UI to show them to the user.

Signed-off-by: Winter winter@winter.cafe

Changed files
+14 -14
knotserver
+14 -14
knotserver/internal.go
··· 245 return err 246 } 247 248 - if pushOptions.verboseCi { 249 - hasDiagnostics := false 250 - if len(pipelineParseErrors) > 0 { 251 - hasDiagnostics = true 252 - *clientMsgs = append(*clientMsgs, "error: failed to parse workflow(s):") 253 - for _, error := range pipelineParseErrors { 254 - *clientMsgs = append(*clientMsgs, error) 255 - } 256 } 257 - if len(compiler.Diagnostics.Errors) > 0 { 258 - hasDiagnostics = true 259 - *clientMsgs = append(*clientMsgs, "error(s) on pipeline:") 260 - for _, error := range compiler.Diagnostics.Errors { 261 - *clientMsgs = append(*clientMsgs, fmt.Sprintf("- %s:", error)) 262 - } 263 } 264 if len(compiler.Diagnostics.Warnings) > 0 { 265 hasDiagnostics = true 266 *clientMsgs = append(*clientMsgs, "warning(s) on pipeline:")
··· 245 return err 246 } 247 248 + hasDiagnostics := false 249 + if len(pipelineParseErrors) > 0 { 250 + hasDiagnostics = true 251 + *clientMsgs = append(*clientMsgs, "error: failed to parse workflow(s):") 252 + for _, error := range pipelineParseErrors { 253 + *clientMsgs = append(*clientMsgs, error) 254 } 255 + } 256 + if len(compiler.Diagnostics.Errors) > 0 { 257 + hasDiagnostics = true 258 + *clientMsgs = append(*clientMsgs, "error(s) on pipeline:") 259 + for _, error := range compiler.Diagnostics.Errors { 260 + *clientMsgs = append(*clientMsgs, fmt.Sprintf("- %s:", error)) 261 } 262 + } 263 + if pushOptions.verboseCi { 264 if len(compiler.Diagnostics.Warnings) > 0 { 265 hasDiagnostics = true 266 *clientMsgs = append(*clientMsgs, "warning(s) on pipeline:")