Skip to content

More intuitive RenderStatus schema #4390

@kispaljr

Description

@kispaljr

Problem statement

The RenderStatus go struct in kpt holds the result of a pipeline execution/render. The external porch project also uses this struct (among others) as part of the status of the PackageRevision object.

Porch users seem to find the current schema confusing and hard to decipher, that makes troubleshooting unnecessarily harder. As a porch developer I also find certain errors hard to fit into the current structure (i.e. network connectivity errors) that further complicates troubleshooting.

Potential solution

I propose to change the schema to something like this:

// RenderStatus represents the result of performing render operation
// on a package resources.
type RenderStatus struct {
	MutationSteps   []PipelineStepResult `json:"mutationSteps,omitempty"`
	ValidationSteps   []PipelineStepResult `json:"validationSteps,omitempty"`

	// Error summary is a human readable text summarizing all errors of all failed KRM function executions
	// (Maybe in YAML or JSON format?)
	ErrorSummary string               `json:"errorSummary"`
}

// Result contains the structured result from an individual function  call in the pipeline. T
type PipelineStepResult struct {
	// Name of the pipeline step in Kptfile
	Name string `json:"name,omitempty"`
	// Image is the full name of the image that generates this result
	// Image and Exec are mutually exclusive
	Image string `json:"image,omitempty"`
	// ExecPath is the the absolute os-specific path to the executable file
	// If user provides an executable file with commands, ExecPath should
	// contain the entire input string.
	ExecPath string `json:"exec,omitempty"`

	// ExecutionError contains a potential error that prevented the execution of the function.
	// This is mutually exclusive with Stderr, ExitCode, Results and ErrorResults.
	// Some examples: Network connection errors, missing image or executable file.
	ExecutionError string `json:"executionError,omitempty"`

	// Stderr is the content in function stderr
	Stderr string `json:"stderr,omitempty"`
	// ExitCode is the exit code from running the function
	ExitCode int `json:"exitCode"`
	// Results is the list of results in the output of the KRM function
	Results []ResultItem `json:"results,omitempty"`
	// ErrorResults is the list of results in the output of the KRM function that has "error" severity.
	// This is a subset of Results.
	ErrorResults []ResultItem `json:"errorResults,omitempty"`

	// TODO(droot): This is required for making structured results subpackage aware.
	// Enable this once test harness supports filepath based assertions.
	// Pkg is OS specific Absolute path to the package.
	// Pkg string `yaml:"pkg,omitempty"`
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/porchenhancementNew feature or requestgoPull requests that update Go codetriagedIssue has been triaged by adding an `area/` label

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions