Skip to content

Commit

Permalink
fix(kayenta): plumb through siteLocal for kayenta email support (#3061)
Browse files Browse the repository at this point in the history
This a temporary "hack" until https://github.com/spinnaker/kayenta/issues/600 is addressed.
This changes passes through the `siteLocal` stage context to the kayenta so that it can send
report emails. The `siteLocal` params (in `orca`) are currently used at Netflix only but they exist in
OSS `deck`. Medium term, we will remove this from deck and orca
  • Loading branch information
marchello2000 committed Jul 25, 2019
1 parent 12172de commit 267005c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ interface KayentaService {

data class CanaryExecutionRequest(
val scopes: Map<String, CanaryScopes> = emptyMap(),
val thresholds: Thresholds
val thresholds: Thresholds,
// TODO: Remove all remnants of siteLocal when addressing https://github.com/spinnaker/kayenta/issues/600
val siteLocal: Map<String, Any> = emptyMap()
)

data class CanaryScopes(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ data class KayentaCanaryContext(
val canaryConfigId: String,
val scopes: List<CanaryConfigScope> = emptyList(),
val scoreThresholds: Thresholds = Thresholds(pass = 75, marginal = 50),
@Deprecated("Kept to support pipelines that haven't been updated to use lifetimeDuration")
val siteLocal: Map<String, Any> = emptyMap(),

@Deprecated("Kept to support pipelines that haven't been updated to use lifetimeDuration")
@JsonProperty(access = JsonProperty.Access.READ_WRITE)
private val lifetimeHours: Int? = null,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ internal data class RunCanaryContext(
val storageAccountName: String?,
val canaryConfigId: String,
val scopes: Map<String, CanaryScopes> = emptyMap(),
val scoreThresholds: Thresholds
val scoreThresholds: Thresholds,
val siteLocal: Map<String, Any> = emptyMap()
)
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ class RunCanaryIntervalsStage(private val clock: Clock) : StageDefinitionBuilder
canaryConfig.storageAccountName,
canaryConfig.canaryConfigId,
buildRequestScopes(canaryConfig, getDeployDetails(parent), i, canaryAnalysisInterval),
canaryConfig.scoreThresholds
canaryConfig.scoreThresholds,
canaryConfig.siteLocal
)

graph.append {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class RunKayentaCanaryTask(
context.metricsAccountName,
context.configurationAccountName,
context.storageAccountName,
CanaryExecutionRequest(context.scopes, context.scoreThresholds)
CanaryExecutionRequest(context.scopes, context.scoreThresholds, context.siteLocal)
)["canaryExecutionId"] as String

return TaskResult.builder(SUCCEEDED).context("canaryPipelineExecutionId", canaryPipelineExecutionId).build()
Expand Down

0 comments on commit 267005c

Please sign in to comment.