Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yocaml_git never removes files #55

Open
reynir opened this issue Oct 23, 2024 · 4 comments
Open

Yocaml_git never removes files #55

reynir opened this issue Oct 23, 2024 · 4 comments

Comments

@reynir
Copy link
Contributor

reynir commented Oct 23, 2024

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?

@dinosaure
Copy link
Collaborator

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.

@gr-im
Copy link
Collaborator

gr-im commented Oct 23, 2024

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.

@xhtmlboi
Copy link
Owner

Is this lack of response satisfactory and can we close the issue @reynir?

@reynir
Copy link
Contributor Author

reynir commented Nov 1, 2024

Perhaps it can be mentioned somewhere in the documentation? Thanks for the replies

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants