All notable changes to this library are documented in this file.
The format is based on Keep a Changelog, and this library adheres to Semantic Versioning as well as to Module version numbering.
2.1.0 - 2024-01-17
This release adds parallel task execution support.
- Add
Task.Parallel
to allow running tasks in parallel. - Add
middleware.BufferParallel
that helps in not getting mixed output from parallel tasks execution. - Add
Input.Parallel
to allow middlewares to have special handling for parallel tasks.
2.0.0 - 2023-02-08
This release contains many breaking changes
that are necessary to improve usability, extensibility, and customization.
You can also find new supplemental features in
goyek/x
.
- Add
DefaultFlow
which is the default flow. - Add the top-level functions such as
Define
,Main
, and so on which are wrappers for the methods ofFlow
called forDefaultFlow
. Flow.Main
now exits on receiving the second SIGINT.- Add
Flow.Print
for printing the flow usage. Flow.Main
andFlow.Execute
allow passing execution options.- Add
NoDeps
option to skip processing of all dependencies. - Add
Skip
option to skip processing of given tasks. - Add
Flow.Usage
,Flow.SetUsage
for getting and setting the function that is called when an error occurs while parsing the flow. - Add
NOOP
status report for tasks that were intentionally not run to differentiate from being skipped during execution. - Add
Flow.Use
method o support task run interception using middlewares. - Add
middleware
package withReportStatus
,SilentNonFailed
,DryRun
,ReportLongRun
middlewares. TF.Error
,TF.Errorf
,TF.Fail
may be called simultaneously from multiple goroutines.- Add
NewRunner
which can be useful for testing and debugging task actions and middlewares. - Add
Flow.Undefine
to unregister a task. - Add
DefinedTask.SetName
,DefinedTask.SetUsage
,DefinedTask.Action
,DefinedTask.SetAction
,DefinedTask.SetAction
,DefinedTask.SetDeps
to enable modifying the task after the initial definition. - Add
Flow.SetLogger
for setting a custom log decorator that is used byA
logging methods. IfLogger
implementsError
,Errorf
,Fatal
,Fatalf
,Skip
,Skipf
, they will be used by theA
equivalent methods. - Add
Flow.Logger
for getting the log decorator (CodeLineLogger
by default). - Add
CodeLineLogger
which is the default forFlow.Logger
. - Add
FmtLogger
which is the default when usingNewRunner
. - Add
A.Helper
andCodeLineLogger.Helper
methods that work like the equivalent method in thetesting
package. - Add
A.Cleanup
method that registers an action's cleanup function. - Add
A.Setenv
method that sets the environment variable and reverts the previous value during cleanup. - Add
A.TempDir
method that creates a temporary directory and removes it during cleanup.
- Rename
TF
type toA
as this is theAction
parameter. This is the most impactful breaking change. This follows the convention used in thetesting
package to name the parameter type as the first letter of the "function type". - Task status reporting is disabled by default.
It can be enabled by calling
Flow.Use(middleware.ReportStatus)
. It reportsNOOP
for a task without an action. - Usually, the task does not call
panic
directly.panic
failure message no longer contains a prefix with file and line information. The stack trace is printed instead. The behavior is based ontesting
package. RegisteredTask.Deps
returns[]string
(dependency names) for easier introspection.- Rename
Flow.Register
toFlow.Define
. - Change
Flow.RegisteredTask
toFlow.DefinedTask
. DefinedTask.Deps
returnsDeps
to facilitate reusing defined task's dependencies when creating a new one or redefining an existing one.- Change the
Flow.DefaultTask
field toFlow.SetDefault
andFlow.Default
methods. - Change
Flow.Output
field toFlow.SetOutput
setter andFlow.Output
getter. - Change
Flow.Run
toFlow.Execute
to reduce possible confusion withRunner
. Flow.Execute
returns an error instead of returning the exit code and does not print to output. It also has different arguments.Flow.Execute
accepts[]string
instead of...string
to make the API forward compatible.
- Remove parameters API and out-of-the-box flags (
-v
,-wd
). - Remove
A.Cmd
. Usegithub.com/goyek/goyek/x/cmd
or your helper instead.
- Fix panic handling so that
panic(nil)
andruntime.Goexit()
now cause task failure.
1.1.0 - 2022-10-12
This release focuses on improving output printing. There are no API changes.
- The
TF
methodsLog[f]
,Error[f]
,Fatal[f]
,Skip[f]
,panic
prints indented text with a prefix containing file and line information.
- Remove
TF.Cmd
undocumented behavior (printing command name and arguments).
1.0.0 - 2022-09-08
This is the first stable release.
0.6.3 - 2022-02-23
TaskNamePattern
andParamNamePattern
has been changed so that the plus (+
) and colon (:
) characters can be used in the task and parameter name (but not as the first character).
0.6.2 - 2022-01-25
- The
Taskflow
does not fail when it was requested to cancel, but was completed successfully.
0.6.1 - 2021-12-27
This release adds the possibility to change the defaults of the global parameters.
- Add
RegisterVerboseParam
andRegisterWorkDirParam
to overwrite default values for verbose and work dir parameters.
0.6.0 - 2021-08-02
This release contains multiple breaking changes in the Go API. It is supposed to make it cleaner.
TF.Cmd
also setsStdin
toos.Stdin
.- Add
Flow.Tasks
andFlow.Params
to allow introspection of the registered tasks and parameters.
- Rename
Taskflow
type toFlow
to simplify the naming. - Rename
Task.Command
field toAction
to avoid confusion withexec.Command
andTF.Cmd
.
- Remove
DefaultOutput
global variable. - Remove
TF.Exec
method.
0.5.0 - 2021-06-21
- Add the stack trace when a task panics.
- Names of parameters now have to follow
goyek.ParamNamePattern
. They were allowed to start with an underscore (_
), and now no longer are. - The PowerShell wrapper scripts
goyek.ps1
better handlesstderr
redirection.
0.4.0 - 2021-05-26
- Add Bash and PowerShell wrapper scripts.
- Add
-wd
global parameter allowing to change the working directory. The newTaskflow.WorkDirParam
method can be used to get its value in a task's command.
0.3.0 - 2021-05-03
The repository has been migrated from https://github.com/pellared/taskflow to https://github.com/goyek/goyek.
This release contains multiple breaking changes for both the CLI and the Go API.
The biggest change is a redesign of the parameters API, so they have to be explicitly registered. It makes the usage of the parameters more controlled and provides a better help output. Moreover, the parameters are set via CLI using the flag syntax.
- Help is printed when
-h
,--help
orhelp
is passed. - Help contains parameters' information.
- The tasks and parameters can be passed via CLI in any order.
Taskflow.Run
handlesnil
passed ascontext.Context
argument.Taskflow.Run
panics when a registered parameter is not assigned to any task.
- Module path changed from
github.com/pellared/taskflow
togithub.com/goyek/goyek
. - Rename package
task
togoyek
. - Use the flag syntax for setting parameters via CLI.
- Rename
Task.Description
field toUsage
. - Rename
Task.Dependencies
field toDeps
. - Rename
CodeFailure
constant toCodeFail
. - Rename
Taskflow.MustRegister
method toRegister
and remove previousTaskflow.Register
implementation. - Remove
Taskflow.Params
field andTF.Params
method, addTaskflow.Register*Param
methods andTask.Params
field instead. - Remove
TF.Verbose
, addTaskflow.VerboseParam
instead. - Unexport
Runner
type, useTaskflow
in tests instead. - Enforce patterns for task names (
TaskNamePattern
) and parameter names (ParamNamePattern
).
- Remove
New
function, create instance using&Taskflow{}
instead. - Drop official support for Go 1.10.
0.2.0 - 2021-03-14
- Add the possibility to set a default task.
0.1.1 - 2021-02-28
- Make concurrent printing thread-safe.
0.1.0 - 2021-01-14
- First release version after the experiential phase.