First customer pain point pull request - default-hook

Nate Finch nate.finch at canonical.com
Wed Aug 20 20:05:23 UTC 2014


I think to answer most of these questions, we need more information about
what the existing charms do, and input from the charmers themselves.

Here's the info from Marco: http://pastebin.ubuntu.com/8100649/

The first column is the name of the charm, further columns are the concrete
files that have symlinks pointing to them.  He said that the ones that have
relation in the name of the concrete file are the ones that only use
symlinks to deal with relation hooks, so are only partially symlinked, the
rest use all symlinks to a single file.

Note this does not include trusty charms.

Numbers:

56/162 charms use symlinks
6 of those are only partially symlinked
50 of those use symlinks for all hooks



On Wed, Aug 20, 2014 at 2:58 PM, Gustavo Niemeyer <gustavo at niemeyer.net>
wrote:

> On Wed, Aug 20, 2014 at 3:45 PM, Nate Finch <nate.finch at canonical.com>
> wrote:
> > Here's a proposal that is much simpler: we add a flag to the charm
> metadata,
> > called something like "single_hook".  When single_hook is true, all hook
> > events run a file called "default-hook" (or whatever we want to call it,
> I
> > don't really care).  $JUJU_HOOK_NAME will be set with the name of the
> hook
> > that is running.  That's it.  What the charm authors do after the hook
> file
> > gets run is up to them.
>
> That sounds reasonable. We could make both the hook name and the charm
> metadata flag be "single-hook".
>
> But does it solve people's problems?  Would people that today use half
> of the hooks symlinked and half of them without symlinks transition to
> that model, or is symlinking more convenient?  What about people using
> charm helpers without a dispatch table, such as the case Aaron raised
> in this thread?  Their charms would be broken (or will eventually be
> broken) without a dispatch table. Would they transition or would they
> stick to current practices?
>
> > In the bug's comments, there's discussion about a lack of discoverability
> > for what hooks the charm has... but honestly, if you need to know what
> the
> > hooks do, you have to read the code anyway. Hopefully knowing what hooks
> a
> > charm has shouldn't be necessary to use the charm (if using Juju requires
> > you to read a charm's code... we're doing something wrong).
>
> We're also doing something wrong if knowing what a hook is supposed to
> do requires reading the code.
>
>
> gustavo @ http://niemeyer.net
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju-dev/attachments/20140820/9dfc1d83/attachment-0001.html>


More information about the Juju-dev mailing list