Skip to content

Commit

Permalink
Add description field to spec
Browse files Browse the repository at this point in the history
This will add a description field to the spec of
pipeline, task pipeline resource ond condition
so that it can be used to provide the description
of these and can also be used by UI to show description

Fix #993
  • Loading branch information
piyush-garg committed Feb 24, 2020
1 parent 4e9380f commit 27528c0
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 2 deletions.
5 changes: 5 additions & 0 deletions pkg/apis/pipeline/v1alpha1/condition_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ type ConditionSpec struct {
// Check declares container whose exit code determines where a condition is true or false
Check Step `json:"check,omitempty"`

// Description is a user-facing description of the condition that may be
// used to populate a UI.
// +optional
Description string `json:"description,omitempty"`

// Params is an optional set of parameters which must be supplied by the user when a Condition
// is evaluated
// +optional
Expand Down
4 changes: 4 additions & 0 deletions pkg/apis/pipeline/v1alpha1/pipeline_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ import (

// PipelineSpec defines the desired state of Pipeline.
type PipelineSpec struct {
// Description is a user-facing description of the pipeline that may be
// used to populate a UI.
// +optional
Description string `json:"description,omitempty"`
// Resources declares the names and types of the resources given to the
// Pipeline's tasks as inputs and outputs.
Resources []PipelineDeclaredResource `json:"resources,omitempty"`
Expand Down
4 changes: 4 additions & 0 deletions pkg/apis/pipeline/v1alpha2/pipeline_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ func (p *Pipeline) Copy() PipelineInterface {

// PipelineSpec defines the desired state of Pipeline.
type PipelineSpec struct {
// Description is a user-facing description of the pipeline that may be
// used to populate a UI.
// +optional
Description string `json:"description,omitempty"`
// Resources declares the names and types of the resources given to the
// Pipeline's tasks as inputs and outputs.
Resources []PipelineDeclaredResource `json:"resources,omitempty"`
Expand Down
5 changes: 5 additions & 0 deletions pkg/apis/pipeline/v1alpha2/task_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ func (t *Task) Copy() TaskInterface {

// TaskSpec defines the desired state of Task.
type TaskSpec struct {
// Description is a user-facing description of the task that may be
// used to populate a UI.
// +optional
Description string `json:"description,omitempty"`

// Resources is a list input and output resource to run the task
// Resources are represented in TaskRuns as bindings to instances of
// PipelineResources.
Expand Down
8 changes: 6 additions & 2 deletions pkg/apis/resource/v1alpha1/pipeline_resource_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,12 @@ type PipelineResourceStatus struct {

// PipelineResourceSpec defines an individual resources used in the pipeline.
type PipelineResourceSpec struct {
Type PipelineResourceType `json:"type"`
Params []ResourceParam `json:"params"`
Type PipelineResourceType `json:"type"`
// Description is a user-facing description of the pipeline resource that may be
// used to populate a UI.
// +optional
Description string `json:"description,omitempty"`
Params []ResourceParam `json:"params"`
// Secrets to fetch to populate some of resource fields
// +optional
SecretParams []SecretParam `json:"secrets,omitempty"`
Expand Down

0 comments on commit 27528c0

Please sign in to comment.