kalisio / krawler

A minimalist (geospatial) ETL
https://kalisio.github.io/krawler/
MIT License
54 stars 13 forks source link

Add utility functions to insert hooks in hook definitions object #269

Closed claustres closed 9 months ago

claustres commented 9 months ago

The execution order of hooks depends on the insertion order of hooks into the hook definition object. Most of the time hooks are defined and use in a single job file and this does not cause any issue. However, if you'd like to start from an existing hook definitions object (i.e. a base job) and insert additional hooks at some insertion points to customize the job it is not currently easily possible. Indeed, you should recreate a completely new definition object in order to control the right insertion order.

It should be useful to provide some utility functions to do so. Note that removing a hook does not suffer this problem as you can simply erase the key in the definition object, order does not matter here.