From 2e0e48de3a1f2efda4f54e702e6c93e6b040af1b Mon Sep 17 00:00:00 2001 From: "nasser.gonzalez@gmail.com" Date: Wed, 4 Dec 2024 14:19:08 +0000 Subject: [PATCH] feat: [IAC-2855]: Remove workspaceId as requirement and add moduleId --- v0/pipeline.json | 148 +++++++++++- .../stages/iacm/execution-wrapper-config.yaml | 1 + .../stages/iacm/iacmstage-config-impl.yaml | 4 +- .../iacm/iacmmoduletest-plugin-info.yaml | 42 ++++ .../iacm/iacmmoduletest-plugin-step-node.yaml | 56 +++++ v0/template.json | 215 +++++++++++++++++- v0/template/template_config.yaml | 1 + v1/pipeline.json | 148 +++++++++++- .../stages/iacm/execution-wrapper-config.yaml | 1 + .../stages/iacm/iacmstage-config-impl.yaml | 4 +- .../iacm/iacmmoduletest-plugin-info.yaml | 42 ++++ .../iacm/iacmmoduletest-plugin-step-node.yaml | 56 +++++ v1/template.json | 215 +++++++++++++++++- v1/template/template_config.yaml | 1 + 14 files changed, 918 insertions(+), 16 deletions(-) create mode 100644 v0/pipeline/steps/iacm/iacmmoduletest-plugin-info.yaml create mode 100644 v0/pipeline/steps/iacm/iacmmoduletest-plugin-step-node.yaml create mode 100644 v1/pipeline/steps/iacm/iacmmoduletest-plugin-info.yaml create mode 100644 v1/pipeline/steps/iacm/iacmmoduletest-plugin-step-node.yaml diff --git a/v0/pipeline.json b/v0/pipeline.json index ec072278..fac533ef 100644 --- a/v0/pipeline.json +++ b/v0/pipeline.json @@ -766,7 +766,7 @@ "IACMStageConfigImpl" : { "title" : "IACMStageConfigImpl", "type" : "object", - "required" : [ "workspace", "execution" ], + "required" : [ "execution" ], "properties" : { "cloneCodebase" : { "oneOf" : [ { @@ -832,8 +832,10 @@ } ] }, "workspace" : { - "type" : "string", - "minLength" : 1 + "type" : "string" + }, + "moduleId" : { + "type" : "string" }, "description" : { "desc" : "This is the description for IACMStageConfigImpl" @@ -904,6 +906,8 @@ "$ref" : "#/definitions/pipeline/steps/common/CheckovScanNode" }, { "$ref" : "#/definitions/pipeline/steps/common/SnykScanNode" + }, { + "$ref" : "#/definitions/pipeline/steps/iacm/IACMModuleTestPluginStepNode" } ] }, "description" : { @@ -41042,6 +41046,144 @@ "desc" : "This is the description for IACMCheckovPluginInfo" } } + }, + "IACMModuleTestPluginStepNode" : { + "title" : "IACMModuleTestPluginStepNode", + "type" : "object", + "required" : [ "identifier", "name", "spec", "type" ], + "properties" : { + "description" : { + "type" : "string", + "desc" : "This is the description for IACMModuleTestPluginStepNode" + }, + "enforce" : { + "$ref" : "#/definitions/pipeline/common/PolicyConfig" + }, + "failureStrategies" : { + "oneOf" : [ { + "type" : "array", + "items" : { + "$ref" : "#/definitions/pipeline/common/FailureStrategyConfig" + } + }, { + "type" : "string", + "pattern" : "^<\\+input>$", + "minLength" : 1 + } ] + }, + "identifier" : { + "type" : "string", + "pattern" : "^[a-zA-Z_][0-9a-zA-Z_]{0,127}$" + }, + "name" : { + "type" : "string", + "pattern" : "^[a-zA-Z_0-9-.][-0-9a-zA-Z_\\s.]{0,127}$" + }, + "strategy" : { + "oneOf" : [ { + "$ref" : "#/definitions/pipeline/common/StrategyConfig" + }, { + "type" : "string", + "pattern" : "^<\\+input>$", + "minLength" : 1 + } ] + }, + "timeout" : { + "type" : "string", + "pattern" : "^(([1-9])+\\d+[s])|(((([1-9])+\\d*[mhwd])+([\\s]?\\d+[smhwd])*)|(.*<\\+.*>(?!.*\\.executionInput\\(\\)).*)|(^$))$" + }, + "type" : { + "type" : "string", + "enum" : [ "IACMModuleTestPlugin" ] + }, + "when" : { + "oneOf" : [ { + "$ref" : "#/definitions/pipeline/common/StepWhenCondition" + }, { + "type" : "string", + "pattern" : "^<\\+input>$", + "minLength" : 1 + } ] + } + }, + "$schema" : "http://json-schema.org/draft-07/schema#", + "allOf" : [ { + "if" : { + "properties" : { + "type" : { + "const" : "IACMModuleTestPlugin" + } + } + }, + "then" : { + "properties" : { + "spec" : { + "$ref" : "#/definitions/pipeline/steps/iacm/IACMModuleTestPluginInfo" + } + } + } + } ] + }, + "IACMModuleTestPluginInfo" : { + "title" : "IACMModuleTestPluginInfo", + "allOf" : [ { + "$ref" : "#/definitions/pipeline/common/StepSpecType" + }, { + "type" : "object", + "required" : [ "command" ], + "properties" : { + "command" : { + "type" : "string" + }, + "image" : { + "type" : "string" + }, + "resources" : { + "$ref" : "#/definitions/pipeline/common/ContainerResource" + }, + "target" : { + "type" : "array", + "items" : { + "type" : "string" + } + }, + "replace" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } ], + "$schema" : "http://json-schema.org/draft-07/schema#", + "type" : "object", + "required" : [ "command" ], + "properties" : { + "command" : { + "type" : "string" + }, + "image" : { + "type" : "string" + }, + "description" : { + "desc" : "This is the description for IACMModuleTestPluginInfo" + }, + "resources" : { + "$ref" : "#/definitions/pipeline/common/ContainerResource" + }, + "target" : { + "type" : "array", + "items" : { + "type" : "string" + } + }, + "replace" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } } }, "cd" : { diff --git a/v0/pipeline/stages/iacm/execution-wrapper-config.yaml b/v0/pipeline/stages/iacm/execution-wrapper-config.yaml index 971f6a78..e576d526 100644 --- a/v0/pipeline/stages/iacm/execution-wrapper-config.yaml +++ b/v0/pipeline/stages/iacm/execution-wrapper-config.yaml @@ -23,6 +23,7 @@ properties: - $ref: ../../steps/common/security-node.yaml - $ref: ../../steps/common/checkov-scan-node.yaml - $ref: ../../steps/common/snyk-scan-node.yaml + - $ref: ../../steps/iacm/iacmmoduletest-plugin-step-node.yaml description: desc: This is the description for ExecutionWrapperConfig diff --git a/v0/pipeline/stages/iacm/iacmstage-config-impl.yaml b/v0/pipeline/stages/iacm/iacmstage-config-impl.yaml index 07cd0629..81c8735b 100644 --- a/v0/pipeline/stages/iacm/iacmstage-config-impl.yaml +++ b/v0/pipeline/stages/iacm/iacmstage-config-impl.yaml @@ -1,7 +1,6 @@ title: IACMStageConfigImpl type: object required: -- workspace - execution properties: cloneCodebase: @@ -45,7 +44,8 @@ properties: - type: string workspace: type: string - minLength: 1 + moduleId: + type: string description: desc: This is the description for IACMStageConfigImpl $schema: http://json-schema.org/draft-07/schema# diff --git a/v0/pipeline/steps/iacm/iacmmoduletest-plugin-info.yaml b/v0/pipeline/steps/iacm/iacmmoduletest-plugin-info.yaml new file mode 100644 index 00000000..fb6e28d3 --- /dev/null +++ b/v0/pipeline/steps/iacm/iacmmoduletest-plugin-info.yaml @@ -0,0 +1,42 @@ +title: IACMModuleTestPluginInfo +allOf: + - $ref: ../../common/step-spec-type.yaml + - type: object + required: + - command + properties: + command: + type: string + image: + type: string + resources: + $ref: ../../common/container-resource.yaml + target: + type: array + items: + type: string + replace: + type: array + items: + type: string +$schema: http://json-schema.org/draft-07/schema# +type: object +required: + - command +properties: + command: + type: string + image: + type: string + description: + desc: This is the description for IACMModuleTestPluginInfo + resources: + $ref: ../../common/container-resource.yaml + target: + type: array + items: + type: string + replace: + type: array + items: + type: string diff --git a/v0/pipeline/steps/iacm/iacmmoduletest-plugin-step-node.yaml b/v0/pipeline/steps/iacm/iacmmoduletest-plugin-step-node.yaml new file mode 100644 index 00000000..28445618 --- /dev/null +++ b/v0/pipeline/steps/iacm/iacmmoduletest-plugin-step-node.yaml @@ -0,0 +1,56 @@ +title: IACMModuleTestPluginStepNode +type: object +required: +- identifier +- name +- spec +- type +properties: + description: + type: string + desc: This is the description for IACMModuleTestPluginStepNode + enforce: + $ref: ../../common/policy-config.yaml + failureStrategies: + oneOf: + - type: array + items: + $ref: ../../common/failure-strategy-config.yaml + - type: string + pattern: ^<\+input>$ + minLength: 1 + identifier: + type: string + pattern: ^[a-zA-Z_][0-9a-zA-Z_]{0,127}$ + name: + type: string + pattern: ^[a-zA-Z_0-9-.][-0-9a-zA-Z_\s.]{0,127}$ + strategy: + oneOf: + - $ref: ../../common/strategy-config.yaml + - type: string + pattern: ^<\+input>$ + minLength: 1 + timeout: + type: string + pattern: ^(([1-9])+\d+[s])|(((([1-9])+\d*[mhwd])+([\s]?\d+[smhwd])*)|(.*<\+.*>(?!.*\.executionInput\(\)).*)|(^$))$ + type: + type: string + enum: + - IACMModuleTestPlugin + when: + oneOf: + - $ref: ../../common/step-when-condition.yaml + - type: string + pattern: ^<\+input>$ + minLength: 1 +$schema: http://json-schema.org/draft-07/schema# +allOf: +- if: + properties: + type: + const: IACMModuleTestPlugin + then: + properties: + spec: + $ref: iacmmoduletest-plugin-info.yaml diff --git a/v0/template.json b/v0/template.json index feb15012..bc0057b2 100644 --- a/v0/template.json +++ b/v0/template.json @@ -463,6 +463,8 @@ "$ref" : "#/definitions/pipeline/steps/iacm/IACMTerraformPluginStepNode_template" }, { "$ref" : "#/definitions/pipeline/steps/iacm/IACMOpenTofuPluginStepNode_template" + }, { + "$ref" : "#/definitions/pipeline/steps/iacm/IACMModuleTestPluginStepNode_template" }, { "$ref" : "#/definitions/pipeline/steps/common/AwsCdkBootstrapStepNode_template" }, { @@ -72988,6 +72990,132 @@ } } }, + "IACMModuleTestPluginStepNode_template" : { + "title" : "IACMModuleTestPluginStepNode_template", + "type" : "object", + "required" : [ "spec", "type" ], + "properties" : { + "enforce" : { + "$ref" : "#/definitions/pipeline/common/PolicyConfig" + }, + "failureStrategies" : { + "oneOf" : [ { + "type" : "array", + "items" : { + "$ref" : "#/definitions/pipeline/common/FailureStrategyConfig" + } + }, { + "type" : "string", + "pattern" : "^<\\+input>$", + "minLength" : 1 + } ] + }, + "strategy" : { + "oneOf" : [ { + "$ref" : "#/definitions/pipeline/common/StrategyConfig" + }, { + "type" : "string", + "pattern" : "^<\\+input>$", + "minLength" : 1 + } ] + }, + "timeout" : { + "type" : "string", + "pattern" : "^(([1-9])+\\d+[s])|(((([1-9])+\\d*[mhwd])+([\\s]?\\d+[smhwd])*)|(.*<\\+.*>(?!.*\\.executionInput\\(\\)).*)|(^$))$" + }, + "type" : { + "type" : "string", + "enum" : [ "IACMModuleTestPlugin" ] + }, + "when" : { + "oneOf" : [ { + "$ref" : "#/definitions/pipeline/common/StepWhenCondition" + }, { + "type" : "string", + "pattern" : "^<\\+input>$", + "minLength" : 1 + } ] + } + }, + "$schema" : "http://json-schema.org/draft-07/schema#", + "allOf" : [ { + "if" : { + "properties" : { + "type" : { + "const" : "IACMModuleTestPlugin" + } + } + }, + "then" : { + "properties" : { + "spec" : { + "$ref" : "#/definitions/pipeline/steps/iacm/IACMModuleTestPluginInfo" + } + } + } + } ] + }, + "IACMModuleTestPluginInfo" : { + "title" : "IACMModuleTestPluginInfo", + "allOf" : [ { + "$ref" : "#/definitions/pipeline/common/StepSpecType" + }, { + "type" : "object", + "required" : [ "command" ], + "properties" : { + "command" : { + "type" : "string" + }, + "image" : { + "type" : "string" + }, + "resources" : { + "$ref" : "#/definitions/pipeline/common/ContainerResource" + }, + "target" : { + "type" : "array", + "items" : { + "type" : "string" + } + }, + "replace" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } ], + "$schema" : "http://json-schema.org/draft-07/schema#", + "type" : "object", + "required" : [ "command" ], + "properties" : { + "command" : { + "type" : "string" + }, + "image" : { + "type" : "string" + }, + "description" : { + "desc" : "This is the description for IACMModuleTestPluginInfo" + }, + "resources" : { + "$ref" : "#/definitions/pipeline/common/ContainerResource" + }, + "target" : { + "type" : "array", + "items" : { + "type" : "string" + } + }, + "replace" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + }, "IACMCheckovPluginStepNode_template" : { "title" : "IACMCheckovPluginStepNode_template", "type" : "object", @@ -73890,6 +74018,83 @@ } } } ] + }, + "IACMModuleTestPluginStepNode" : { + "title" : "IACMModuleTestPluginStepNode", + "type" : "object", + "required" : [ "identifier", "name", "spec", "type" ], + "properties" : { + "description" : { + "type" : "string", + "desc" : "This is the description for IACMModuleTestPluginStepNode" + }, + "enforce" : { + "$ref" : "#/definitions/pipeline/common/PolicyConfig" + }, + "failureStrategies" : { + "oneOf" : [ { + "type" : "array", + "items" : { + "$ref" : "#/definitions/pipeline/common/FailureStrategyConfig" + } + }, { + "type" : "string", + "pattern" : "^<\\+input>$", + "minLength" : 1 + } ] + }, + "identifier" : { + "type" : "string", + "pattern" : "^[a-zA-Z_][0-9a-zA-Z_]{0,127}$" + }, + "name" : { + "type" : "string", + "pattern" : "^[a-zA-Z_0-9-.][-0-9a-zA-Z_\\s.]{0,127}$" + }, + "strategy" : { + "oneOf" : [ { + "$ref" : "#/definitions/pipeline/common/StrategyConfig" + }, { + "type" : "string", + "pattern" : "^<\\+input>$", + "minLength" : 1 + } ] + }, + "timeout" : { + "type" : "string", + "pattern" : "^(([1-9])+\\d+[s])|(((([1-9])+\\d*[mhwd])+([\\s]?\\d+[smhwd])*)|(.*<\\+.*>(?!.*\\.executionInput\\(\\)).*)|(^$))$" + }, + "type" : { + "type" : "string", + "enum" : [ "IACMModuleTestPlugin" ] + }, + "when" : { + "oneOf" : [ { + "$ref" : "#/definitions/pipeline/common/StepWhenCondition" + }, { + "type" : "string", + "pattern" : "^<\\+input>$", + "minLength" : 1 + } ] + } + }, + "$schema" : "http://json-schema.org/draft-07/schema#", + "allOf" : [ { + "if" : { + "properties" : { + "type" : { + "const" : "IACMModuleTestPlugin" + } + } + }, + "then" : { + "properties" : { + "spec" : { + "$ref" : "#/definitions/pipeline/steps/iacm/IACMModuleTestPluginInfo" + } + } + } + } ] } } }, @@ -85162,7 +85367,7 @@ "IACMStageConfigImpl" : { "title" : "IACMStageConfigImpl", "type" : "object", - "required" : [ "workspace", "execution" ], + "required" : [ "execution" ], "properties" : { "cloneCodebase" : { "oneOf" : [ { @@ -85228,8 +85433,10 @@ } ] }, "workspace" : { - "type" : "string", - "minLength" : 1 + "type" : "string" + }, + "moduleId" : { + "type" : "string" }, "description" : { "desc" : "This is the description for IACMStageConfigImpl" @@ -85300,6 +85507,8 @@ "$ref" : "#/definitions/pipeline/steps/common/CheckovScanNode" }, { "$ref" : "#/definitions/pipeline/steps/common/SnykScanNode" + }, { + "$ref" : "#/definitions/pipeline/steps/iacm/IACMModuleTestPluginStepNode" } ] }, "description" : { diff --git a/v0/template/template_config.yaml b/v0/template/template_config.yaml index 68c164a8..ea4af554 100644 --- a/v0/template/template_config.yaml +++ b/v0/template/template_config.yaml @@ -212,6 +212,7 @@ step_template_types: - ../pipeline/steps/iacm/iacmapproval-step-node.yaml - ../pipeline/steps/iacm/iacmterraform-plugin-step-node.yaml - ../pipeline/steps/iacm/iacmopentofu-plugin-step-node.yaml + - ../pipeline/steps/iacm/iacmmoduletest-plugin-step-node.yaml - ../pipeline/steps/common/aws-cdk-bootstrap-step-node.yaml - ../pipeline/steps/common/aws-cdk-synth-step-node.yaml - ../pipeline/steps/common/aws-cdk-diff-step-node.yaml diff --git a/v1/pipeline.json b/v1/pipeline.json index bc318383..736728ec 100644 --- a/v1/pipeline.json +++ b/v1/pipeline.json @@ -259,7 +259,7 @@ "IACMStageConfigImpl" : { "title" : "IACMStageConfigImpl", "type" : "object", - "required" : [ "workspace", "execution" ], + "required" : [ "execution" ], "properties" : { "cloneCodebase" : { "oneOf" : [ { @@ -325,8 +325,10 @@ } ] }, "workspace" : { - "type" : "string", - "minLength" : 1 + "type" : "string" + }, + "moduleId" : { + "type" : "string" }, "description" : { "desc" : "This is the description for IACMStageConfigImpl" @@ -397,6 +399,8 @@ "$ref" : "#/definitions/pipeline/steps/common/CheckovScanNode" }, { "$ref" : "#/definitions/pipeline/steps/common/SnykScanNode" + }, { + "$ref" : "#/definitions/pipeline/steps/iacm/IACMModuleTestPluginStepNode" } ] }, "description" : { @@ -29652,6 +29656,144 @@ "desc" : "This is the description for IACMCheckovPluginInfo" } } + }, + "IACMModuleTestPluginStepNode" : { + "title" : "IACMModuleTestPluginStepNode", + "type" : "object", + "required" : [ "identifier", "name", "spec", "type" ], + "properties" : { + "description" : { + "type" : "string", + "desc" : "This is the description for IACMModuleTestPluginStepNode" + }, + "enforce" : { + "$ref" : "#/definitions/pipeline/common/PolicyConfig" + }, + "failureStrategies" : { + "oneOf" : [ { + "type" : "array", + "items" : { + "$ref" : "#/definitions/pipeline/common/FailureStrategyConfig" + } + }, { + "type" : "string", + "pattern" : "^<\\+input>$", + "minLength" : 1 + } ] + }, + "identifier" : { + "type" : "string", + "pattern" : "^[a-zA-Z_][0-9a-zA-Z_]{0,127}$" + }, + "name" : { + "type" : "string", + "pattern" : "^[a-zA-Z_0-9-.][-0-9a-zA-Z_\\s.]{0,127}$" + }, + "strategy" : { + "oneOf" : [ { + "$ref" : "#/definitions/pipeline/common/StrategyConfig" + }, { + "type" : "string", + "pattern" : "^<\\+input>$", + "minLength" : 1 + } ] + }, + "timeout" : { + "type" : "string", + "pattern" : "^(([1-9])+\\d+[s])|(((([1-9])+\\d*[mhwd])+([\\s]?\\d+[smhwd])*)|(.*<\\+.*>(?!.*\\.executionInput\\(\\)).*)|(^$))$" + }, + "type" : { + "type" : "string", + "enum" : [ "IACMModuleTestPlugin" ] + }, + "when" : { + "oneOf" : [ { + "$ref" : "#/definitions/pipeline/common/StepWhenCondition" + }, { + "type" : "string", + "pattern" : "^<\\+input>$", + "minLength" : 1 + } ] + } + }, + "$schema" : "http://json-schema.org/draft-07/schema#", + "allOf" : [ { + "if" : { + "properties" : { + "type" : { + "const" : "IACMModuleTestPlugin" + } + } + }, + "then" : { + "properties" : { + "spec" : { + "$ref" : "#/definitions/pipeline/steps/iacm/IACMModuleTestPluginInfo" + } + } + } + } ] + }, + "IACMModuleTestPluginInfo" : { + "title" : "IACMModuleTestPluginInfo", + "allOf" : [ { + "$ref" : "#/definitions/pipeline/common/StepSpecType" + }, { + "type" : "object", + "required" : [ "command" ], + "properties" : { + "command" : { + "type" : "string" + }, + "image" : { + "type" : "string" + }, + "resources" : { + "$ref" : "#/definitions/pipeline/common/ContainerResource" + }, + "target" : { + "type" : "array", + "items" : { + "type" : "string" + } + }, + "replace" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } ], + "$schema" : "http://json-schema.org/draft-07/schema#", + "type" : "object", + "required" : [ "command" ], + "properties" : { + "command" : { + "type" : "string" + }, + "image" : { + "type" : "string" + }, + "description" : { + "desc" : "This is the description for IACMModuleTestPluginInfo" + }, + "resources" : { + "$ref" : "#/definitions/pipeline/common/ContainerResource" + }, + "target" : { + "type" : "array", + "items" : { + "type" : "string" + } + }, + "replace" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } } }, "cd" : { diff --git a/v1/pipeline/stages/iacm/execution-wrapper-config.yaml b/v1/pipeline/stages/iacm/execution-wrapper-config.yaml index 40e895fb..75e9052c 100644 --- a/v1/pipeline/stages/iacm/execution-wrapper-config.yaml +++ b/v1/pipeline/stages/iacm/execution-wrapper-config.yaml @@ -23,6 +23,7 @@ properties: - $ref: ../../steps/common/security-node.yaml - $ref: ../../steps/common/checkov-scan-node.yaml - $ref: ../../steps/common/snyk-scan-node.yaml + - $ref: ../../steps/iacm/iacmmoduletest-plugin-step-node.yaml description: desc: This is the description for ExecutionWrapperConfig diff --git a/v1/pipeline/stages/iacm/iacmstage-config-impl.yaml b/v1/pipeline/stages/iacm/iacmstage-config-impl.yaml index 20ee0e4e..1acdd28b 100644 --- a/v1/pipeline/stages/iacm/iacmstage-config-impl.yaml +++ b/v1/pipeline/stages/iacm/iacmstage-config-impl.yaml @@ -1,7 +1,6 @@ title: IACMStageConfigImpl type: object required: -- workspace - execution properties: cloneCodebase: @@ -45,7 +44,8 @@ properties: - type: string workspace: type: string - minLength: 1 + moduleId: + type: string description: desc: This is the description for IACMStageConfigImpl $schema: http://json-schema.org/draft-07/schema# diff --git a/v1/pipeline/steps/iacm/iacmmoduletest-plugin-info.yaml b/v1/pipeline/steps/iacm/iacmmoduletest-plugin-info.yaml new file mode 100644 index 00000000..522b24ae --- /dev/null +++ b/v1/pipeline/steps/iacm/iacmmoduletest-plugin-info.yaml @@ -0,0 +1,42 @@ +title: IACMModuleTestPluginInfo +allOf: +- $ref: ../../common/step-spec-type.yaml +- type: object + required: + - command + properties: + command: + type: string + image: + type: string + resources: + $ref: ../../common/container-resource.yaml + target: + type: array + items: + type: string + replace: + type: array + items: + type: string +$schema: http://json-schema.org/draft-07/schema# +type: object +required: +- command +properties: + command: + type: string + image: + type: string + description: + desc: This is the description for IACMModuleTestPluginInfo + resources: + $ref: ../../common/container-resource.yaml + target: + type: array + items: + type: string + replace: + type: array + items: + type: string diff --git a/v1/pipeline/steps/iacm/iacmmoduletest-plugin-step-node.yaml b/v1/pipeline/steps/iacm/iacmmoduletest-plugin-step-node.yaml new file mode 100644 index 00000000..28445618 --- /dev/null +++ b/v1/pipeline/steps/iacm/iacmmoduletest-plugin-step-node.yaml @@ -0,0 +1,56 @@ +title: IACMModuleTestPluginStepNode +type: object +required: +- identifier +- name +- spec +- type +properties: + description: + type: string + desc: This is the description for IACMModuleTestPluginStepNode + enforce: + $ref: ../../common/policy-config.yaml + failureStrategies: + oneOf: + - type: array + items: + $ref: ../../common/failure-strategy-config.yaml + - type: string + pattern: ^<\+input>$ + minLength: 1 + identifier: + type: string + pattern: ^[a-zA-Z_][0-9a-zA-Z_]{0,127}$ + name: + type: string + pattern: ^[a-zA-Z_0-9-.][-0-9a-zA-Z_\s.]{0,127}$ + strategy: + oneOf: + - $ref: ../../common/strategy-config.yaml + - type: string + pattern: ^<\+input>$ + minLength: 1 + timeout: + type: string + pattern: ^(([1-9])+\d+[s])|(((([1-9])+\d*[mhwd])+([\s]?\d+[smhwd])*)|(.*<\+.*>(?!.*\.executionInput\(\)).*)|(^$))$ + type: + type: string + enum: + - IACMModuleTestPlugin + when: + oneOf: + - $ref: ../../common/step-when-condition.yaml + - type: string + pattern: ^<\+input>$ + minLength: 1 +$schema: http://json-schema.org/draft-07/schema# +allOf: +- if: + properties: + type: + const: IACMModuleTestPlugin + then: + properties: + spec: + $ref: iacmmoduletest-plugin-info.yaml diff --git a/v1/template.json b/v1/template.json index aeb4307e..2f4ee937 100644 --- a/v1/template.json +++ b/v1/template.json @@ -488,6 +488,8 @@ "$ref" : "#/definitions/pipeline/steps/cd/GoogleCloudRunTrafficShiftStepNode_template" }, { "$ref" : "#/definitions/pipeline/steps/cd/GoogleCloudRunRollbackStepNode_template" + }, { + "$ref" : "#/definitions/pipeline/steps/iacm/IACMModuleTestPluginStepNode_template" }, { "$ref" : "#/definitions/pipeline/steps/cd/GoogleCloudRunJobStepNode_template" } ] @@ -64640,6 +64642,132 @@ } } }, + "IACMModuleTestPluginStepNode_template" : { + "title" : "IACMModuleTestPluginStepNode_template", + "type" : "object", + "required" : [ "spec", "type" ], + "properties" : { + "enforce" : { + "$ref" : "#/definitions/pipeline/common/PolicyConfig" + }, + "failureStrategies" : { + "oneOf" : [ { + "type" : "array", + "items" : { + "$ref" : "#/definitions/pipeline/common/FailureStrategyConfig" + } + }, { + "type" : "string", + "pattern" : "^<\\+input>$", + "minLength" : 1 + } ] + }, + "strategy" : { + "oneOf" : [ { + "$ref" : "#/definitions/pipeline/common/StrategyConfig" + }, { + "type" : "string", + "pattern" : "^<\\+input>$", + "minLength" : 1 + } ] + }, + "timeout" : { + "type" : "string", + "pattern" : "^(([1-9])+\\d+[s])|(((([1-9])+\\d*[mhwd])+([\\s]?\\d+[smhwd])*)|(.*<\\+.*>(?!.*\\.executionInput\\(\\)).*)|(^$))$" + }, + "type" : { + "type" : "string", + "enum" : [ "IACMModuleTestPlugin" ] + }, + "when" : { + "oneOf" : [ { + "$ref" : "#/definitions/pipeline/common/StepWhenCondition" + }, { + "type" : "string", + "pattern" : "^<\\+input>$", + "minLength" : 1 + } ] + } + }, + "$schema" : "http://json-schema.org/draft-07/schema#", + "allOf" : [ { + "if" : { + "properties" : { + "type" : { + "const" : "IACMModuleTestPlugin" + } + } + }, + "then" : { + "properties" : { + "spec" : { + "$ref" : "#/definitions/pipeline/steps/iacm/IACMModuleTestPluginInfo" + } + } + } + } ] + }, + "IACMModuleTestPluginInfo" : { + "title" : "IACMModuleTestPluginInfo", + "allOf" : [ { + "$ref" : "#/definitions/pipeline/common/StepSpecType" + }, { + "type" : "object", + "required" : [ "command" ], + "properties" : { + "command" : { + "type" : "string" + }, + "image" : { + "type" : "string" + }, + "resources" : { + "$ref" : "#/definitions/pipeline/common/ContainerResource" + }, + "target" : { + "type" : "array", + "items" : { + "type" : "string" + } + }, + "replace" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + } ], + "$schema" : "http://json-schema.org/draft-07/schema#", + "type" : "object", + "required" : [ "command" ], + "properties" : { + "command" : { + "type" : "string" + }, + "image" : { + "type" : "string" + }, + "description" : { + "desc" : "This is the description for IACMModuleTestPluginInfo" + }, + "resources" : { + "$ref" : "#/definitions/pipeline/common/ContainerResource" + }, + "target" : { + "type" : "array", + "items" : { + "type" : "string" + } + }, + "replace" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + }, "IACMTerraformPluginStepNode" : { "title" : "IACMTerraformPluginStepNode", "type" : "object", @@ -65178,6 +65306,83 @@ } } } ] + }, + "IACMModuleTestPluginStepNode" : { + "title" : "IACMModuleTestPluginStepNode", + "type" : "object", + "required" : [ "identifier", "name", "spec", "type" ], + "properties" : { + "description" : { + "type" : "string", + "desc" : "This is the description for IACMModuleTestPluginStepNode" + }, + "enforce" : { + "$ref" : "#/definitions/pipeline/common/PolicyConfig" + }, + "failureStrategies" : { + "oneOf" : [ { + "type" : "array", + "items" : { + "$ref" : "#/definitions/pipeline/common/FailureStrategyConfig" + } + }, { + "type" : "string", + "pattern" : "^<\\+input>$", + "minLength" : 1 + } ] + }, + "identifier" : { + "type" : "string", + "pattern" : "^[a-zA-Z_][0-9a-zA-Z_]{0,127}$" + }, + "name" : { + "type" : "string", + "pattern" : "^[a-zA-Z_0-9-.][-0-9a-zA-Z_\\s.]{0,127}$" + }, + "strategy" : { + "oneOf" : [ { + "$ref" : "#/definitions/pipeline/common/StrategyConfig" + }, { + "type" : "string", + "pattern" : "^<\\+input>$", + "minLength" : 1 + } ] + }, + "timeout" : { + "type" : "string", + "pattern" : "^(([1-9])+\\d+[s])|(((([1-9])+\\d*[mhwd])+([\\s]?\\d+[smhwd])*)|(.*<\\+.*>(?!.*\\.executionInput\\(\\)).*)|(^$))$" + }, + "type" : { + "type" : "string", + "enum" : [ "IACMModuleTestPlugin" ] + }, + "when" : { + "oneOf" : [ { + "$ref" : "#/definitions/pipeline/common/StepWhenCondition" + }, { + "type" : "string", + "pattern" : "^<\\+input>$", + "minLength" : 1 + } ] + } + }, + "$schema" : "http://json-schema.org/draft-07/schema#", + "allOf" : [ { + "if" : { + "properties" : { + "type" : { + "const" : "IACMModuleTestPlugin" + } + } + }, + "then" : { + "properties" : { + "spec" : { + "$ref" : "#/definitions/pipeline/steps/iacm/IACMModuleTestPluginInfo" + } + } + } + } ] } }, "idp" : { @@ -70807,7 +71012,7 @@ "IACMStageConfigImpl" : { "title" : "IACMStageConfigImpl", "type" : "object", - "required" : [ "workspace", "execution" ], + "required" : [ "execution" ], "properties" : { "cloneCodebase" : { "oneOf" : [ { @@ -70873,8 +71078,10 @@ } ] }, "workspace" : { - "type" : "string", - "minLength" : 1 + "type" : "string" + }, + "moduleId" : { + "type" : "string" }, "description" : { "desc" : "This is the description for IACMStageConfigImpl" @@ -70945,6 +71152,8 @@ "$ref" : "#/definitions/pipeline/steps/common/CheckovScanNode" }, { "$ref" : "#/definitions/pipeline/steps/common/SnykScanNode" + }, { + "$ref" : "#/definitions/pipeline/steps/iacm/IACMModuleTestPluginStepNode" } ] }, "description" : { diff --git a/v1/template/template_config.yaml b/v1/template/template_config.yaml index 6a35bd17..9fecfed1 100644 --- a/v1/template/template_config.yaml +++ b/v1/template/template_config.yaml @@ -205,6 +205,7 @@ step_template_types: - ../pipeline/steps/cd/google-cloud-run-deploy-step-node.yaml - ../pipeline/steps/cd/google-cloud-run-traffic-shift-step-node.yaml - ../pipeline/steps/cd/google-cloud-run-rollback-step-node.yaml + - ../pipeline/steps/iacm/iacmmoduletest-plugin-step-node.yaml - ../pipeline/steps/cd/google-cloud-run-job-step-node.yaml stage_template_types: