Skip to content
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

Stop clearing all caches with yarn kbn clean #67718

Closed
Tracked by #68321
spalger opened this issue May 28, 2020 · 8 comments
Closed
Tracked by #68321

Stop clearing all caches with yarn kbn clean #67718

spalger opened this issue May 28, 2020 · 8 comments
Labels
discuss Team:Operations Team label for Operations Team

Comments

@spalger
Copy link
Contributor

spalger commented May 28, 2020

The issues yarn has with updating the node_modules to support massive dependency tree changes within our workspace (usually caused by switching between minor branches of Kibana) has led to a ton of people adopting the strategy of running yarn kbn clean before yarn kbn bootstrap. I've spent the last several months trying to combat this but it is still pervasive best I can tell.

I think we should adapt to the state of things by moving the full cache clearing powers of yarn kbn clean to a new command, maybe yarn kbn destroy-caches, and update yarn kbn clean to only delete the node_modules/.yarn-integrity file and then run yarn kbn bootstrap automatically.

We could also support a --force flag that recursively deletes node_modules directories before running yarn kbn bootstrap, but unless you ran yarn kbn destroy-caches would you delete the caches which actually make things better and shouldn't be removed constantly.

Additionally, the --no-cache flag could be passed to yarn kbn clean (just like we support with yarn kbn bootstrap today) to bypass the bootstrap cache when it is automatically run.

@spalger spalger added discuss Team:Operations Team label for Operations Team labels May 28, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-operations (Team:Operations)

@mistic
Copy link
Member

mistic commented May 28, 2020

@spalger I like the idea but why not just use --full flag for yarn kbn clean instead of using a different command? yarn kbn clean could now by default only delete the .yarn-integrety and when provided with --full flag will follow the current behaviour and delete everything.

@spalger
Copy link
Contributor Author

spalger commented May 28, 2020

Mostly because I don't think that most people think of clean as "make my repository harder to work with", they think of is as "make it better", and --full communicates "make it even better than better" to me.

yarn kbn destroy-caches intends to communicate that the result of that action will make things uncached, slower, and as such people shouldn't do it unless they're out of options.

@jbudz
Copy link
Member

jbudz commented May 28, 2020

I like it, updating the name to current state should help a lot. clean dist clean node_modules clean all. Not suggestions, mostly how I view the it when I run the command.

@mistic
Copy link
Member

mistic commented May 28, 2020

@spalger I was not seeing this by that point of view. For me yarn kbn clean will always clean something that is cached by our tools on the repo. It can be a smaller clean task or a wipe all task. But in the end either approaches are functional equivalent. I'm fine with your approach, I'm just not sure if destroy-caches is the best name for it 😄

@spalger
Copy link
Contributor Author

spalger commented May 28, 2020

How about yarn kbn please-dont-use-this-unless-you-are-asked-to-by-operations

@mistic
Copy link
Member

mistic commented May 28, 2020

@spalger don't know how but you've got it again! 😄

@spalger spalger mentioned this issue Jun 4, 2020
15 tasks
@tylersmalley tylersmalley added 1 and removed 1 labels Oct 11, 2021
@exalate-issue-sync exalate-issue-sync bot added impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort labels Feb 16, 2022
@tylersmalley tylersmalley removed loe:small Small Level of Effort impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. EnableJiraSync labels Mar 16, 2022
@tylersmalley
Copy link
Contributor

Recent changes to packaging and use of Bazel remote cache make this not an issue we should continue to track.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss Team:Operations Team label for Operations Team
Projects
None yet
Development

No branches or pull requests

5 participants