-
Notifications
You must be signed in to change notification settings - Fork 22
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
RFC: command hooks in cooker #123
Comments
First of all I totally agree with the need for refactoring and splitting the Concerning the hooks, I think that items-oriented sub-commands (
Now, where will the hooks lie? Do we had a default How to specify the high-level hooks that are global for a sub-command.
|
Fetch? The cooker-command for that is update.
In this example the very first time pre-fetch (
Hooks cannot be fetched, they have to live alongside the menu-file, reachable without any other command issued by cooker. But! If we add an init-hook, only the init-hook-script has to be next to the menu, this script could get the other hook from somewhere. Relative paths are OK for me.
This would make We also need to specify which arguments are passed to each hook. |
If we inspire us by git, its hooks are just files with a filename. If we chose this, then no changes are needed for the menu at all, but during The hook Here's the complete list:
Do we need a global pre/post-build and pre/post/generate? |
Yes, sorry, it was late...
The hook scripts have to be robust, and fail only in critical situations. If a hook fails, Cooker stops its action, that's all.
Seems a bit complicated (but hooks are not easy beasts).
The |
Using pre-defined names for the hooks sounds really interesting, it would be very light for the menu. |
I like the idea that depending on local configuration (the This could be a way to handle an old issue (site specific setting) without adding any configuration file (cf. #95) |
Before starting to hack around in the code individually, we should specify what we expect and how hooks should be configured and used in cooker.
I start with some questions:
Shall a hook be called
pre-<cmd>
andpost-<cmd>
where cmd is one of thelow-level
-commands of cooker (i.e.:init
,update
,generate
,build
)? Is this finely grained enough? Should we havelocal-conf-generate-pre/post-hook
andbblayers.conf-generate-hook
instead of a singlegenerate-hook
?For commands which have items (layers/sources, builds) is the pre and post-hook called for each of them?
In what way do we configure a hook in the menu? Is there a special-section
hooks
or does each item has apre-hook
/post-hook
?generate
andinit
will be at global scope.IMO, cooker would need a refactoring to include this kind of feature: splitting the file into classes, trying to integrate coverage-tests by using unit-tests (+ the existing functional tests).
The text was updated successfully, but these errors were encountered: