[rush] beforeInstall
hook invokes on a different set of conditions than afterInstall
hook
#5168
Labels
effort: medium
Needs a somewhat experienced developer
help wanted
If you're looking to contribute, this issue is a good place to start!
Summary
I was hoping that that if the
beforeInstall
hook runs, then there would be some guarantee that theafterInstall
hook will run and vice versa. That turns out not to be the case in the following scenarios:beforeInstall
hook will not invoke, but theafterInstall
hook will.afterInstall
hook will not invoke. This is unexpected because I was hoping to do some cleanup actions in theafterInstall
hook.It would be trivial for me to make this change in a PR but it would be a bit of a breaking change. Even so, I think it still might be worth considering because I think it's a common enough use case to use the 2 hooks in tandem, with the
afterInstall
hook being a cleanup function for thebeforeInstall
hook.Source code file in question
Details
My use case is being able to measure granular subspace-by-subspace install duration metrics. This data would be much more useful for my team than the all-in-one durationInSeconds field provided by the
flushTelemetry
hook, which adds up the total duration of installation times for however many subspaces targeted by therush install
command.Standard questions
@microsoft/rush
globally installed version?rushVersion
from rush.json?useWorkspaces
from rush.json?node -v
)?The text was updated successfully, but these errors were encountered: