diff --git a/garden-service/src/actions.ts b/garden-service/src/actions.ts index 4b26806ef4..90e626439b 100644 --- a/garden-service/src/actions.ts +++ b/garden-service/src/actions.ts @@ -11,7 +11,7 @@ import chalk from "chalk" import { Garden } from "./garden" import { PrimitiveMap } from "./config/common" import { Module, ModuleMap } from "./types/module" -import { ModuleActions, ServiceActions, PluginActions, WorkflowActions } from "./types/plugin/plugin" +import { ModuleActions, ServiceActions, PluginActions, TaskActions } from "./types/plugin/plugin" import { BuildResult, BuildStatus, @@ -28,8 +28,8 @@ import { TestResult, PluginActionOutputs, PublishResult, - RunWorkflowResult, - WorkflowActionOutputs, + RunTaskResult, + TaskActionOutputs, HotReloadResult, } from "./types/plugin/outputs" import { @@ -59,9 +59,9 @@ import { GetEnvironmentStatusParams, PluginModuleActionParamsBase, PublishModuleParams, - PluginWorkflowActionParamsBase, - RunWorkflowParams, - WorkflowActionParams, + PluginTaskActionParamsBase, + RunTaskParams, + TaskActionParams, } from "./types/plugin/params" import { Service, @@ -105,7 +105,7 @@ type ServiceActionHelperParams = Omit & { runtimeContext?: RuntimeContext, pluginName?: string } -type WorkflowActionHelperParams = +type TaskActionHelperParams = Omit & { runtimeContext?: RuntimeContext, pluginName?: string } @@ -312,11 +312,11 @@ export class ActionHelper implements TypeGuard { //endregion //=========================================================================== - //region Workflow Methods + //region Task Methods //=========================================================================== - async runWorkflow(params: WorkflowActionHelperParams): Promise { - return this.callWorkflowHandler({ params, actionType: "runWorkflow" }) + async runTask(params: TaskActionHelperParams): Promise { + return this.callTaskHandler({ params, actionType: "runTask" }) } //endregion @@ -452,16 +452,16 @@ export class ActionHelper implements TypeGuard { return (handler)(handlerParams) } - private async callWorkflowHandler( + private async callTaskHandler( { params, actionType, defaultHandler }: { - params: WorkflowActionHelperParams, actionType: T, - defaultHandler?: WorkflowActions[T], + params: TaskActionHelperParams, actionType: T, + defaultHandler?: TaskActions[T], }, - ): Promise { + ): Promise { - const { workflow } = params - const module = workflow.module + const { task } = params + const module = task.module const handler = await this.garden.getModuleActionHandler({ moduleType: module.type, @@ -476,7 +476,7 @@ export class ActionHelper implements TypeGuard { ...this.commonParams(handler), ...params, module, - workflow, + task, buildDependencies, } diff --git a/garden-service/src/commands/run/run.ts b/garden-service/src/commands/run/run.ts index 7783210c23..7ecdf51548 100644 --- a/garden-service/src/commands/run/run.ts +++ b/garden-service/src/commands/run/run.ts @@ -12,7 +12,7 @@ import { highlightYaml } from "../../util/util" import { Command } from "../base" import { RunModuleCommand } from "./module" import { RunServiceCommand } from "./service" -import { RunWorkflowCommand } from "./workflow" +import { RunTaskCommand } from "./task" import { RunTestCommand } from "./test" import { Garden } from "../../garden" @@ -23,7 +23,7 @@ export class RunCommand extends Command { subCommands = [ RunModuleCommand, RunServiceCommand, - RunWorkflowCommand, + RunTaskCommand, RunTestCommand, ] diff --git a/garden-service/src/commands/run/workflow.ts b/garden-service/src/commands/run/task.ts similarity index 79% rename from garden-service/src/commands/run/workflow.ts rename to garden-service/src/commands/run/task.ts index d468fe50f8..86f1fe0ec1 100644 --- a/garden-service/src/commands/run/workflow.ts +++ b/garden-service/src/commands/run/task.ts @@ -22,7 +22,7 @@ import { import { printRuntimeContext } from "./run" import dedent = require("dedent") import { prepareRuntimeContext } from "../../types/service" -import { WorkflowTask } from "../../tasks/workflow" +import { TaskTask } from "../../tasks/task" const runArgs = { task: new StringParameter({ @@ -38,7 +38,7 @@ const runOpts = { type Args = typeof runArgs type Opts = typeof runOpts -export class RunWorkflowCommand extends Command { +export class RunTaskCommand extends Command { name = "task" alias = "t" help = "Run a task (in the context of its parent module)." @@ -55,10 +55,10 @@ export class RunWorkflowCommand extends Command { options = runOpts async action({ garden, args, opts }: CommandParams): Promise> { - const workflow = await garden.getWorkflow(args.task) - const module = workflow.module + const task = await garden.getTask(args.task) + const module = task.module - const msg = `Running task ${chalk.white(workflow.name)}` + const msg = `Running task ${chalk.white(task.name)}` garden.log.header({ emoji: "runner", @@ -67,8 +67,8 @@ export class RunWorkflowCommand extends Command { await garden.actions.prepareEnvironment({}) - const workflowTask = new WorkflowTask({ garden, workflow, force: true, forceBuild: opts["force-build"] }) - for (const depTask of await workflowTask.getDependencies()) { + const taskTask = new TaskTask({ garden, task, force: true, forceBuild: opts["force-build"] }) + for (const depTask of await taskTask.getDependencies()) { await garden.addTask(depTask) } await garden.processTasks() @@ -83,7 +83,7 @@ export class RunWorkflowCommand extends Command { garden.log.info("") - const result = await garden.actions.runWorkflow({ workflow, runtimeContext, interactive: true }) + const result = await garden.actions.runTask({ task, runtimeContext, interactive: true }) garden.log.info(chalk.white(result.output)) diff --git a/garden-service/src/commands/scan.ts b/garden-service/src/commands/scan.ts index 01bf77b20c..f972a0d309 100644 --- a/garden-service/src/commands/scan.ts +++ b/garden-service/src/commands/scan.ts @@ -24,9 +24,9 @@ export class ScanCommand extends Command { const modules = (await garden.getModules()) .map(m => { m.services.forEach(s => delete s.module) - m.workflows.forEach(w => delete w.module) + m.tasks.forEach(w => delete w.module) return omit(m, [ - "_ConfigType", "cacheContext", "serviceConfigs", "serviceNames", "workflowConfigs", "workflowNames", + "_ConfigType", "cacheContext", "serviceConfigs", "serviceNames", "taskConfigs", "taskNames", ]) }) diff --git a/garden-service/src/config/base.ts b/garden-service/src/config/base.ts index 4cf0167829..e210786cd6 100644 --- a/garden-service/src/config/base.ts +++ b/garden-service/src/config/base.ts @@ -124,7 +124,7 @@ export async function loadConfig(projectRoot: string, path: string): Promise extends BaseModuleSpec { @@ -125,7 +125,7 @@ export interface ModuleConfig serviceConfigs: ServiceConfig[] testConfigs: TestConfig[] - workflowConfigs: WorkflowConfig[] + taskConfigs: TaskConfig[] // Plugins can add custom fields that are kept here spec: M diff --git a/garden-service/src/config/workflow.ts b/garden-service/src/config/task.ts similarity index 80% rename from garden-service/src/config/workflow.ts rename to garden-service/src/config/task.ts index 492e13d82f..40018c5e42 100644 --- a/garden-service/src/config/workflow.ts +++ b/garden-service/src/config/task.ts @@ -13,15 +13,15 @@ import { joiIdentifier, } from "./common" -export interface WorkflowSpec { } +export interface TaskSpec { } -export interface BaseWorkflowSpec extends WorkflowSpec { +export interface BaseTaskSpec extends TaskSpec { name: string dependencies: string[] timeout: number | null } -export const baseWorkflowSpecSchema = Joi.object() +export const baseTaskSpecSchema = Joi.object() .keys({ name: joiIdentifier() .required() @@ -39,12 +39,12 @@ export const baseWorkflowSpecSchema = Joi.object() }) .description("Required configuration for module tasks.") -export interface WorkflowConfig extends BaseWorkflowSpec { +export interface TaskConfig extends BaseTaskSpec { // Plugins can add custom fields that are kept here spec: T } -export const workflowConfigSchema = baseWorkflowSpecSchema +export const taskConfigSchema = baseTaskSpecSchema .keys({ spec: Joi.object() .meta({ extendable: true }) @@ -52,13 +52,13 @@ export const workflowConfigSchema = baseWorkflowSpecSchema }) .description("The configuration for a module's task.") -export const workflowSchema = Joi.object() +export const taskSchema = Joi.object() .options({ presence: "required" }) .keys({ name: joiIdentifier() .description("The name of the task."), module: Joi.object().unknown(true), - config: workflowConfigSchema, + config: taskConfigSchema, spec: Joi.object() .meta({ extendable: true }) .description("The configuration of the task (specific to each plugin)."), diff --git a/garden-service/src/dependency-graph.ts b/garden-service/src/dependency-graph.ts index e9f201d6bc..d4aca2736f 100644 --- a/garden-service/src/dependency-graph.ts +++ b/garden-service/src/dependency-graph.ts @@ -12,25 +12,25 @@ import { Garden } from "./garden" import { BuildDependencyConfig } from "./config/module" import { Module, getModuleKey } from "./types/module" import { Service } from "./types/service" -import { Workflow } from "./types/workflow" +import { Task } from "./types/task" import { TestConfig } from "./config/test" import { uniqByName } from "./util/util" -export type DependencyGraphNodeType = "build" | "service" | "workflow" | "test" +export type DependencyGraphNodeType = "build" | "service" | "task" | "test" | "push" | "publish" // these two types are currently not represented in DependencyGraph // The primary output type (for dependencies and dependants). export type DependencyRelations = { build: Module[], service: Service[], - workflow: Workflow[], + task: Task[], test: TestConfig[], } type DependencyRelationNames = { build: string[], service: string[], - workflow: string[], + task: string[], test: string[], } @@ -41,27 +41,27 @@ export class DependencyGraph { index: { [key: string]: DependencyGraphNode } private garden: Garden private serviceMap: { [key: string]: Service } - private workflowMap: { [key: string]: Workflow } + private taskMap: { [key: string]: Task } private testConfigMap: { [key: string]: TestConfig } private testConfigModuleMap: { [key: string]: Module } static async factory(garden: Garden) { - const { modules, services, workflows } = await Bluebird.props({ + const { modules, services, tasks } = await Bluebird.props({ modules: garden.getModules(), services: garden.getServices(), - workflows: garden.getWorkflows(), + tasks: garden.getTasks(), }) - return new DependencyGraph(garden, modules, services, workflows) + return new DependencyGraph(garden, modules, services, tasks) } - constructor(garden: Garden, modules: Module[], services: Service[], workflows: Workflow[]) { + constructor(garden: Garden, modules: Module[], services: Service[], tasks: Task[]) { this.garden = garden this.index = {} this.serviceMap = fromPairs(services.map(s => [s.name, s])) - this.workflowMap = fromPairs(workflows.map(w => [w.name, w])) + this.taskMap = fromPairs(tasks.map(w => [w.name, w])) this.testConfigMap = {} this.testConfigModuleMap = {} @@ -84,20 +84,20 @@ export class DependencyGraph { if (this.serviceMap[depName]) { this.addRelation(serviceNode, "service", depName, this.keyForModule(this.serviceMap[depName].module)) } else { - this.addRelation(serviceNode, "workflow", depName, this.keyForModule(this.workflowMap[depName].module)) + this.addRelation(serviceNode, "task", depName, this.keyForModule(this.taskMap[depName].module)) } } } - // Workflow dependencies - for (const workflowConfig of module.workflowConfigs) { - const workflowNode = this.getNode("workflow", workflowConfig.name, moduleKey) - this.addRelation(workflowNode, "build", moduleKey, moduleKey) - for (const depName of workflowConfig.dependencies) { + // Task dependencies + for (const taskConfig of module.taskConfigs) { + const taskNode = this.getNode("task", taskConfig.name, moduleKey) + this.addRelation(taskNode, "build", moduleKey, moduleKey) + for (const depName of taskConfig.dependencies) { if (this.serviceMap[depName]) { - this.addRelation(workflowNode, "service", depName, this.keyForModule(this.serviceMap[depName].module)) + this.addRelation(taskNode, "service", depName, this.keyForModule(this.serviceMap[depName].module)) } else { - this.addRelation(workflowNode, "workflow", depName, this.keyForModule(this.workflowMap[depName].module)) + this.addRelation(taskNode, "task", depName, this.keyForModule(this.taskMap[depName].module)) } } } @@ -113,7 +113,7 @@ export class DependencyGraph { if (this.serviceMap[depName]) { this.addRelation(testNode, "service", depName, this.keyForModule(this.serviceMap[depName].module)) } else { - this.addRelation(testNode, "workflow", depName, this.keyForModule(this.workflowMap[depName].module)) + this.addRelation(testNode, "task", depName, this.keyForModule(this.taskMap[depName].module)) } } } @@ -145,15 +145,15 @@ export class DependencyGraph { // Recursive. async getDependantsForModule(module: Module, filterFn?: DependencyRelationFilterFn): Promise { - const runtimeDependencies = uniq(module.serviceDependencyNames.concat(module.workflowDependencyNames)) + const runtimeDependencies = uniq(module.serviceDependencyNames.concat(module.taskDependencyNames)) const serviceNames = runtimeDependencies.filter(d => this.serviceMap[d]) - const workflowNames = runtimeDependencies.filter(d => this.workflowMap[d]) + const taskNames = runtimeDependencies.filter(d => this.taskMap[d]) return this.mergeRelations(... await Bluebird.all([ this.getDependants("build", module.name, true, filterFn), // this.getDependantsForMany("build", module.build.dependencies.map(d => d.name), true, filterFn), this.getDependantsForMany("service", serviceNames, true, filterFn), - this.getDependantsForMany("workflow", workflowNames, true, filterFn), + this.getDependantsForMany("task", taskNames, true, filterFn), ])) } @@ -189,14 +189,14 @@ export class DependencyGraph { */ async mergeRelations(...relationArr: DependencyRelations[]): Promise { const names = {} - for (const type of ["build", "service", "workflow", "test"]) { + for (const type of ["build", "service", "task", "test"]) { names[type] = uniqByName(flatten(relationArr.map(r => r[type]))).map(r => r.name) } return this.relationsFromNames({ build: names["build"], service: names["service"], - workflow: names["workflow"], + task: names["task"], test: names["test"], }) } @@ -205,7 +205,7 @@ export class DependencyGraph { const moduleNames = uniq(flatten([ relations.build, relations.service.map(s => s.module), - relations.workflow.map(w => w.module), + relations.task.map(w => w.module), relations.test.map(t => this.testConfigModuleMap[t.name]), ]).map(m => m.name)) // We call getModules to ensure that the returned modules have up-to-date versions. @@ -216,7 +216,7 @@ export class DependencyGraph { return this.relationsFromNames({ build: this.uniqueNames(nodes, "build"), service: this.uniqueNames(nodes, "service"), - workflow: this.uniqueNames(nodes, "workflow"), + task: this.uniqueNames(nodes, "task"), test: this.uniqueNames(nodes, "test"), }) } @@ -225,7 +225,7 @@ export class DependencyGraph { return Bluebird.props({ build: this.garden.getModules(names.build), service: this.garden.getServices(names.service), - workflow: this.garden.getWorkflows(names.workflow), + task: this.garden.getTasks(names.task), test: Object.values(pick(this.testConfigMap, names.test)), }) } diff --git a/garden-service/src/garden.ts b/garden-service/src/garden.ts index e82aff654c..270f69f0bd 100644 --- a/garden-service/src/garden.ts +++ b/garden-service/src/garden.ts @@ -86,7 +86,7 @@ import { } from "./types/plugin/plugin" import { joiIdentifier, validate } from "./config/common" import { Service } from "./types/service" -import { Workflow } from "./types/workflow" +import { Task } from "./types/task" import { resolveTemplateStrings } from "./template-string" import { configSchema, @@ -159,7 +159,7 @@ export class Garden { private modulesScanned: boolean private readonly registeredPlugins: { [key: string]: PluginFactory } private readonly serviceNameIndex: { [key: string]: string } // service name -> module name - private readonly workflowNameIndex: { [key: string]: string } // workflow name -> module name + private readonly taskNameIndex: { [key: string]: string } // task name -> module name private readonly hotReloadScheduler: HotReloadScheduler private readonly taskGraph: TaskGraph @@ -197,7 +197,7 @@ export class Garden { this.moduleConfigs = {} this.serviceNameIndex = {} - this.workflowNameIndex = {} + this.taskNameIndex = {} this.loadedPlugins = {} this.registeredPlugins = {} this.actionHandlers = fromPairs(pluginActionNames.map(n => [n, {}])) @@ -585,7 +585,7 @@ export class Garden { } /** - * Given the provided lists of build and runtime (service/workflow) dependencies, return a list of all + * Given the provided lists of build and runtime (service/task) dependencies, return a list of all * modules required to satisfy those dependencies. */ async resolveDependencyModules( @@ -595,15 +595,15 @@ export class Garden { const dg = await this.getDependencyGraph() const serviceNames = runtimeDependencies.filter(d => this.serviceNameIndex[d]) - const workflowNames = runtimeDependencies.filter(d => this.workflowNameIndex[d]) + const taskNames = runtimeDependencies.filter(d => this.taskNameIndex[d]) const buildDeps = await dg.getDependenciesForMany("build", moduleNames, true) const serviceDeps = await dg.getDependenciesForMany("service", serviceNames, true) - const workflowDeps = await dg.getDependenciesForMany("workflow", workflowNames, true) + const taskDeps = await dg.getDependenciesForMany("task", taskNames, true) const modules = [ ...(await this.getModules(moduleNames)), - ...(await dg.modulesForRelations(await dg.mergeRelations(buildDeps, serviceDeps, workflowDeps))), + ...(await dg.modulesForRelations(await dg.mergeRelations(buildDeps, serviceDeps, taskDeps))), ] return sortBy(uniqByName(modules), "name") @@ -638,19 +638,19 @@ export class Garden { return version } - async getServiceOrWorkflow(name: string, noScan?: boolean): Promise | Workflow> { + async getServiceOrTask(name: string, noScan?: boolean): Promise | Task> { const service = (await this.getServices([name], noScan))[0] - const workflow = (await this.getWorkflows([name], noScan))[0] + const task = (await this.getTasks([name], noScan))[0] - if (!service && !workflow) { + if (!service && !task) { throw new ParameterError(`Could not find service or task named ${name}`, { missing: [name], availableServices: Object.keys(this.serviceNameIndex), - availableWorkflows: Object.keys(this.workflowNameIndex), + availableTasks: Object.keys(this.taskNameIndex), }) } - return service || workflow + return service || task } /** @@ -669,65 +669,65 @@ export class Garden { return service } - async getWorkflow(name: string, noScan?: boolean): Promise { - const workflow = (await this.getWorkflows([name], noScan))[0] + async getTask(name: string, noScan?: boolean): Promise { + const task = (await this.getTasks([name], noScan))[0] - if (!workflow) { + if (!task) { throw new ParameterError(`Could not find task ${name}`, { missing: [name], - available: Object.keys(this.workflowNameIndex), + available: Object.keys(this.taskNameIndex), }) } - return workflow + return task } /* Returns all services that are registered in this context, or the ones specified. - If the names parameter is used and workflow names are included in it, they will be + If the names parameter is used and task names are included in it, they will be ignored. Scans for modules and services in the project root if it hasn't already been done. */ async getServices(names?: string[], noScan?: boolean): Promise { - const services = (await this.getServicesAndWorkflows(names, noScan)).services + const services = (await this.getServicesAndTasks(names, noScan)).services if (names) { - const workflowNames = Object.keys(this.workflowNameIndex) - throwOnMissingNames(difference(names, workflowNames), services, "service") + const taskNames = Object.keys(this.taskNameIndex) + throwOnMissingNames(difference(names, taskNames), services, "service") } return services } /* - Returns all workflows that are registered in this context, or the ones specified. + Returns all tasks that are registered in this context, or the ones specified. If the names parameter is used and service names are included in it, they will be ignored. Scans for modules and services in the project root if it hasn't already been done. */ - async getWorkflows(names?: string[], noScan?: boolean): Promise { - const workflows = (await this.getServicesAndWorkflows(names, noScan)).workflows + async getTasks(names?: string[], noScan?: boolean): Promise { + const tasks = (await this.getServicesAndTasks(names, noScan)).tasks if (names) { const serviceNames = Object.keys(this.serviceNameIndex) - throwOnMissingNames(difference(names, serviceNames), workflows, "task") + throwOnMissingNames(difference(names, serviceNames), tasks, "task") } - return workflows + return tasks } - async getServicesAndWorkflows(names?: string[], noScan?: boolean) { + async getServicesAndTasks(names?: string[], noScan?: boolean) { if (!this.modulesScanned && !noScan) { await this.scanModules() } let pickedServices: { [key: string]: string } - let pickedWorkflows: { [key: string]: string } + let pickedTasks: { [key: string]: string } if (names) { const serviceNames = Object.keys(this.serviceNameIndex) - const workflowNames = Object.keys(this.workflowNameIndex) + const taskNames = Object.keys(this.taskNameIndex) pickedServices = pick(this.serviceNameIndex, intersection(names, serviceNames)) - pickedWorkflows = pick(this.workflowNameIndex, intersection(names, workflowNames)) + pickedTasks = pick(this.taskNameIndex, intersection(names, taskNames)) } else { pickedServices = this.serviceNameIndex - pickedWorkflows = this.workflowNameIndex + pickedTasks = this.taskNameIndex } return Bluebird.props({ @@ -747,14 +747,14 @@ export class Garden { }), - workflows: Bluebird.map(Object.entries(pickedWorkflows), async ([workflowName, moduleName]): - Promise => { + tasks: Bluebird.map(Object.entries(pickedTasks), async ([taskName, moduleName]): + Promise => { const module = await this.getModule(moduleName) - const config = findByName(module.workflowConfigs, workflowName)! + const config = findByName(module.taskConfigs, taskName)! return { - name: workflowName, + name: taskName, config, module, spec: config.spec, @@ -829,13 +829,13 @@ export class Garden { } private async detectCircularDependencies() { - const { modules, services, workflows } = await Bluebird.props({ + const { modules, services, tasks } = await Bluebird.props({ modules: this.getModules(), services: this.getServices(), - workflows: this.getWorkflows(), + tasks: this.getTasks(), }) - return detectCircularDependencies(modules, services, workflows) + return detectCircularDependencies(modules, services, tasks) } /* @@ -883,37 +883,37 @@ export class Garden { this.serviceNameIndex[serviceName] = config.name } - // Add to workflow-module map - for (const workflowConfig of config.workflowConfigs) { - const workflowName = workflowConfig.name + // Add to task-module map + for (const taskConfig of config.taskConfigs) { + const taskName = taskConfig.name if (!force) { - if (this.serviceNameIndex[workflowName]) { + if (this.serviceNameIndex[taskName]) { throw new ConfigurationError(deline` - Service and task names must be mutually unique - the task name ${workflowName} (declared in - '${config.name}') is also declared as a service name in '${this.serviceNameIndex[workflowName]}'`, + Service and task names must be mutually unique - the task name ${taskName} (declared in + '${config.name}') is also declared as a service name in '${this.serviceNameIndex[taskName]}'`, { - conflictingName: workflowName, + conflictingName: taskName, moduleA: config.name, - moduleB: this.serviceNameIndex[workflowName], + moduleB: this.serviceNameIndex[taskName], }) } - if (this.workflowNameIndex[workflowName]) { + if (this.taskNameIndex[taskName]) { throw new ConfigurationError(deline` - Task names must be unique - the task name ${workflowName} is declared multiple times (in - '${this.workflowNameIndex[workflowName]}' and '${config.name}')`, + Task names must be unique - the task name ${taskName} is declared multiple times (in + '${this.taskNameIndex[taskName]}' and '${config.name}')`, { - taskName: workflowName, + taskName, moduleA: config.name, - moduleB: this.serviceNameIndex[workflowName], + moduleB: this.serviceNameIndex[taskName], }) } } - this.workflowNameIndex[workflowName] = config.name + this.taskNameIndex[taskName] = config.name } diff --git a/garden-service/src/plugins/container.ts b/garden-service/src/plugins/container.ts index e2e0f21bb7..6e30ae1fa2 100644 --- a/garden-service/src/plugins/container.ts +++ b/garden-service/src/plugins/container.ts @@ -42,8 +42,8 @@ import { keyBy } from "lodash" import { genericTestSchema, GenericTestSpec, - GenericWorkflowSpec, - genericWorkflowSpecSchema, + GenericTaskSpec, + genericTaskSpecSchema, } from "./generic" import { ModuleSpec, ModuleConfig } from "../config/module" import { BaseServiceSpec, ServiceConfig, baseServiceSchema } from "../config/service" @@ -260,11 +260,11 @@ export interface ContainerTestSpec extends GenericTestSpec { } export const containerTestSchema = genericTestSchema -export interface ContainerWorkflowSpec extends GenericWorkflowSpec { +export interface ContainerTaskSpec extends GenericTaskSpec { command: string[], } -export const containerWorkflowSchema = genericWorkflowSpecSchema +export const containerTaskSchema = genericTaskSpecSchema .keys({ command: Joi.array().items(Joi.string()) .description("The command that the task should run inside the container."), @@ -277,7 +277,7 @@ export interface ContainerModuleSpec extends ModuleSpec { hotReload?: HotReloadConfigSpec, services: ContainerServiceSpec[], tests: ContainerTestSpec[], - tasks: ContainerWorkflowSpec[], + tasks: ContainerTaskSpec[], } export type ContainerModuleConfig = ModuleConfig @@ -305,8 +305,8 @@ export const containerModuleSpecSchema = Joi.object() .description("The list of services to deploy from this container module."), tests: joiArray(containerTestSchema) .description("A list of tests to run in the module."), - // We use the user-facing term "tasks" as the key here, instead of "workflows". - tasks: joiArray(containerWorkflowSchema) + // We use the user-facing term "tasks" as the key here, instead of "tasks". + tasks: joiArray(containerTaskSchema) .description(deline` A list of tasks that can be run from this container module. These can be used as dependencies for services (executed before the service is deployed) or for other tasks. @@ -525,7 +525,7 @@ export async function validateContainerModule({ moduleConfig }: ValidateModulePa timeout: t.timeout, })) - moduleConfig.workflowConfigs = moduleConfig.spec.tasks.map(t => ({ + moduleConfig.taskConfigs = moduleConfig.spec.tasks.map(t => ({ name: t.name, dependencies: t.dependencies, spec: t, diff --git a/garden-service/src/plugins/generic.ts b/garden-service/src/plugins/generic.ts index faf277441f..936ba0c317 100644 --- a/garden-service/src/plugins/generic.ts +++ b/garden-service/src/plugins/generic.ts @@ -22,13 +22,13 @@ import { BuildResult, BuildStatus, ValidateModuleResult, - TestResult, WorkflowStatus, RunWorkflowResult, + TestResult, TaskStatus, RunTaskResult, } from "../types/plugin/outputs" import { BuildModuleParams, GetBuildStatusParams, ValidateModuleParams, - TestModuleParams, RunWorkflowParams, + TestModuleParams, RunTaskParams, } from "../types/plugin/params" import { BaseServiceSpec } from "../config/service" import { BaseTestSpec, baseTestSpecSchema } from "../config/test" @@ -36,7 +36,7 @@ import { readModuleVersionFile, writeModuleVersionFile, ModuleVersion } from ".. import { GARDEN_BUILD_VERSION_FILENAME } from "../constants" import { ModuleSpec, ModuleConfig } from "../config/module" import execa = require("execa") -import { BaseWorkflowSpec, baseWorkflowSpecSchema } from "../config/workflow" +import { BaseTaskSpec, baseTaskSpecSchema } from "../config/task" export const name = "generic" @@ -53,11 +53,11 @@ export const genericTestSchema = baseTestSpecSchema }) .description("The test specification of a generic module.") -export interface GenericWorkflowSpec extends BaseWorkflowSpec { +export interface GenericTaskSpec extends BaseTaskSpec { command: string[], } -export const genericWorkflowSpecSchema = baseWorkflowSpecSchema +export const genericTaskSpecSchema = baseTaskSpecSchema .keys({ command: Joi.array().items(Joi.string()) .description("The command to run in the module build context."), @@ -167,15 +167,15 @@ export async function testGenericModule({ module, testConfig }: TestModuleParams } } -export async function runGenericWorkflow(params: RunWorkflowParams): Promise { - const { workflow } = params - const module = workflow.module - const command = workflow.spec.command +export async function runGenericTask(params: RunTaskParams): Promise { + const { task } = params + const module = task.module + const command = task.spec.command const startedAt = new Date() const result = { moduleName: module.name, - workflowName: workflow.name, + taskName: task.name, command, version: module.version, success: true, @@ -198,10 +198,10 @@ export async function runGenericWorkflow(params: RunWorkflowParams): Promise{ ...result } + return { ...result } } -export async function getGenericWorkflowStatus(): Promise { +export async function getGenericTaskStatus(): Promise { return { done: false } } @@ -211,7 +211,7 @@ export const genericPlugin: GardenPlugin = { validate: parseGenericModule, getBuildStatus: getGenericModuleBuildStatus, build: buildGenericModule, - runWorkflow: runGenericWorkflow, + runTask: runGenericTask, testModule: testGenericModule, }, }, diff --git a/garden-service/src/plugins/kubernetes/actions.ts b/garden-service/src/plugins/kubernetes/actions.ts index d5680fe29d..1a51b59e7c 100644 --- a/garden-service/src/plugins/kubernetes/actions.ts +++ b/garden-service/src/plugins/kubernetes/actions.ts @@ -24,7 +24,7 @@ import { TestModuleParams, DeleteServiceParams, RunServiceParams, - RunWorkflowParams, + RunTaskParams, } from "../../types/plugin/params" import { ModuleVersion } from "../../vcs/base" import { ContainerModule, helpers, validateContainerModule } from "../container" @@ -237,9 +237,9 @@ export async function runService( }) } -export async function runWorkflow( - { ctx, workflow, interactive, runtimeContext, logEntry, buildDependencies }: - RunWorkflowParams, +export async function runTask( + { ctx, task, interactive, runtimeContext, logEntry, buildDependencies }: + RunTaskParams, ) { const result = await runModule({ ctx, @@ -247,15 +247,15 @@ export async function runWorkflow( interactive, logEntry, runtimeContext, - module: workflow.module, - command: workflow.spec.command || [], + module: task.module, + command: task.spec.command || [], ignoreError: false, - timeout: workflow.spec.timeout || 9999, + timeout: task.spec.timeout || 9999, }) return { ...result, - workflowName: workflow.name, + taskName: task.name, } } diff --git a/garden-service/src/plugins/kubernetes/kubernetes.ts b/garden-service/src/plugins/kubernetes/kubernetes.ts index a9f6171764..23036d7fba 100644 --- a/garden-service/src/plugins/kubernetes/kubernetes.ts +++ b/garden-service/src/plugins/kubernetes/kubernetes.ts @@ -16,7 +16,7 @@ import { } from "../../config/common" import { GardenPlugin } from "../../types/plugin/plugin" import { Provider, providerConfigBaseSchema, ProviderConfig } from "../../config/project" -import { getGenericWorkflowStatus } from "../generic" +import { getGenericTaskStatus } from "../generic" import { deleteService, execInService, @@ -27,7 +27,7 @@ import { testModule, runModule, runService, - runWorkflow, + runTask, } from "./actions" import { deployContainerService, getContainerServiceStatus, pushModule } from "./deployment" import { helmHandlers } from "./helm" @@ -173,7 +173,7 @@ export function gardenPlugin({ config }: { config: KubernetesConfig }): GardenPl container: { getServiceStatus: getContainerServiceStatus, deployService: deployContainerService, - getWorkflowStatus: getGenericWorkflowStatus, + getTaskStatus: getGenericTaskStatus, deleteService, getServiceOutputs, execInService, @@ -182,7 +182,7 @@ export function gardenPlugin({ config }: { config: KubernetesConfig }): GardenPl hotReload, testModule, runService, - runWorkflow, + runTask, getTestResult, getServiceLogs, }, diff --git a/garden-service/src/plugins/local/local-google-cloud-functions.ts b/garden-service/src/plugins/local/local-google-cloud-functions.ts index 84f9c2ee15..3323cd8854 100644 --- a/garden-service/src/plugins/local/local-google-cloud-functions.ts +++ b/garden-service/src/plugins/local/local-google-cloud-functions.ts @@ -102,7 +102,7 @@ export const gardenPlugin = (): GardenPlugin => ({ }, serviceConfigs, - workflowConfigs: [], + taskConfigs: [], testConfigs: parsed.testConfigs, } }, diff --git a/garden-service/src/tasks/deploy.ts b/garden-service/src/tasks/deploy.ts index 4dea20328e..02efc225af 100644 --- a/garden-service/src/tasks/deploy.ts +++ b/garden-service/src/tasks/deploy.ts @@ -18,7 +18,7 @@ import { } from "../types/service" import { Garden } from "../garden" import { PushTask } from "./push" -import { WorkflowTask } from "./workflow" +import { TaskTask } from "./task" import { DependencyGraphNodeType } from "../dependency-graph" // import { BuildTask } from "./build" @@ -75,9 +75,9 @@ export class DeployTask extends BaseTask { if (this.fromWatch && includes(this.hotReloadServiceNames, this.service.name)) { return deployTasks } else { - const workflowTasks = deps.workflow.map(workflow => { - return new WorkflowTask({ - workflow, + const taskTasks = deps.task.map(task => { + return new TaskTask({ + task, garden: this.garden, force: false, forceBuild: this.forceBuild, @@ -96,8 +96,8 @@ export class DeployTask extends BaseTask { hotReloadServiceNames: this.hotReloadServiceNames, }) - // return [ ...deployTasks, ...workflowTasks, buildTask] - return [...deployTasks, ...workflowTasks, pushTask] + // return [ ...deployTasks, ...taskTasks, buildTask] + return [...deployTasks, ...taskTasks, pushTask] } } diff --git a/garden-service/src/tasks/helpers.ts b/garden-service/src/tasks/helpers.ts index cb4b9d79d5..953ad404cb 100644 --- a/garden-service/src/tasks/helpers.ts +++ b/garden-service/src/tasks/helpers.ts @@ -9,11 +9,11 @@ import { flatten, intersection } from "lodash" import { DeployTask } from "./deploy" import { BuildTask } from "./build" -import { WorkflowTask } from "./workflow" +import { TaskTask } from "./task" import { Garden } from "../garden" import { Module } from "../types/module" import { Service } from "../types/service" -import { Workflow } from "../types/workflow" +import { Task } from "../types/task" import { DependencyGraphNode } from "../dependency-graph" export async function getTasksForModule( @@ -28,12 +28,12 @@ export async function getTasksForModule( let buildTasks: BuildTask[] = [] let dependantBuildModules: Module[] = [] let services: Service[] = [] - let workflows: Workflow[] = [] + let tasks: Task[] = [] if (!includeDependants) { buildTasks.push(new BuildTask({ garden, module, force: true, fromWatch, hotReloadServiceNames })) services = module.services - workflows = module.workflows + tasks = module.tasks } else { const hotReloadModuleNames = await getHotReloadModuleNames(garden, hotReloadServiceNames) const dg = await garden.getDependencyGraph() @@ -48,13 +48,13 @@ export async function getTasksForModule( dependantBuildModules = serviceDeps.build services = serviceDeps.service - workflows = serviceDeps.workflow + tasks = serviceDeps.task } else { const dependants = await dg.getDependantsForModule(module, dependantFilterFn) buildTasks.push(new BuildTask({ garden, module, force: true, fromWatch, hotReloadServiceNames })) dependantBuildModules = dependants.build services = module.services.concat(dependants.service) - workflows = module.workflows.concat(dependants.workflow) + tasks = module.tasks.concat(dependants.task) } } @@ -64,10 +64,10 @@ export async function getTasksForModule( const deployTasks = services .map(service => new DeployTask({ garden, service, force, forceBuild, fromWatch, hotReloadServiceNames })) - const workflowTasks = workflows - .map(workflow => new WorkflowTask({ garden, workflow, force, forceBuild })) + const taskTasks = tasks + .map(task => new TaskTask({ garden, task, force, forceBuild })) - return [...buildTasks, ...deployTasks, ...workflowTasks] + return [...buildTasks, ...deployTasks, ...taskTasks] } diff --git a/garden-service/src/tasks/workflow.ts b/garden-service/src/tasks/task.ts similarity index 68% rename from garden-service/src/tasks/workflow.ts rename to garden-service/src/tasks/task.ts index 3a8c0ba302..0a82d033ee 100644 --- a/garden-service/src/tasks/workflow.ts +++ b/garden-service/src/tasks/task.ts @@ -9,32 +9,32 @@ import chalk from "chalk" import { BaseTask } from "../tasks/base" import { Garden } from "../garden" -import { Workflow } from "../types/workflow" +import { Task } from "../types/task" import { BuildTask } from "./build" import { DeployTask } from "./deploy" import { LogEntry } from "../logger/log-entry" -import { RunWorkflowResult } from "../types/plugin/outputs" +import { RunTaskResult } from "../types/plugin/outputs" import { prepareRuntimeContext } from "../types/service" import { DependencyGraphNodeType } from "../dependency-graph" -export interface WorkflowTaskParams { +export interface TaskTaskParams { garden: Garden - workflow: Workflow + task: Task force: boolean forceBuild: boolean logEntry?: LogEntry } -export class WorkflowTask extends BaseTask { - type = "workflow" - depType: DependencyGraphNodeType = "workflow" +export class TaskTask extends BaseTask { // ... to be renamed soon. + type = "task" + depType: DependencyGraphNodeType = "task" - private workflow: Workflow + private task: Task private forceBuild: boolean - constructor({ garden, workflow, force, forceBuild }: WorkflowTaskParams) { - super({ garden, force, version: workflow.module.version }) - this.workflow = workflow + constructor({ garden, task, force, forceBuild }: TaskTaskParams) { + super({ garden, force, version: task.module.version }) + this.task = task this.forceBuild = forceBuild } @@ -42,7 +42,7 @@ export class WorkflowTask extends BaseTask { const buildTask = new BuildTask({ garden: this.garden, - module: this.workflow.module, + module: this.task.module, force: this.forceBuild, }) @@ -58,31 +58,31 @@ export class WorkflowTask extends BaseTask { }) }) - const workflowTasks = deps.workflow.map(workflow => { - return new WorkflowTask({ - workflow, + const taskTasks = deps.task.map(task => { + return new TaskTask({ + task, garden: this.garden, force: false, forceBuild: false, }) }) - return [buildTask, ...deployTasks, ...workflowTasks] + return [buildTask, ...deployTasks, ...taskTasks] } protected getName() { - return this.workflow.name + return this.task.name } getDescription() { - return `running task ${this.workflow.name} in module ${this.workflow.module.name}` + return `running task ${this.task.name} in module ${this.task.module.name}` } async process() { - const workflow = this.workflow - const module = workflow.module + const task = this.task + const module = task.module // combine all dependencies for all services in the module, to be sure we have all the context we need const dg = await this.garden.getDependencyGraph() @@ -90,15 +90,15 @@ export class WorkflowTask extends BaseTask { const runtimeContext = await prepareRuntimeContext(this.garden, module, serviceDeps) const logEntry = this.garden.log.info({ - section: workflow.name, + section: task.name, msg: "Running", status: "active", }) - let result: RunWorkflowResult + let result: RunTaskResult try { - result = await this.garden.actions.runWorkflow({ - workflow, + result = await this.garden.actions.runTask({ + task, logEntry, runtimeContext, interactive: false, diff --git a/garden-service/src/types/module.ts b/garden-service/src/types/module.ts index 4078d0f7bd..1575f6e8a7 100644 --- a/garden-service/src/types/module.ts +++ b/garden-service/src/types/module.ts @@ -11,8 +11,8 @@ import { getNames } from "../util/util" import { TestSpec } from "../config/test" import { ModuleSpec, ModuleConfig, moduleConfigSchema } from "../config/module" import { ServiceSpec } from "../config/service" -import { Workflow, workflowFromConfig } from "./workflow" -import { WorkflowSpec, workflowSchema } from "../config/workflow" +import { Task, taskFromConfig } from "./task" +import { TaskSpec, taskSchema } from "../config/task" import { ModuleVersion, moduleVersionSchema } from "../vcs/base" import { pathToCacheContext } from "../cache" import { Garden } from "../garden" @@ -29,7 +29,7 @@ export interface Module< M extends ModuleSpec = any, S extends ServiceSpec = any, T extends TestSpec = any, - W extends WorkflowSpec = any, + W extends TaskSpec = any, > extends ModuleConfig { buildPath: string version: ModuleVersion @@ -38,9 +38,9 @@ export interface Module< serviceNames: string[] serviceDependencyNames: string[] - workflows: Workflow>[] - workflowNames: string[] - workflowDependencyNames: string[] + tasks: Task>[] + taskNames: string[] + taskDependencyNames: string[] _ConfigType: ModuleConfig } @@ -62,13 +62,13 @@ export const moduleSchema = moduleConfigSchema serviceDependencyNames: joiArray(joiIdentifier()) .required() .description("The names of all the services and tasks that the services in this module depend on."), - workflows: joiArray(Joi.lazy(() => workflowSchema)) + tasks: joiArray(Joi.lazy(() => taskSchema)) .required() .description("A list of all the tasks that the module provides."), - workflowNames: joiArray(joiIdentifier()) + taskNames: joiArray(joiIdentifier()) .required() .description("The names of the tasks that the module provides."), - workflowDependencyNames: joiArray(joiIdentifier()) + taskDependencyNames: joiArray(joiIdentifier()) .required() .description("The names of all the tasks and services that the tasks in this module depend on."), }) @@ -94,10 +94,10 @@ export async function moduleFromConfig(garden: Garden, config: ModuleConfig): Pr .map(serviceConfig => serviceConfig.dependencies) .filter(deps => !!deps))), - workflows: [], - workflowNames: getNames(config.workflowConfigs), - workflowDependencyNames: uniq(flatten(config.workflowConfigs - .map(workflowConfig => workflowConfig.dependencies) + tasks: [], + taskNames: getNames(config.taskConfigs), + taskDependencyNames: uniq(flatten(config.taskConfigs + .map(taskConfig => taskConfig.dependencies) .filter(deps => !!deps))), _ConfigType: config, @@ -105,7 +105,7 @@ export async function moduleFromConfig(garden: Garden, config: ModuleConfig): Pr module.services = config.serviceConfigs.map(serviceConfig => serviceFromConfig(module, serviceConfig)) - module.workflows = config.workflowConfigs.map(workflowConfig => workflowFromConfig(module, workflowConfig)) + module.tasks = config.taskConfigs.map(taskConfig => taskFromConfig(module, taskConfig)) return module } diff --git a/garden-service/src/types/plugin/outputs.ts b/garden-service/src/types/plugin/outputs.ts index 679c78ea4b..231b4df856 100644 --- a/garden-service/src/types/plugin/outputs.ts +++ b/garden-service/src/types/plugin/outputs.ts @@ -141,7 +141,7 @@ export type ValidateModuleResult = T["spec"], T["serviceConfigs"][0]["spec"], T["testConfigs"][0]["spec"], - T["workflowConfigs"][0]["spec"] + T["taskConfigs"][0]["spec"] > export const validateModuleResultSchema = moduleConfigSchema @@ -254,9 +254,9 @@ export const buildStatusSchema = Joi.object() .description("Whether an up-to-date build is ready for the module."), }) -export interface RunWorkflowResult extends RunResult { +export interface RunTaskResult extends RunResult { moduleName: string - workflowName: string + taskName: string command: string[] version: ModuleVersion success: boolean @@ -265,11 +265,11 @@ export interface RunWorkflowResult extends RunResult { output: string } -export const runWorkflowResultSchema = Joi.object() +export const runTaskResultSchema = Joi.object() .keys({ moduleName: Joi.string() .description("The name of the module that the task belongs to."), - workflowName: Joi.string() + taskName: Joi.string() .description("The name of the task that was run."), command: Joi.array().items(Joi.string()) .required() @@ -290,11 +290,11 @@ export const runWorkflowResultSchema = Joi.object() .description("The output log from the run."), }) -export interface WorkflowStatus { +export interface TaskStatus { done: boolean } -export const workflowStatusSchema = Joi.object() +export const taskStatusSchema = Joi.object() .keys({ done: Joi.boolean() .required() @@ -321,9 +321,9 @@ export interface ServiceActionOutputs { runService: Promise } -export interface WorkflowActionOutputs { - getWorkflowStatus: Promise - runWorkflow: Promise +export interface TaskActionOutputs { + getTaskStatus: Promise + runTask: Promise } export interface ModuleActionOutputs extends ServiceActionOutputs { diff --git a/garden-service/src/types/plugin/params.ts b/garden-service/src/types/plugin/params.ts index 5048da07ba..b9770e56fa 100644 --- a/garden-service/src/types/plugin/params.ts +++ b/garden-service/src/types/plugin/params.ts @@ -14,11 +14,11 @@ import { ModuleVersion, moduleVersionSchema } from "../../vcs/base" import { Primitive, joiPrimitive, joiArray, joiIdentifierMap } from "../../config/common" import { Module, moduleSchema } from "../module" import { RuntimeContext, Service, serviceSchema, runtimeContextSchema } from "../service" -import { Workflow } from "../workflow" +import { Task } from "../task" import { EnvironmentStatus, ServiceLogEntry, environmentStatusSchema } from "./outputs" import { moduleConfigSchema } from "../../config/module" import { testConfigSchema } from "../../config/test" -import { workflowSchema } from "../../config/workflow" +import { taskSchema } from "../../config/task" export interface PluginActionContextParams { ctx: PluginContext @@ -61,12 +61,12 @@ const serviceActionParamsSchema = moduleActionParamsSchema service: serviceSchema, }) -export interface PluginWorkflowActionParamsBase extends PluginModuleActionParamsBase { - workflow: Workflow +export interface PluginTaskActionParamsBase extends PluginModuleActionParamsBase { + task: Task } -const workflowActionParamsSchema = moduleActionParamsSchema +const taskActionParamsSchema = moduleActionParamsSchema .keys({ - workflow: workflowSchema, + task: taskSchema, }) /** @@ -289,17 +289,17 @@ export const runServiceParamsSchema = serviceActionParamsSchema .keys(runBaseParams) /** - * Workflow actions + * Task actions */ -export interface GetWorkflowStatusParams extends PluginWorkflowActionParamsBase { } -export const getWorkflowStatusParamsSchema = workflowActionParamsSchema +export interface GetTaskStatusParams extends PluginTaskActionParamsBase { } +export const getTaskStatusParamsSchema = taskActionParamsSchema -export interface RunWorkflowParams extends PluginWorkflowActionParamsBase { +export interface RunTaskParams extends PluginTaskActionParamsBase { interactive: boolean runtimeContext: RuntimeContext timeout?: number } -export const runWorkflowParamsSchema = workflowActionParamsSchema +export const runTaskParamsSchema = taskActionParamsSchema .keys(runBaseParams) export interface ServiceActionParams { @@ -312,9 +312,9 @@ export interface ServiceActionParams { runService: RunServiceParams } -export interface WorkflowActionParams { - getWorkflowStatus: GetWorkflowStatusParams - runWorkflow: RunWorkflowParams +export interface TaskActionParams { + getTaskStatus: GetTaskStatusParams + runTask: RunTaskParams } export interface ModuleActionParams { diff --git a/garden-service/src/types/plugin/plugin.ts b/garden-service/src/types/plugin/plugin.ts index 0a346cbb1e..670cc35939 100644 --- a/garden-service/src/types/plugin/plugin.ts +++ b/garden-service/src/types/plugin/plugin.ts @@ -23,7 +23,7 @@ import { ModuleActionParams, PluginActionParams, ServiceActionParams, - WorkflowActionParams, + TaskActionParams, prepareEnvironmentParamsSchema, cleanupEnvironmentParamsSchema, getEnvironmentStatusParamsSchema, @@ -46,7 +46,7 @@ import { runModuleParamsSchema, testModuleParamsSchema, getTestResultParamsSchema, - publishModuleParamsSchema, getWorkflowStatusParamsSchema, runWorkflowParamsSchema, + publishModuleParamsSchema, getTaskStatusParamsSchema, runTaskParamsSchema, } from "./params" import { buildModuleResultSchema, @@ -66,11 +66,11 @@ import { hotReloadResultSchema, runResultSchema, ServiceActionOutputs, - WorkflowActionOutputs, + TaskActionOutputs, setSecretResultSchema, testResultSchema, validateModuleResultSchema, - publishModuleResultSchema, workflowStatusSchema, runWorkflowResultSchema, + publishModuleResultSchema, taskStatusSchema, runTaskResultSchema, } from "./outputs" export type PluginActions = { @@ -81,8 +81,8 @@ export type ServiceActions = { [P in keyof ServiceActionParams]: (params: ServiceActionParams[P]) => ServiceActionOutputs[P] } -export type WorkflowActions = { - [P in keyof WorkflowActionParams]: (params: WorkflowActionParams[P]) => WorkflowActionOutputs[P] +export type TaskActions = { + [P in keyof TaskActionParams]: (params: TaskActionParams[P]) => TaskActionOutputs[P] } export type ModuleActions = { @@ -90,11 +90,11 @@ export type ModuleActions = { } export type ModuleAndRuntimeActions = - ModuleActions & ServiceActions & WorkflowActions + ModuleActions & ServiceActions & TaskActions export type PluginActionName = keyof PluginActions export type ServiceActionName = keyof ServiceActions -export type WorkflowActionName = keyof WorkflowActions +export type TaskActionName = keyof TaskActions export type ModuleActionName = keyof ModuleActions export interface PluginActionDescription { @@ -241,28 +241,28 @@ export const serviceActionDescriptions: { [P in ServiceActionName]: PluginAction }, } -export const workflowActionDescriptions: { [P in WorkflowActionName]: PluginActionDescription } = { - getWorkflowStatus: { +export const taskActionDescriptions: { [P in TaskActionName]: PluginActionDescription } = { + getTaskStatus: { description: dedent` Check and return the execution status of a task, i.e. whether the task has been successfully completed for the module's current version. `, - paramsSchema: getWorkflowStatusParamsSchema, - resultSchema: workflowStatusSchema, + paramsSchema: getTaskStatusParamsSchema, + resultSchema: taskStatusSchema, }, - runWorkflow: { + runTask: { description: dedent` Runs a task within the context of its module. This should wait until execution completes, and should ideally attach it to the terminal (i.e. pipe the output from the task to the console, as well as pipe input from the console to the running task). `, - paramsSchema: runWorkflowParamsSchema, - resultSchema: runWorkflowResultSchema, + paramsSchema: runTaskParamsSchema, + resultSchema: runTaskResultSchema, }, } export const moduleActionDescriptions: - { [P in ModuleActionName | ServiceActionName | WorkflowActionName]: PluginActionDescription } = { + { [P in ModuleActionName | ServiceActionName | TaskActionName]: PluginActionDescription } = { // TODO: implement this method (it is currently not defined or used) describeType: { description: dedent` @@ -397,7 +397,7 @@ export const moduleActionDescriptions: ...serviceActionDescriptions, - ...workflowActionDescriptions, + ...taskActionDescriptions, } export const pluginActionNames: PluginActionName[] = Object.keys(pluginActionDescriptions) diff --git a/garden-service/src/types/workflow.ts b/garden-service/src/types/task.ts similarity index 59% rename from garden-service/src/types/workflow.ts rename to garden-service/src/types/task.ts index 32babe9540..7360eda256 100644 --- a/garden-service/src/types/workflow.ts +++ b/garden-service/src/types/task.ts @@ -7,16 +7,16 @@ */ import { Module } from "./module" -import { WorkflowConfig } from "../config/workflow" +import { TaskConfig } from "../config/task" -export interface Workflow { +export interface Task { name: string module: M - config: M["workflowConfigs"][0] - spec: M["workflowConfigs"][0]["spec"] + config: M["taskConfigs"][0] + spec: M["taskConfigs"][0]["spec"] } -export function workflowFromConfig(module: M, config: WorkflowConfig): Workflow { +export function taskFromConfig(module: M, config: TaskConfig): Task { return { name: config.name, module, diff --git a/garden-service/src/util/detectCycles.ts b/garden-service/src/util/detectCycles.ts index 35bab7401d..95016d4502 100644 --- a/garden-service/src/util/detectCycles.ts +++ b/garden-service/src/util/detectCycles.ts @@ -13,7 +13,7 @@ import { ConfigurationError, } from "../exceptions" import { Service } from "../types/service" -import { Workflow } from "../types/workflow" +import { Task } from "../types/task" export type Cycle = string[] @@ -24,7 +24,7 @@ export type Cycle = string[] Throws an error if cycles were found. */ -export async function detectCircularDependencies(modules: Module[], services: Service[], workflows: Workflow[]) { +export async function detectCircularDependencies(modules: Module[], services: Service[], tasks: Task[]) { // Sparse matrices const buildGraph = {} const runtimeGraph = {} @@ -40,24 +40,24 @@ export async function detectCircularDependencies(modules: Module[], services: Se set(buildGraph, [module.name, depName], { distance: 1, next: depName }) } - // Runtime (service & workflow) dependencies + // Runtime (service & task) dependencies for (const service of module.serviceConfigs || []) { for (const depName of service.dependencies) { set(runtimeGraph, [service.name, depName], { distance: 1, next: depName }) } } - for (const workflow of module.workflowConfigs || []) { - for (const depName of workflow.dependencies) { - set(runtimeGraph, [workflow.name, depName], { distance: 1, next: depName }) + for (const task of module.taskConfigs || []) { + for (const depName of task.dependencies) { + set(runtimeGraph, [task.name, depName], { distance: 1, next: depName }) } } } const serviceNames = services.map(s => s.name) - const workflowNames = workflows.map(w => w.name) + const taskNames = tasks.map(w => w.name) const buildCycles = detectCycles(buildGraph, modules.map(m => m.name)) - const runtimeCycles = detectCycles(runtimeGraph, serviceNames.concat(workflowNames)) + const runtimeCycles = detectCycles(runtimeGraph, serviceNames.concat(taskNames)) if (buildCycles.length > 0 || runtimeCycles.length > 0) { const detail = {} diff --git a/garden-service/test/data/test-project-a/module-a/garden.yml b/garden-service/test/data/test-project-a/module-a/garden.yml index 0fa0bda628..5ca3f64a6b 100644 --- a/garden-service/test/data/test-project-a/module-a/garden.yml +++ b/garden-service/test/data/test-project-a/module-a/garden.yml @@ -9,5 +9,5 @@ module: - name: unit command: [echo, OK] tasks: - - name: workflow-a - command: [echo, OK] \ No newline at end of file + - name: task-a + command: [echo, OK] diff --git a/garden-service/test/data/test-project-a/module-b/garden.yml b/garden-service/test/data/test-project-a/module-b/garden.yml index 7c0d20a5d5..6bd8f70222 100644 --- a/garden-service/test/data/test-project-a/module-b/garden.yml +++ b/garden-service/test/data/test-project-a/module-b/garden.yml @@ -13,5 +13,5 @@ module: - name: unit command: [echo, OK] tasks: - - name: workflow-b + - name: task-b command: [echo, OK] diff --git a/garden-service/test/data/test-project-a/module-c/garden.yml b/garden-service/test/data/test-project-a/module-c/garden.yml index c242bc611b..84ffcaaf3e 100644 --- a/garden-service/test/data/test-project-a/module-c/garden.yml +++ b/garden-service/test/data/test-project-a/module-c/garden.yml @@ -10,5 +10,5 @@ module: - name: unit command: [echo, OK] tasks: - - name: workflow-c + - name: task-c command: [echo, OK] diff --git a/garden-service/test/data/test-project-b/module-a/garden.yml b/garden-service/test/data/test-project-b/module-a/garden.yml index 5970a3ecf9..2a2a82baa0 100644 --- a/garden-service/test/data/test-project-b/module-a/garden.yml +++ b/garden-service/test/data/test-project-b/module-a/garden.yml @@ -10,11 +10,11 @@ module: - name: http containerPort: 8080 dependencies: - - workflow-a + - task-a build: command: [echo, A] tasks: - - name: workflow-a + - name: task-a command: [echo, A] dependencies: - - workflow-c \ No newline at end of file + - task-c diff --git a/garden-service/test/data/test-project-b/module-c/garden.yml b/garden-service/test/data/test-project-b/module-c/garden.yml index b3fa683519..9248f6ab9f 100644 --- a/garden-service/test/data/test-project-b/module-c/garden.yml +++ b/garden-service/test/data/test-project-b/module-c/garden.yml @@ -21,5 +21,5 @@ module: dependencies: - module-b tasks: - - name: workflow-c - command: [echo, C] \ No newline at end of file + - name: task-c + command: [echo, C] diff --git a/garden-service/test/data/test-project-container/module-a/garden.yml b/garden-service/test/data/test-project-container/module-a/garden.yml index 5d0e99a1da..66fdf0e799 100644 --- a/garden-service/test/data/test-project-container/module-a/garden.yml +++ b/garden-service/test/data/test-project-container/module-a/garden.yml @@ -12,8 +12,8 @@ module: healthCheck: tcpPort: http tasks: - - name: workflow-a + - name: task-a command: [echo, A] dependencies: - - workflow-b - - service-b \ No newline at end of file + - task-b + - service-b diff --git a/garden-service/test/helpers.ts b/garden-service/test/helpers.ts index 8203b11c3d..4cc07861c6 100644 --- a/garden-service/test/helpers.ts +++ b/garden-service/test/helpers.ts @@ -31,7 +31,7 @@ import { ValidateModuleParams, RunModuleParams, RunServiceParams, - RunWorkflowParams, + RunTaskParams, SetSecretParams, } from "../src/types/plugin/params" import { @@ -126,7 +126,7 @@ export const testPlugin: PluginFactory = (): GardenPlugin => { spec, })) - moduleConfig.workflowConfigs = moduleConfig.spec.tasks.map(t => ({ + moduleConfig.taskConfigs = moduleConfig.spec.tasks.map(t => ({ name: t.name, dependencies: t.dependencies, spec: t, @@ -163,8 +163,8 @@ export const testPlugin: PluginFactory = (): GardenPlugin => { }) }, - async runWorkflow( - { ctx, workflow, interactive, runtimeContext, logEntry, buildDependencies }: RunWorkflowParams, + async runTask( + { ctx, task, interactive, runtimeContext, logEntry, buildDependencies }: RunTaskParams, ) { const result = await runModule({ ctx, @@ -172,15 +172,15 @@ export const testPlugin: PluginFactory = (): GardenPlugin => { interactive, logEntry, runtimeContext, - module: workflow.module, - command: workflow.spec.command || [], + module: task.module, + command: task.spec.command || [], ignoreError: false, - timeout: workflow.spec.timeout || 9999, + timeout: task.spec.timeout || 9999, }) return { ...result, - workflowName: workflow.name, + taskName: task.name, } }, @@ -222,7 +222,7 @@ export const defaultModuleConfig: ModuleConfig = { }, serviceConfigs: [], testConfigs: [], - workflowConfigs: [], + taskConfigs: [], } export const makeTestModule = (params: Partial = {}) => { diff --git a/garden-service/test/src/actions.ts b/garden-service/test/src/actions.ts index 9e58d343eb..762f5b845b 100644 --- a/garden-service/test/src/actions.ts +++ b/garden-service/test/src/actions.ts @@ -7,7 +7,7 @@ import { expect } from "chai" import { omit } from "lodash" import { Module } from "../../src/types/module" import { Service } from "../../src/types/service" -import { Workflow } from "../../src/types/workflow" +import { Task } from "../../src/types/task" import Stream from "ts-stream" import { ServiceLogEntry } from "../../src/types/plugin/outputs" import { @@ -27,8 +27,8 @@ import { execInServiceParamsSchema, getServiceLogsParamsSchema, runServiceParamsSchema, - getWorkflowStatusParamsSchema, - runWorkflowParamsSchema, + getTaskStatusParamsSchema, + runTaskParamsSchema, getEnvironmentStatusParamsSchema, prepareEnvironmentParamsSchema, cleanupEnvironmentParamsSchema, @@ -45,7 +45,7 @@ describe("ActionHelper", () => { let actions: ActionHelper let module: Module let service: Service - let workflow: Workflow + let task: Task before(async () => { const plugins = { "test-plugin": testPlugin, "test-plugin-b": testPluginB } @@ -53,7 +53,7 @@ describe("ActionHelper", () => { actions = garden.actions module = await garden.getModule("module-a") service = await garden.getService("service-a") - workflow = await garden.getWorkflow("workflow-a") + task = await garden.getTask("task-a") }) // Note: The test plugins below implicitly validate input params for each of the tests @@ -312,10 +312,10 @@ describe("ActionHelper", () => { }) }) - describe("runWorkflow", () => { + describe("runTask", () => { it("should correctly call the corresponding plugin handler", async () => { - const result = await actions.runWorkflow({ - workflow, + const result = await actions.runTask({ + task, interactive: true, runtimeContext: { envVars: { FOO: "bar" }, @@ -323,14 +323,14 @@ describe("ActionHelper", () => { }, }) expect(result).to.eql({ - moduleName: workflow.module.name, - workflowName: workflow.name, + moduleName: task.module.name, + taskName: task.name, command: ["foo"], completedAt: now, output: "bla bla", success: true, startedAt: now, - version: workflow.module.version, + version: task.module.version, }) }) }) @@ -390,7 +390,7 @@ const testPlugin: PluginFactory = async () => ({ spec, })) - const workflowConfigs = (params.moduleConfig.spec.tasks || []).map(spec => ({ + const taskConfigs = (params.moduleConfig.spec.tasks || []).map(spec => ({ name: spec.name, dependencies: spec.dependencies || [], spec, @@ -399,7 +399,7 @@ const testPlugin: PluginFactory = async () => ({ return { ...params.moduleConfig, serviceConfigs, - workflowConfigs, + taskConfigs, } }, @@ -515,19 +515,19 @@ const testPlugin: PluginFactory = async () => ({ } }, - getWorkflowStatus: async (params) => { - validate(params, getWorkflowStatusParamsSchema) + getTaskStatus: async (params) => { + validate(params, getTaskStatusParamsSchema) return { done: true, } }, - runWorkflow: async (params) => { - validate(params, runWorkflowParamsSchema) - const module = params.workflow.module + runTask: async (params) => { + validate(params, runTaskParamsSchema) + const module = params.task.module return { moduleName: module.name, - workflowName: params.workflow.name, + taskName: params.task.name, command: ["foo"], completedAt: now, output: "bla bla", diff --git a/garden-service/test/src/commands/deploy.ts b/garden-service/test/src/commands/deploy.ts index b795df2f7e..087aef4f8f 100644 --- a/garden-service/test/src/commands/deploy.ts +++ b/garden-service/test/src/commands/deploy.ts @@ -10,17 +10,17 @@ import { import { DeployServiceParams, GetServiceStatusParams, - RunWorkflowParams, + RunTaskParams, } from "../../../src/types/plugin/params" import { ServiceState, ServiceStatus } from "../../../src/types/service" import { taskResultOutputs } from "../../helpers" -import { RunWorkflowResult } from "../../../src/types/plugin/outputs" +import { RunTaskResult } from "../../../src/types/plugin/outputs" const placeholderTimestamp = new Date() -const placeholderWorkflowResult = (moduleName, workflowName, command) => ({ +const placeholderTaskResult = (moduleName, taskName, command) => ({ moduleName, - workflowName, + taskName, command, version: { versionString: "1", @@ -33,8 +33,8 @@ const placeholderWorkflowResult = (moduleName, workflowName, command) => ({ output: "out", }) -const workflowResultA = placeholderWorkflowResult("module-a", "workflow-a", ["echo", "A"]) -const workflowResultC = placeholderWorkflowResult("module-c", "workflow-c", ["echo", "C"]) +const taskResultA = placeholderTaskResult("module-a", "task-a", ["echo", "A"]) +const taskResultC = placeholderTaskResult("module-c", "task-c", ["echo", "C"]) const testProvider: PluginFactory = () => { const testStatuses: { [key: string]: ServiceStatus } = { @@ -67,8 +67,8 @@ const testProvider: PluginFactory = () => { return newStatus } - const runWorkflow = async ({ workflow }: RunWorkflowParams): Promise => { - return placeholderWorkflowResult(workflow.module.name, workflow.name, workflow.spec.command) + const runTask = async ({ task }: RunTaskParams): Promise => { + return placeholderTaskResult(task.module.name, task.name, task.spec.command) } return { @@ -78,7 +78,7 @@ const testProvider: PluginFactory = () => { build: buildGenericModule, deployService, getServiceStatus, - runWorkflow, + runTask, }, }, } @@ -112,8 +112,8 @@ describe("DeployCommand", () => { "build.module-a": { fresh: true, buildLog: "A" }, "build.module-b": { fresh: true, buildLog: "B" }, "build.module-c": {}, - "workflow.workflow-a": workflowResultA, - "workflow.workflow-c": workflowResultC, + "task.task-a": taskResultA, + "task.task-c": taskResultC, "deploy.service-a": { version: "1", state: "ready" }, "deploy.service-b": { version: "1", state: "ready" }, "deploy.service-c": { version: "1", state: "ready" }, @@ -145,8 +145,8 @@ describe("DeployCommand", () => { "build.module-a": { fresh: true, buildLog: "A" }, "build.module-b": { fresh: true, buildLog: "B" }, "build.module-c": {}, - "workflow.workflow-a": workflowResultA, - "workflow.workflow-c": workflowResultC, + "task.task-a": taskResultA, + "task.task-c": taskResultC, "deploy.service-a": { version: "1", state: "ready" }, "deploy.service-b": { version: "1", state: "ready" }, "push.module-a": { pushed: false }, diff --git a/garden-service/test/src/commands/run/workflow.ts b/garden-service/test/src/commands/run/task.ts similarity index 65% rename from garden-service/test/src/commands/run/workflow.ts rename to garden-service/test/src/commands/run/task.ts index c2c6ba77c2..fd8551c2cf 100644 --- a/garden-service/test/src/commands/run/workflow.ts +++ b/garden-service/test/src/commands/run/task.ts @@ -1,17 +1,17 @@ import { expect } from "chai" import { omit } from "lodash" -import { RunWorkflowCommand } from "../../../../src/commands/run/workflow" +import { RunTaskCommand } from "../../../../src/commands/run/task" import { makeTestGardenA } from "../../../helpers" -describe("RunWorkflowCommand", () => { +describe("RunTaskCommand", () => { - it("should run a workflow", async () => { + it("should run a task", async () => { const garden = await makeTestGardenA() - const cmd = new RunWorkflowCommand() + const cmd = new RunTaskCommand() const { result } = await cmd.action({ garden, - args: { task: "workflow-a" }, + args: { task: "task-a" }, opts: { "force-build": false }, }) @@ -20,7 +20,7 @@ describe("RunWorkflowCommand", () => { moduleName: "module-a", output: "OK", success: true, - workflowName: "workflow-a", + taskName: "task-a", } const omittedKeys = ["completedAt", "startedAt", "version"] diff --git a/garden-service/test/src/config/base.ts b/garden-service/test/src/config/base.ts index 13678be6a9..708903d51f 100644 --- a/garden-service/test/src/config/base.ts +++ b/garden-service/test/src/config/base.ts @@ -54,7 +54,7 @@ describe("loadConfig", async () => { spec: { services: [{ name: "service-a" }], tasks: [{ - name: "workflow-a", + name: "task-a", command: ["echo", "OK"], }], tests: [{ @@ -64,7 +64,7 @@ describe("loadConfig", async () => { }, serviceConfigs: [], - workflowConfigs: [], + taskConfigs: [], testConfigs: [], }) }) diff --git a/garden-service/test/src/garden.ts b/garden-service/test/src/garden.ts index c2e0ebeeb6..0221a7c4b2 100644 --- a/garden-service/test/src/garden.ts +++ b/garden-service/test/src/garden.ts @@ -151,27 +151,27 @@ describe("Garden", () => { }) }) - describe("getServicesAndWorkflows", () => { - it("should scan for modules and return all registered services and workflows in the context", async () => { + describe("getServicesAndTasks", () => { + it("should scan for modules and return all registered services and tasks in the context", async () => { const garden = await makeTestGardenA() - const { services, workflows } = await garden.getServicesAndWorkflows() + const { services, tasks } = await garden.getServicesAndTasks() expect(getNames(services).sort()).to.eql(["service-a", "service-b", "service-c"]) - expect(getNames(workflows).sort()).to.eql(["workflow-a", "workflow-b", "workflow-c"]) + expect(getNames(tasks).sort()).to.eql(["task-a", "task-b", "task-c"]) }) - it("should optionally return specified services and workflows in the context", async () => { + it("should optionally return specified services and tasks in the context", async () => { const garden = await makeTestGardenA() - const { services, workflows } = await garden.getServicesAndWorkflows(["service-b", "service-c", "workflow-a"]) + const { services, tasks } = await garden.getServicesAndTasks(["service-b", "service-c", "task-a"]) expect(getNames(services).sort()).to.eql(["service-b", "service-c"]) - expect(getNames(workflows).sort()).to.eql(["workflow-a"]) + expect(getNames(tasks).sort()).to.eql(["task-a"]) }) - it("should not throw if a named service or workflow is missing", async () => { + it("should not throw if a named service or task is missing", async () => { const garden = await makeTestGardenA() - await garden.getServicesAndWorkflows(["not", "real"]) + await garden.getServicesAndTasks(["not", "real"]) }) }) @@ -227,26 +227,26 @@ describe("Garden", () => { }) }) - describe("getWorkflows", () => { - it("should scan for modules and return all registered workflows in the context", async () => { + describe("getTasks", () => { + it("should scan for modules and return all registered tasks in the context", async () => { const garden = await makeTestGardenA() - const workflows = await garden.getWorkflows() + const tasks = await garden.getTasks() - expect(getNames(workflows).sort()).to.eql(["workflow-a", "workflow-b", "workflow-c"]) + expect(getNames(tasks).sort()).to.eql(["task-a", "task-b", "task-c"]) }) - it("should optionally return specified workflows in the context", async () => { + it("should optionally return specified tasks in the context", async () => { const garden = await makeTestGardenA() - const workflows = await garden.getWorkflows(["workflow-b", "workflow-c"]) + const tasks = await garden.getTasks(["task-b", "task-c"]) - expect(getNames(workflows).sort()).to.eql(["workflow-b", "workflow-c"]) + expect(getNames(tasks).sort()).to.eql(["task-b", "task-c"]) }) - it("should throw if named workflow is missing", async () => { + it("should throw if named task is missing", async () => { const garden = await makeTestGardenA() try { - await garden.getWorkflows(["bla"]) + await garden.getTasks(["bla"]) } catch (err) { expect(err.type).to.equal("parameter") return @@ -256,19 +256,19 @@ describe("Garden", () => { }) }) - describe("getWorkflow", () => { - it("should return the specified workflow", async () => { + describe("getTask", () => { + it("should return the specified task", async () => { const garden = await makeTestGardenA() - const workflow = await garden.getWorkflow("workflow-b") + const task = await garden.getTask("task-b") - expect(workflow.name).to.equal("workflow-b") + expect(task.name).to.equal("task-b") }) - it("should throw if workflow is missing", async () => { + it("should throw if task is missing", async () => { const garden = await makeTestGardenA() try { - await garden.getWorkflows(["bla"]) + await garden.getTasks(["bla"]) } catch (err) { expect(err.type).to.equal("parameter") return @@ -278,21 +278,21 @@ describe("Garden", () => { }) }) - describe("getServiceOrWorkflow", () => { - it("should return the specified service or workflow", async () => { + describe("getServiceOrTask", () => { + it("should return the specified service or task", async () => { const garden = await makeTestGardenA() - const service = await garden.getServiceOrWorkflow("service-a") - const workflow = await garden.getServiceOrWorkflow("workflow-a") + const service = await garden.getServiceOrTask("service-a") + const task = await garden.getServiceOrTask("task-a") expect(service.name).to.equal("service-a") - expect(workflow.name).to.equal("workflow-a") + expect(task.name).to.equal("task-a") }) - it("should throw if no matching service or workflow was found", async () => { + it("should throw if no matching service or task was found", async () => { const garden = await makeTestGardenA() try { - await garden.getServiceOrWorkflow("bla") + await garden.getServiceOrTask("bla") } catch (err) { expect(err.type).to.equal("parameter") return diff --git a/garden-service/test/src/plugins/container.ts b/garden-service/test/src/plugins/container.ts index 8e06559b2a..310cccb2e8 100644 --- a/garden-service/test/src/plugins/container.ts +++ b/garden-service/test/src/plugins/container.ts @@ -49,7 +49,7 @@ describe("plugins.container", () => { }, serviceConfigs: [], - workflowConfigs: [], + taskConfigs: [], testConfigs: [], } @@ -127,7 +127,7 @@ describe("plugins.container", () => { }, serviceConfigs: [], - workflowConfigs: [], + taskConfigs: [], testConfigs: [], }) @@ -226,7 +226,7 @@ describe("plugins.container", () => { volumes: [], }], tasks: [{ - name: "workflow-a", + name: "task-a", command: ["echo", "OK"], dependencies: [], timeout: null, @@ -241,7 +241,7 @@ describe("plugins.container", () => { }, serviceConfigs: [], - workflowConfigs: [], + taskConfigs: [], testConfigs: [], } @@ -278,7 +278,7 @@ describe("plugins.container", () => { }], tasks: [{ - name: "workflow-a", + name: "task-a", command: ["echo", "OK"], dependencies: [], timeout: null, @@ -317,17 +317,17 @@ describe("plugins.container", () => { volumes: [], }, }], - workflowConfigs: + taskConfigs: [{ dependencies: [], - name: "workflow-a", + name: "task-a", spec: { command: [ "echo", "OK", ], dependencies: [], - name: "workflow-a", + name: "task-a", timeout: null, }, timeout: null, @@ -390,7 +390,7 @@ describe("plugins.container", () => { volumes: [], }], tasks: [{ - name: "workflow-a", + name: "task-a", command: ["echo"], dependencies: [], timeout: null, @@ -405,7 +405,7 @@ describe("plugins.container", () => { }, serviceConfigs: [], - workflowConfigs: [], + taskConfigs: [], testConfigs: [], } @@ -447,7 +447,7 @@ describe("plugins.container", () => { volumes: [], }], tasks: [{ - name: "workflow-a", + name: "task-a", command: ["echo"], dependencies: [], timeout: null, @@ -456,7 +456,7 @@ describe("plugins.container", () => { }, serviceConfigs: [], - workflowConfigs: [], + taskConfigs: [], testConfigs: [], } @@ -495,7 +495,7 @@ describe("plugins.container", () => { volumes: [], }], tasks: [{ - name: "workflow-a", + name: "task-a", command: ["echo"], dependencies: [], timeout: null, @@ -504,7 +504,7 @@ describe("plugins.container", () => { }, serviceConfigs: [], - workflowConfigs: [], + taskConfigs: [], testConfigs: [], } diff --git a/garden-service/test/src/plugins/kubernetes/ingress.ts b/garden-service/test/src/plugins/kubernetes/ingress.ts index 548d0dc9fc..3c0e6cba25 100644 --- a/garden-service/test/src/plugins/kubernetes/ingress.ts +++ b/garden-service/test/src/plugins/kubernetes/ingress.ts @@ -344,7 +344,7 @@ describe("createIngresses", () => { }, serviceConfigs: [], - workflowConfigs: [], + taskConfigs: [], testConfigs: [], } diff --git a/garden-service/test/src/tasks/helpers.ts b/garden-service/test/src/tasks/helpers.ts index 5c306f38a0..f80e0929c0 100644 --- a/garden-service/test/src/tasks/helpers.ts +++ b/garden-service/test/src/tasks/helpers.ts @@ -40,7 +40,7 @@ describe("TaskHelpers", () => { expect(sortedBaseKeys(tasks)).to.eql([ "build.good-morning", "deploy.good-morning", - "workflow.good-morning-task", + "task.good-morning-task", ]) expect(await sortedBaseKeysWithDependencies(tasks)).to.eql([ @@ -48,7 +48,7 @@ describe("TaskHelpers", () => { "build.good-morning", "deploy.good-morning", "push.good-morning", - "workflow.good-morning-task", + "task.good-morning-task", ].sort()) }) @@ -62,13 +62,13 @@ describe("TaskHelpers", () => { "build.good-morning", "deploy.good-morning", - "workflow.good-morning-task", + "task.good-morning-task", "build.build-dependant", "deploy.build-dependant", "deploy.service-dependant", - "workflow.dependant-task", + "task.dependant-task", ].sort(), withDependencies: [ "build.build-dependency", @@ -78,7 +78,7 @@ describe("TaskHelpers", () => { "build.good-morning", "push.good-morning", "deploy.good-morning", - "workflow.good-morning-task", + "task.good-morning-task", "build.build-dependant", "push.build-dependant", @@ -87,7 +87,7 @@ describe("TaskHelpers", () => { "build.service-dependant", "push.service-dependant", "deploy.service-dependant", - "workflow.dependant-task", + "task.dependant-task", ].sort(), }, { @@ -95,13 +95,13 @@ describe("TaskHelpers", () => { withoutDependencies: [ "build.good-morning", "deploy.good-morning", - "workflow.good-morning-task", + "task.good-morning-task", "build.build-dependant", "deploy.build-dependant", "deploy.service-dependant", - "workflow.dependant-task", + "task.dependant-task", ].sort(), withDependencies: [ "build.build-dependency", @@ -109,7 +109,7 @@ describe("TaskHelpers", () => { "build.good-morning", "push.good-morning", "deploy.good-morning", - "workflow.good-morning-task", + "task.good-morning-task", "build.build-dependant", "push.build-dependant", @@ -118,7 +118,7 @@ describe("TaskHelpers", () => { "build.service-dependant", "push.service-dependant", "deploy.service-dependant", - "workflow.dependant-task", + "task.dependant-task", ].sort(), }, { @@ -139,14 +139,14 @@ describe("TaskHelpers", () => { }, { moduleName: "service-dependant", - withoutDependencies: ["build.service-dependant", "deploy.service-dependant", "workflow.dependant-task"], + withoutDependencies: ["build.service-dependant", "deploy.service-dependant", "task.dependant-task"], withDependencies: [ "deploy.good-morning", "build.service-dependant", "push.service-dependant", "deploy.service-dependant", - "workflow.dependant-task", + "task.dependant-task", ].sort(), }, ] @@ -176,12 +176,12 @@ describe("TaskHelpers", () => { }, { moduleName: "good-morning", - withoutDependencies: ["deploy.service-dependant", "workflow.dependant-task"], + withoutDependencies: ["deploy.service-dependant", "task.dependant-task"], withDependencies: [ "build.service-dependant", "push.service-dependant", "deploy.service-dependant", - "workflow.dependant-task", + "task.dependant-task", ].sort(), }, { @@ -200,12 +200,12 @@ describe("TaskHelpers", () => { }, { moduleName: "service-dependant", - withoutDependencies: ["build.service-dependant", "deploy.service-dependant", "workflow.dependant-task"], + withoutDependencies: ["build.service-dependant", "deploy.service-dependant", "task.dependant-task"], withDependencies: [ "build.service-dependant", "push.service-dependant", "deploy.service-dependant", - "workflow.dependant-task", + "task.dependant-task", ].sort(), }, ]