Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [CDS-89581]: Incorrect yaml generated for failure strategy #357

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions v0/pipeline.json
Original file line number Diff line number Diff line change
Expand Up @@ -10010,6 +10010,68 @@
"desc" : "This is the description for FailureStrategyActionConfig"
}
},
"$schema" : "http://json-schema.org/draft-07/schema#",
"allOf" : [ {
"if" : {
"properties" : {
"type" : {
"const" : "Retry"
}
}
},
"then" : {
"properties" : {
"spec" : {
"$ref" : "#/definitions/pipeline/common/Retry"
}
}
}
} ]
},
"Retry" : {
"title" : "Retry",
"type" : "object",
"required" : [ "retryCount", "retryIntervals", "onRetryFailure" ],
"properties" : {
"retryCount" : {
"type" : "number",
"example" : 3
},
"retryIntervals" : {
"type" : "array",
"minItems" : 1,
"items" : {
"type" : "string",
"minLength" : 1,
"format" : "duration"
},
"example" : [ "5s", "10s", "20s" ]
},
"onRetryFailure" : {
"properties" : {
"action" : {
"$ref" : "#/definitions/pipeline/common/OnRetryFailure"
}
}
}
},
"$schema" : "http://json-schema.org/draft-07/schema#"
},
"OnRetryFailure" : {
"title" : "OnRetryFailure",
"type" : "object",
"description" : "Failure action post all retries",
"required" : [ "type" ],
"properties" : {
"type" : {
"description" : "Type defines failure strategy actions",
"type" : "string",
"enum" : [ "Ignore", "MarkAsSuccess", "Abort", "MarkAsFailure" ]
},
"description" : {
"desc" : "This is the description for onRetryFailure"
}
},
"$schema" : "http://json-schema.org/draft-07/schema#"
},
"StrategyConfig" : {
Expand Down
11 changes: 11 additions & 0 deletions v0/pipeline/common/failure-strategy-action-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,14 @@ properties:
description:
desc: This is the description for FailureStrategyActionConfig
$schema: http://json-schema.org/draft-07/schema#
allOf:
- if:
properties:
type:
const: Retry
then:
properties:
spec:
$ref: ./retry.yaml


17 changes: 17 additions & 0 deletions v0/pipeline/common/on-retry-failure.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
title: OnRetryFailure
type: object
description: Failure action post all retries
required:
- type
properties:
type:
description: Type defines failure strategy actions
type: string
enum:
- Ignore
- MarkAsSuccess
- Abort
- MarkAsFailure
description:
desc: This is the description for onRetryFailure
$schema: http://json-schema.org/draft-07/schema#
24 changes: 24 additions & 0 deletions v0/pipeline/common/retry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
title: Retry
type: object
required:
- retryCount
- retryIntervals
- onRetryFailure
properties:
retryCount:
type: number
example: 3
retryIntervals:
type: array
minItems: 1
items:
type: string
minLength: 1
format: duration
example: [5s, 10s, 20s]
onRetryFailure:
properties:
action:
$ref: ./on-retry-failure.yaml

$schema: http://json-schema.org/draft-07/schema#
62 changes: 62 additions & 0 deletions v0/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -63771,6 +63771,68 @@
"desc" : "This is the description for FailureStrategyActionConfig"
}
},
"$schema" : "http://json-schema.org/draft-07/schema#",
"allOf" : [ {
"if" : {
"properties" : {
"type" : {
"const" : "Retry"
}
}
},
"then" : {
"properties" : {
"spec" : {
"$ref" : "#/definitions/pipeline/common/Retry"
}
}
}
} ]
},
"Retry" : {
"title" : "Retry",
"type" : "object",
"required" : [ "retryCount", "retryIntervals", "onRetryFailure" ],
"properties" : {
"retryCount" : {
"type" : "number",
"example" : 3
},
"retryIntervals" : {
"type" : "array",
"minItems" : 1,
"items" : {
"type" : "string",
"minLength" : 1,
"format" : "duration"
},
"example" : [ "5s", "10s", "20s" ]
},
"onRetryFailure" : {
"properties" : {
"action" : {
"$ref" : "#/definitions/pipeline/common/OnRetryFailure"
}
}
}
},
"$schema" : "http://json-schema.org/draft-07/schema#"
},
"OnRetryFailure" : {
"title" : "OnRetryFailure",
"type" : "object",
"description" : "Failure action post all retries",
"required" : [ "type" ],
"properties" : {
"type" : {
"description" : "Type defines failure strategy actions",
"type" : "string",
"enum" : [ "Ignore", "MarkAsSuccess", "Abort", "MarkAsFailure" ]
},
"description" : {
"desc" : "This is the description for onRetryFailure"
}
},
"$schema" : "http://json-schema.org/draft-07/schema#"
},
"StrategyConfig" : {
Expand Down