Route console diagnostics and stage progress through native reporting
This commit is contained in:
@@ -69,7 +69,7 @@ func checkExecutionInput(input *executionInput) error {
|
||||
func executionCommand(name, summary string, regenerate bool, deps commandDependencies, executor pipelineExecutor) commandkit.Command {
|
||||
spec := executionCommandSpec(name, summary, regenerate)
|
||||
spec.Run = func(invocation commandkit.Invocation, input *executionInput) commandkit.Outcome {
|
||||
report, err := executeSelectedPipeline(invocation.Context, input, deps, executor)
|
||||
report, err := executeSelectedPipeline(invocation.Context, input, withCommandReporting(deps, invocation), executor)
|
||||
if report != nil {
|
||||
err = errors.Join(err, invocation.Reporter().Report(commandkit.Report{Value: report}))
|
||||
}
|
||||
@@ -135,7 +135,7 @@ func executeSelectedPipeline(ctx context.Context, input *executionInput, deps co
|
||||
if err := ctx.Err(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
summary, err := executor(ctx, cfg, input.plan, RunOptions{Force: input.Force.Value, SelectedArtifacts: selected, EffectiveArtifacts: effective})
|
||||
summary, err := executor(ctx, cfg, input.plan, RunOptions{Force: input.Force.Value, SelectedArtifacts: selected, EffectiveArtifacts: effective, Reporter: invocationDeps.reporter})
|
||||
if summary == nil {
|
||||
if err == nil {
|
||||
err = fmt.Errorf("pipeline execution returned no run summary")
|
||||
|
||||
Reference in New Issue
Block a user