add es-cache to cleaned folders (#223373)

## Summary
Currently, `yarn kbn clean` nor `yarn kbn reset` won't remove cached ES
snapshot builds. This might cause issues for developers when switching
between branches with major changes. (see:
https://elastic.slack.com/archives/C5UDAFZQU/p1749628993034289)

This PR adds a softer and a harder clean to `clean` and `reset`
respectively.
This commit is contained in:
Alex Szabo 2025-06-12 10:58:05 +02:00 committed by GitHub
parent 8577ff35fa
commit 20764b6914
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 1 deletions

View file

@ -11,6 +11,8 @@ import { dedent } from '../lib/indent.mjs';
import { cleanPaths } from '../lib/clean.mjs'; import { cleanPaths } from '../lib/clean.mjs';
import * as Bazel from '../lib/bazel.mjs'; import * as Bazel from '../lib/bazel.mjs';
import { findPluginCleanPaths } from '../lib/find_clean_paths.mjs'; import { findPluginCleanPaths } from '../lib/find_clean_paths.mjs';
import Path from 'path';
import { REPO_ROOT } from '../lib/paths.mjs';
/** @type {import('../lib/command').Command} */ /** @type {import('../lib/command').Command} */
export const command = { export const command = {
@ -33,7 +35,10 @@ export const command = {
you might need to run 'yarn kbn reset'. you might need to run 'yarn kbn reset'.
`); `);
await cleanPaths(log, await findPluginCleanPaths(log)); await cleanPaths(log, [
...(await findPluginCleanPaths(log)),
Path.resolve(REPO_ROOT, '.es', 'cache'),
]);
// Runs Bazel soft clean // Runs Bazel soft clean
if (await Bazel.isInstalled(log)) { if (await Bazel.isInstalled(log)) {

View file

@ -38,6 +38,7 @@ export const command = {
Path.resolve(REPO_ROOT, 'node_modules'), Path.resolve(REPO_ROOT, 'node_modules'),
Path.resolve(REPO_ROOT, 'x-pack/node_modules'), Path.resolve(REPO_ROOT, 'x-pack/node_modules'),
Path.resolve(REPO_ROOT, 'data'), Path.resolve(REPO_ROOT, 'data'),
Path.resolve(REPO_ROOT, '.es'),
...readCleanPatterns(REPO_ROOT), ...readCleanPatterns(REPO_ROOT),
...(await findPluginCleanPaths(log)), ...(await findPluginCleanPaths(log)),
]); ]);