diff --git a/pipelines/types/common.go b/pipelines/types/common.go index edf7667..0a39097 100644 --- a/pipelines/types/common.go +++ b/pipelines/types/common.go @@ -654,6 +654,21 @@ func (s *ProwJobStep) IsWellFormedOverInputs() bool { return true } +// ProwJobValidationStep represents a shell step that is a validation step. +type ProwJobValidationStep struct { + ProwJobStep `json:",inline"` + Validation []string `json:"validation,omitempty"` +} + +func (s *ProwJobValidationStep) Validations() []string { + return s.Validation +} + +func (s *ProwJobValidationStep) IsWellFormedOverInputs() bool { + // raw shell steps capture the whole repository as an archive input, so they are not well-formed + return false +} + const StepActionGrafanaDashboards = "GrafanaDashboards" type GrafanaDashboardsStep struct { diff --git a/pipelines/types/resourcegroup.go b/pipelines/types/resourcegroup.go index d20544d..919b4dd 100644 --- a/pipelines/types/resourcegroup.go +++ b/pipelines/types/resourcegroup.go @@ -135,6 +135,10 @@ func (s *Steps) UnmarshalJSON(data []byte) error { step = &GenevaHealthStep{} case StepActionPublishGenevaAutomation: step = &PublishGenevaAutomationStep{} + case StepActionProwJob: + step = &ProwJobStep{} + case StepActionGrafanaDashboards: + step = &GrafanaDashboardsStep{} default: step = &GenericStep{} } @@ -166,6 +170,8 @@ func (s *ValidationSteps) UnmarshalJSON(data []byte) error { switch stepMeta.Action { case StepActionShell: step = &ShellValidationStep{} + case StepActionProwJob: + step = &ProwJobValidationStep{} default: step = &GenericValidationStep{} } diff --git a/pipelines/types/testdata/zz_fixture_TestNewPipelineFromFile.yaml b/pipelines/types/testdata/zz_fixture_TestNewPipelineFromFile.yaml index 2c0ef3a..f0b2002 100644 --- a/pipelines/types/testdata/zz_fixture_TestNewPipelineFromFile.yaml +++ b/pipelines/types/testdata/zz_fixture_TestNewPipelineFromFile.yaml @@ -497,7 +497,16 @@ resourceGroups: configRef: ev2.assistedId.certificate.keyVault workflowPath: path/to/workflow - action: GrafanaDashboards + grafanaName: + name: whatever + resourceGroup: regional + step: deploy + identityFrom: + name: whatever + resourceGroup: regional + step: deploy name: dashboards + observabilityConfig: ./observability.yaml subscription: hcp-uksouth subscriptionProvisioning: displayName: @@ -505,7 +514,15 @@ resourceGroups: roleAssignment: test.bicepparam validationSteps: - action: ProwJob + gatePromotion: true + identityFrom: + name: whatever + resourceGroup: regional + step: deploy + jobName: test-me name: e2e + tokenKeyvault: arohcpint-global.vault.azure.net + tokenSecret: prow-token validation: - Internal rolloutName: Test Rollout