OpenTermsArchive / engine

Tracks contractual documents and exposes changes to the terms of online services.
https://opentermsarchive.org
European Union Public License 1.2
111 stars 30 forks source link

Better OTA scripts to handle modified files #958

Closed martinratinaud closed 1 year ago

martinratinaud commented 1 year ago

For now there is a very complicated bash command in all declaration repositories to run lint test and track

All this complexity can be handled directly in the scripts and this is waht this PR does

martinratinaud commented 1 year ago

@Ndpnt please validate the concept of this PR so that I can go on with it tomorrow for track and test command.

Idea here is to

martinratinaud commented 1 year ago

This PR has been revamped after discussion with @Ndpnt

I created a branch in sandbox-declarations in order to test this behavior https://github.com/OpenTermsArchive/sandbox-declarations/pull/149

It handles cases like

When this PR is accepted and the one on sandbox also, a PR like this one should be done on all instances.

Let's note here that the process of updating multiple instances everytime a script changes is somehow cumbersome and we should definitely begin thinking about a new repo like declarations-tools which could be installed globally.

This would remove the need for a package.json in the declarations repo (except in those which need filtering)

Ndpnt commented 1 year ago

Nice addition, it will simplify declarations repositories! 👍

martinratinaud commented 1 year ago

For consistency, also move track command description in ./bin/track.js, remove src/main.js and update npm start script in package.json.

For this I'd like to postpone this until you come back @Ndpnt.

Indeed, I'm still not quite sure I understand correctly how config.util.setModuleDefaults works, but it seems that if I do so, it will override the corresponding defaults from config/default.json and thus make all instance repositories to not work anymore as they rely for example on services/declarationsPath which would be not accurate anymore.