engine icon indicating copy to clipboard operation
engine copied to clipboard

Better OTA scripts to handle modified files

Open martinratinaud opened this issue 2 years ago • 1 comments

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 avatar Oct 24 '22 15:10 martinratinaud

@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

  • use commander instead of args parsing
  • add a -m option to every script in order to launch the script only on modified files

martinratinaud avatar Oct 24 '22 15:10 martinratinaud

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

  • deleted service
  • modified history service
  • modified service
  • modified filter

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)

martinratinaud avatar Oct 27 '22 12:10 martinratinaud

Nice addition, it will simplify declarations repositories! 👍

Ndpnt avatar Oct 28 '22 08:10 Ndpnt

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.

martinratinaud avatar Oct 31 '22 05:10 martinratinaud