Yocaml_git never removes files
We have a setup where we previously generated files tags/{{ tag }}.html. Now, after refactoring, we generate a single tags.html file. However, when using Yocaml_git the tags/ directory and its children are still present in the git tree. In other words, if a run using Yocaml_git no longer generates a file it will still be present. Is this the expected behavior? What should we do about files we don't generate anymore? An explicit delete?
An explicit delete?
From my point of view, it's currently the only valid way to clean-up the Git repository. The YOCaml engine just add or set files, it never remove anything (and it does not know something about the "previous" state of Git). We can think about something like an append-only store.
This is a question that was asked a lot after the release of
version 1 of YOCaml. One of the proposals was to use a
Writer Monad to track the files to be built and then
use a diff with the generated filetree to purge unnecessary
files. The problem with this approach is that it causes problems in
several scenarios :/
What's more, with the dynamic dependency model (and the fact that a
Task can produce files), it makes the metrics for the
artefacts created quite tricky. So for the moment, we're using the
legendary ostrich approach, pretend nothing's happened and let the user deal with the
let the user deal with the problem of orphan artefacts, in particular by not
orphan artefacts, in particular by simply not linking to them from a
collection of pages produced. In practice, building a
YOCaml site in the CI is very costly because you have to re-download the
dependencies and therefore keep the minimality calculation for the
(via the local server) and deleting the state each time it is
reconstruction seems the most reasonable proposal.
Is this lack of response satisfactory and can we close the issue @reynir?
Perhaps it can be mentioned somewhere in the documentation? Thanks for the replies