Description
Summary
I was hoping that that if the beforeInstall
hook runs, then there would be some guarantee that the afterInstall
hook will run and vice versa. That turns out not to be the case in the following scenarios:
- If installation is already up-to-date, then the
beforeInstall
hook will not invoke, but theafterInstall
hook will. - If the installation fails, then the
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 the beforeInstall
hook.
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 the rush install
command.
Standard questions
Question | Answer |
---|---|
@microsoft/rush globally installed version? |
5.149.0 |
rushVersion from rush.json? |
5.149.0 |
useWorkspaces from rush.json? |
No |
Operating system? | Unix |
Would you consider contributing a PR? | Yes |
Node.js version (node -v )? |
18.20.4 |
Metadata
Metadata
Assignees
Labels
Type
Projects
Status