Skip to content

Commit

Permalink
Merge branch 'master' into module-toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
eysi09 authored Jan 21, 2020
2 parents 95ff6cd + c6a0fed commit 599d334
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 65 deletions.
63 changes: 33 additions & 30 deletions garden-service/src/types/plugin/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,36 +85,39 @@ export interface RunResult {
output?: string
}

export const runResultSchema = joi.object().keys({
moduleName: joi.string().description("The name of the module that was run."),
command: joi
.array()
.items(joi.string())
.required()
.description("The command that was run in the module."),
version: joi.string().description("The string version of the module."),
success: joi
.boolean()
.required()
.description("Whether the module was successfully run."),
startedAt: joi
.date()
.required()
.description("When the module run was started."),
completedAt: joi
.date()
.required()
.description("When the module run was completed."),
log: joi
.string()
.allow("")
.default("")
.description("The output log from the run."),
output: joi
.string()
.allow("")
.description("[DEPRECATED - use `log` instead] The output log from the run."),
})
export const runResultSchema = joi
.object()
.unknown(true)
.keys({
moduleName: joi.string().description("The name of the module that was run."),
command: joi
.array()
.items(joi.string())
.required()
.description("The command that was run in the module."),
version: joi.string().description("The string version of the module."),
success: joi
.boolean()
.required()
.description("Whether the module was successfully run."),
startedAt: joi
.date()
.required()
.description("When the module run was started."),
completedAt: joi
.date()
.required()
.description("When the module run was completed."),
log: joi
.string()
.allow("")
.default("")
.description("The output log from the run."),
output: joi
.string()
.allow("")
.description("[DEPRECATED - use `log` instead] The output log from the run."),
})

export const artifactsPathSchema = joi
.string()
Expand Down
73 changes: 38 additions & 35 deletions garden-service/src/types/plugin/task/getTaskResult.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,41 +20,44 @@ export interface GetTaskResultParams<T extends Module = Module> extends PluginTa
taskVersion: ModuleVersion
}

export const taskResultSchema = joi.object().keys({
moduleName: joi.string().description("The name of the module that the task belongs to."),
taskName: joi.string().description("The name of the task that was run."),
command: joi
.array()
.items(joi.string())
.required()
.description("The command that the task ran in the module."),
version: joi.string().description("The string version of the task."),
success: joi
.boolean()
.required()
.description("Whether the task was successfully run."),
startedAt: joi
.date()
.required()
.description("When the task run was started."),
completedAt: joi
.date()
.required()
.description("When the task run was completed."),
log: joi
.string()
.required()
.allow("")
.description("The output log from the run."),
output: joi
.string()
.allow("")
.description("[DEPRECATED - use `log` instead] The output log from the run."),
outputs: joi
.object()
.pattern(/.+/, joiPrimitive())
.description("A map of primitive values, output from the task."),
})
export const taskResultSchema = joi
.object()
.unknown(true)
.keys({
moduleName: joi.string().description("The name of the module that the task belongs to."),
taskName: joi.string().description("The name of the task that was run."),
command: joi
.array()
.items(joi.string())
.required()
.description("The command that the task ran in the module."),
version: joi.string().description("The string version of the task."),
success: joi
.boolean()
.required()
.description("Whether the task was successfully run."),
startedAt: joi
.date()
.required()
.description("When the task run was started."),
completedAt: joi
.date()
.required()
.description("When the task run was completed."),
log: joi
.string()
.required()
.allow("")
.description("The output log from the run."),
output: joi
.string()
.allow("")
.description("[DEPRECATED - use `log` instead] The output log from the run."),
outputs: joi
.object()
.pattern(/.+/, joiPrimitive())
.description("A map of primitive values, output from the task."),
})

export const getTaskResult = {
description: dedent`
Expand Down

0 comments on commit 599d334

Please sign in to comment.