Skip to content

Commit

Permalink
feat: [IAC-2855]: Remove workspaceId as requirement and add moduleId
Browse files Browse the repository at this point in the history
  • Loading branch information
nassergonzalez committed Jan 6, 2025
1 parent ae91096 commit 2e0e48d
Show file tree
Hide file tree
Showing 14 changed files with 918 additions and 16 deletions.
148 changes: 145 additions & 3 deletions v0/pipeline.json
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@
"IACMStageConfigImpl" : {
"title" : "IACMStageConfigImpl",
"type" : "object",
"required" : [ "workspace", "execution" ],
"required" : [ "execution" ],
"properties" : {
"cloneCodebase" : {
"oneOf" : [ {
Expand Down Expand Up @@ -832,8 +832,10 @@
} ]
},
"workspace" : {
"type" : "string",
"minLength" : 1
"type" : "string"
},
"moduleId" : {
"type" : "string"
},
"description" : {
"desc" : "This is the description for IACMStageConfigImpl"
Expand Down Expand Up @@ -904,6 +906,8 @@
"$ref" : "#/definitions/pipeline/steps/common/CheckovScanNode"
}, {
"$ref" : "#/definitions/pipeline/steps/common/SnykScanNode"
}, {
"$ref" : "#/definitions/pipeline/steps/iacm/IACMModuleTestPluginStepNode"
} ]
},
"description" : {
Expand Down Expand Up @@ -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" : {
Expand Down
1 change: 1 addition & 0 deletions v0/pipeline/stages/iacm/execution-wrapper-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions v0/pipeline/stages/iacm/iacmstage-config-impl.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
title: IACMStageConfigImpl
type: object
required:
- workspace
- execution
properties:
cloneCodebase:
Expand Down Expand Up @@ -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#
42 changes: 42 additions & 0 deletions v0/pipeline/steps/iacm/iacmmoduletest-plugin-info.yaml
Original file line number Diff line number Diff line change
@@ -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
56 changes: 56 additions & 0 deletions v0/pipeline/steps/iacm/iacmmoduletest-plugin-step-node.yaml
Original file line number Diff line number Diff line change
@@ -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
Loading

0 comments on commit 2e0e48d

Please sign in to comment.