GitRoot

Craft your forge // Build your project // Grow your community freely
id
41b5
priority
98
assignee
null
status
v0.6.0

Plugin-sdk wortree rework

Problem

Today, when we change a plugin conf, GitRoot make a worktree pass: go through each files and call plugin with init:worktree. After, that pass all others plugins are called with a standard diff pass.

In this context the pipeline is not good ordered and plugins making commits for other plugins is not respected.

solution

The true solution is to call all plugins in right order, give the information of confHasChanged to the plugins with a changing conf. Then all plugins, can, if they need, ask for a worktree pass with a new sdk api.

Some plugins don’t need to do that, so they can skeep that.

Some plugins could requiered a worktree even outside of a conf change, for example, silo could do that on new branch (even if a better solution for silo could be a better cache based on commits…).

Ideally, the plugin could receive previousConf and newConf to be able to decide if a worktree is really necessary (because it’s expensive and should be used only in last case).