turbo
turbo copied to clipboard
Emit pipeline events to javascript callback functions
Describe the feature you'd like to request
We want to perform some actions whenever a task is started, finished or has failed. Concretely, we want to send some REST requests to GitHub to update PR action statuses.
Describe the solution you'd like
Add an option to turbo.json
referencing a javascript module via a path relative to the repository root. This module should export one or more callback functions that are called on all these events and may return promises if doing async stuff.
Events should be emitted least on global (pipeline starts/ends (succeeding or failing)) and on task level, parameterized with pipeline and task metadata.
Describe alternatives you've considered
Wrapping the commands we trigger in our package scripts.
I think the plan is to use the turbo daemon to allow to script Turborepo
This likely isn't a feature that we will pursue. Turborepo's ethos is to keep things simple and this sounds like it could introduce more footguns, complications, and confusion for users rather than empowerment.
I will say this data is valuable, though, and we're thinking about ways to make it actionable. The design proposed here, though, is likely not what you'd end up seeing in the end.