-
Notifications
You must be signed in to change notification settings - Fork 908
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
choco hook package - post-install trigger does not fire when package installation fails #3422
Comments
My view on hook packages is that they will only execute when the installation is successful. They are a post-package-action-execution that really only makes sense in that context. I can see the concept of error capturing that was mentioned over on the hook issue that you linked to. However, that would require further reworking in this area both in terms of code and in terms of the hook scripts themselves to 'only do this when successfully' and 'only do this in failure'. Or perhaps have separate scripts for success (the existing ones) and failure (new ones). |
While I agree this makes sense from a naming-perspective (post-install = "do this after installation finished" ..) it's a bit harder to utilize hook-packages for building a custom logging-system that's supposed to really be in-sync with the local package index. |
Can you elaborate on that for more context? |
one could create a "org-custom-logging.hook" package with something like this: (think about pre-install
post-install
This way, one would know when a package installation began and when it was finished, but you'd have to deduce if the install script was successful by checking if both events ( => that could be way more elegant if there was a And yes, I'm aware that if you're looking for a complete inventory and complete management suite, there's CCM 😉 |
The intention of hook scripts was to run only when successful. I understand the use case that you have, but the functionality was never intended to support that. I would see this as intended behaviour and not a bug. It could be an improvement to how hook scripts operate and be added by the community. It's not something I see us working on any time soon. My intention would be to close this @mwallner but happy for a feature to be opened for it to be added. |
That is the way I intended them to work, as then any hook which makes changes based on a successful package script execution should not have to explicitly check that the package script worked. I had not considered this use case of remote logging, but that does seem to align with an organizational only use case. |
Heya, thanks for the insights, I'm happy closing this as "working as designed". Kudos @TheCakeIsNaOH - didn't realize you've been involved in the bring-up of this amazing feature 😃 👏 |
Checklist
What You Are Seeing?
When a package installation fails no further post-install "package hook" is executed, (neither global nor package-specific).
This has (kind of) been discussed here before - looks like it's been lost in time.
What is Expected?
post-install hooks should fire even if the installation fails .
How Did You Get This To Happen?
System Details
Installed Packages
Output Log
Additional Context
No response
The text was updated successfully, but these errors were encountered: