Skip to content

[CI] Fix moon cache usage#259760

Merged
delanni merged 10 commits intoelastic:mainfrom
delanni:fix-moon-cache-usage
Mar 27, 2026
Merged

[CI] Fix moon cache usage#259760
delanni merged 10 commits intoelastic:mainfrom
delanni:fix-moon-cache-usage

Conversation

@delanni
Copy link
Copy Markdown
Member

@delanni delanni commented Mar 26, 2026

Summary

Test clearing the moon cache before trying to store one for the job.

@delanni
Copy link
Copy Markdown
Member Author

delanni commented Mar 26, 2026

/ci

@delanni delanni force-pushed the fix-moon-cache-usage branch from 5ad38f4 to 80cb1a9 Compare March 26, 2026 12:34
@delanni delanni force-pushed the fix-moon-cache-usage branch from deac09f to 0908280 Compare March 26, 2026 17:16
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

@delanni delanni marked this pull request as ready for review March 27, 2026 10:18
@delanni delanni requested review from a team as code owners March 27, 2026 10:18
log.info('extract relevant versions for packages and pre-build webpack bundles');
await moonRun([':extract-version-dependencies', ':build-webpack'], {
log.info('pre-build webpack bundles');
await moonRun([':build-webpack'], {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the extract-version-dependencies tasks are already marked as dependencies of the webpack build. I've experimented with this, and it seems we don't benefit from the cache until the 2nd rerun locally if we run both tasks like this, but we do if we just rely on :build-webpack pulling in it's dependencies

Copy link
Copy Markdown
Contributor

@TamerlanG TamerlanG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

const args = ['kbn', 'build-shared'];
if (quiet) args.push('--quiet');
if (dist) args.push('--dist');
if (dist) {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This avoids reusing a bad cache

mkdir -p ./.moon/cache
echo "Extracting moon-cache.tar.gz to ./.moon/cache"
tar -xzf ~/moon-cache.tar.gz -C ./
elif [[ -d ~/.kibana-moon-cache ]]; then
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was trying to retrieve a warmed moon cache from the VM image build.

It seems that cache cannot be reused, probably because some absolute paths are no longer valid on the executors compared to the VM image builder's context. Since it is not useful any longer, it just adds extra weight to the .moon/cache prior to archiving it per-build, that also could have been the reason for failing bootstraps

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 27, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3cc25a3c-d49f-49df-bed5-641a0244761c

📥 Commits

Reviewing files that changed from the base of the PR and between ab24b48 and feeef53.

📒 Files selected for processing (11)
  • .buildkite/scripts/bootstrap.sh
  • .buildkite/scripts/common/setup_job_env.sh
  • .buildkite/scripts/steps/store_cache.sh
  • packages/kbn-plugin-helpers/src/tasks/build_webpack_packages.ts
  • src/dev/kbn_pm/src/commands/bootstrap/bootstrap_command.mjs
  • src/platform/packages/private/kbn-ui-shared-deps-npm/moon.extend.yml
  • src/platform/packages/private/kbn-ui-shared-deps-npm/moon.yml
  • src/platform/packages/private/kbn-ui-shared-deps-src/moon.extend.yml
  • src/platform/packages/private/kbn-ui-shared-deps-src/moon.yml
  • src/platform/packages/shared/kbn-monaco/moon.extend.yml
  • src/platform/packages/shared/kbn-monaco/moon.yml
💤 Files with no reviewable changes (2)
  • .buildkite/scripts/common/setup_job_env.sh
  • .buildkite/scripts/bootstrap.sh

📝 Walkthrough

Walkthrough

This pull request refactors the build system's caching and task orchestration. Changes include: removing the fallback moon cache recovery mechanism, enabling moon caching by removing the explicit MOON_CACHE=off export, and adding --no-cache to webpack build commands. The bootstrap process is simplified to run only :build-webpack instead of both :extract-version-dependencies and :build-webpack. Multiple Moon configuration files across shared dependency packages are updated to use relative script paths instead of workspace-root-qualified paths, and task dependencies are refactored to use scoped references (e.g., ~:extract-version-dependencies).

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • 🛠️ Update Documentation: Commit on current branch
  • 🛠️ Update Documentation: Create PR

Warning

Tools execution failed with the following error:

Failed to run tools: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error)


Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 27, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: adf39b4a-a36f-42da-b055-5f344792270e

📥 Commits

Reviewing files that changed from the base of the PR and between ab24b48 and feeef53.

📒 Files selected for processing (11)
  • .buildkite/scripts/bootstrap.sh
  • .buildkite/scripts/common/setup_job_env.sh
  • .buildkite/scripts/steps/store_cache.sh
  • packages/kbn-plugin-helpers/src/tasks/build_webpack_packages.ts
  • src/dev/kbn_pm/src/commands/bootstrap/bootstrap_command.mjs
  • src/platform/packages/private/kbn-ui-shared-deps-npm/moon.extend.yml
  • src/platform/packages/private/kbn-ui-shared-deps-npm/moon.yml
  • src/platform/packages/private/kbn-ui-shared-deps-src/moon.extend.yml
  • src/platform/packages/private/kbn-ui-shared-deps-src/moon.yml
  • src/platform/packages/shared/kbn-monaco/moon.extend.yml
  • src/platform/packages/shared/kbn-monaco/moon.yml
💤 Files with no reviewable changes (2)
  • .buildkite/scripts/common/setup_job_env.sh
  • .buildkite/scripts/bootstrap.sh

📝 Walkthrough

Walkthrough

This pull request refactors cache initialization and Moon build task configuration. The changes remove fallback cache logic from bootstrap scripts and disable the unconditional MOON_CACHE=off export, enabling Moon cache functionality. The webpack pre-build step no longer extracts version dependencies as a separate task and now includes a --no-cache flag. Multiple Moon configuration files across packages are updated to use relative script paths instead of $workspaceRoot prefixes and change task dependency references from unscoped to scoped form (~:extract-version-dependencies).

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • 🛠️ Update Documentation: Commit on current branch
  • 🛠️ Update Documentation: Create PR

Warning

Tools execution failed with the following error:

Failed to run tools: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error)


Comment @coderabbitai help to get the list of available commands and usage tips.

@delanni delanni added release_note:skip Skip the PR/issue when compiling release notes backport:all-open Backport to all branches that could still receive a release labels Mar 27, 2026
@delanni delanni enabled auto-merge (squash) March 27, 2026 12:32
@delanni delanni merged commit 6c04db2 into elastic:main Mar 27, 2026
21 checks passed
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 8.19, 9.2, 9.3

https://github.com/elastic/kibana/actions/runs/23646386763

@kibanamachine
Copy link
Copy Markdown
Contributor

💔 All backports failed

Status Branch Result
8.19 Backport failed because of merge conflicts

You might need to backport the following PRs to 8.19:
- Fix Moon webpack dependency cache invalidation (#258940)
- Update dependency @moonrepo/cli to v2 (main) (#256118)
9.2 Backport failed because of merge conflicts

You might need to backport the following PRs to 9.2:
- Fix Moon webpack dependency cache invalidation (#258940)
- [kbn_pm] Only install scripts when yarn integrity changes (#255175)
9.3 Backport failed because of merge conflicts

You might need to backport the following PRs to 9.3:
- Update dependency @moonrepo/cli to v2 (main) (#256118)

Manual backport

To create the backport manually run:

node scripts/backport --pr 259760

Questions ?

Please refer to the Backport tool documentation

kelvtanv pushed a commit to kelvtanv/kibana that referenced this pull request Mar 27, 2026
## Summary
Test clearing the moon cache before trying to store one for the job.
tylersmalley pushed a commit to kibanamachine/kibana that referenced this pull request Mar 27, 2026
## Summary
Test clearing the moon cache before trying to store one for the job.
tylersmalley pushed a commit to kibanamachine/kibana that referenced this pull request Mar 27, 2026
## Summary
Test clearing the moon cache before trying to store one for the job.
tylersmalley pushed a commit to kibanamachine/kibana that referenced this pull request Mar 27, 2026
## Summary
Test clearing the moon cache before trying to store one for the job.
tylersmalley pushed a commit to tylersmalley/kibana that referenced this pull request Mar 27, 2026
## Summary
Test clearing the moon cache before trying to store one for the job.
@tylersmalley tylersmalley added backport:skip This PR does not require backporting v9.3.3 v9.2.8 v8.19.14 and removed backport:all-open Backport to all branches that could still receive a release labels Mar 27, 2026
kibanamachine added a commit that referenced this pull request Mar 27, 2026
# Backport

This will backport the following commits from `main` to `9.2`:
- [Fix Moon webpack dependency cache invalidation
(#258940)](#258940)
- [Fix yarn.lock v1 parser for compound package alias headers
(#259640)](#259640)
- [[CI] Fix moon cache usage
(#259760)](#259760)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Tyler
Smalley","email":"tyler.smalley@elastic.co"},"sourceCommit":{"committedDate":"2026-03-24T23:56:42Z","message":"Fix
Moon webpack dependency cache invalidation (#258940)\n\nMoon cached
webpack-built shared dependency bundles using only local source files
and webpack config as inputs. When a dependency like `@elastic/eui`
changed after bootstrap, Moon did not see any relevant\ninput change for
`@kbn/ui-shared-deps-npm`, so it could restore a stale cached bundle.
That left the installed dependency tree newer than the built artifact,
which is why code present under\n`node_modules/@elastic/eui` was missing
from the emitted shared deps bundle.\n\nThis change makes Moon
invalidate those webpack bundle caches when, and only when, the actual
resolved dependency graph for the bundle changes. Instead of keying off
the entire workspace yarn.lock, it adds an exact\ntransitive dependency
fingerprint for each affected webpack-built package. That gives correct
rebuilds for updated dependencies, including transitive ones, without
broadly uncaching on unrelated lockfile
churn.\n\n---------\n\nSigned-off-by: Tyler Smalley
<tyler.smalley@elastic.co>","sha":"41b1f045b52a2e3ab40fdf7d71cfb0f7b36eed09","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:all-open","v9.4.0"],"title":"Fix
Moon webpack dependency cache
invalidation","number":258940,"url":"https://github.com/elastic/kibana/pull/258940","mergeCommit":{"message":"Fix
Moon webpack dependency cache invalidation (#258940)\n\nMoon cached
webpack-built shared dependency bundles using only local source files
and webpack config as inputs. When a dependency like `@elastic/eui`
changed after bootstrap, Moon did not see any relevant\ninput change for
`@kbn/ui-shared-deps-npm`, so it could restore a stale cached bundle.
That left the installed dependency tree newer than the built artifact,
which is why code present under\n`node_modules/@elastic/eui` was missing
from the emitted shared deps bundle.\n\nThis change makes Moon
invalidate those webpack bundle caches when, and only when, the actual
resolved dependency graph for the bundle changes. Instead of keying off
the entire workspace yarn.lock, it adds an exact\ntransitive dependency
fingerprint for each affected webpack-built package. That gives correct
rebuilds for updated dependencies, including transitive ones, without
broadly uncaching on unrelated lockfile
churn.\n\n---------\n\nSigned-off-by: Tyler Smalley
<tyler.smalley@elastic.co>","sha":"41b1f045b52a2e3ab40fdf7d71cfb0f7b36eed09"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/258940","number":258940,"mergeCommit":{"message":"Fix
Moon webpack dependency cache invalidation (#258940)\n\nMoon cached
webpack-built shared dependency bundles using only local source files
and webpack config as inputs. When a dependency like `@elastic/eui`
changed after bootstrap, Moon did not see any relevant\ninput change for
`@kbn/ui-shared-deps-npm`, so it could restore a stale cached bundle.
That left the installed dependency tree newer than the built artifact,
which is why code present under\n`node_modules/@elastic/eui` was missing
from the emitted shared deps bundle.\n\nThis change makes Moon
invalidate those webpack bundle caches when, and only when, the actual
resolved dependency graph for the bundle changes. Instead of keying off
the entire workspace yarn.lock, it adds an exact\ntransitive dependency
fingerprint for each affected webpack-built package. That gives correct
rebuilds for updated dependencies, including transitive ones, without
broadly uncaching on unrelated lockfile
churn.\n\n---------\n\nSigned-off-by: Tyler Smalley
<tyler.smalley@elastic.co>","sha":"41b1f045b52a2e3ab40fdf7d71cfb0f7b36eed09"}}]}]
BACKPORT-->

---------

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
Co-authored-by: Tyler Smalley <tyler.smalley@elastic.co>
Co-authored-by: Nick Partridge <nicholas.partridge@elastic.co>
Co-authored-by: Alex Szabo <alex.szabo@elastic.co>
tylersmalley added a commit that referenced this pull request Mar 27, 2026
…9640) (#260090)

# Backport

This will backport the following commits from `main` to `9.3`:
- [Fix yarn.lock v1 parser for compound package alias headers
(#259640)](#259640)
- [[CI] Fix moon cache usage
(#259760)](#259760)

<!--- Backport version: 10.2.0 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Nick
Partridge","email":"nicholas.partridge@elastic.co"},"sourceCommit":{"committedDate":"2026-03-25T19:33:17Z","message":"Fix
yarn.lock v1 parser for compound package alias headers (#259640)\n\n##
Summary\n\nFixes `extract-version-dependencies` failing with `Unable to
resolve\nd3-color@1 - 2 from yarn.lock dependency graph` when Yarn
merges\nmultiple lockfile descriptors (aliases) into a single
block.\n\n## Changes\n\n- **`yarn_lock_v1.ts`**: Parse each
comma-separated header descriptor\nwith correct scoped vs unscoped `@`
splitting; register `PackageInfo`\nper alias; merge `requestedVersions`
for duplicate\n`name@resolvedVersion` keys. In `focus` mode, include a
block if any\nalias matches.\n- **`yarn_lock_v1.test.ts`**: Regression
test for compound headers.\n- **`yarn.lock`**: Refreshed merged
descriptor lines (e.g. `d3-color` /\n`@elastic/kibana-d3-color`, `ajv` /
`@redocly/ajv`).\n- **`version_dependencies.txt`**: Regenerated
via\n`extract-version-dependencies`.\n\n## Testing\n\n- `node
scripts/jest src/dev/yarn/yarn_lock_v1.test.ts`\n- `moon run
@kbn/ui-shared-deps-npm:extract-version-dependencies`\n- `node
scripts/check_changes.ts`\n\nMade with
[Cursor](https://cursor.com)\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"c82b6d42eb7fecc5116eaab557ad8a4cf8869076","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport
missing","backport:all-open","v9.4.0"],"title":"Fix yarn.lock v1 parser
for compound package alias
headers","number":259640,"url":"https://github.com/elastic/kibana/pull/259640","mergeCommit":{"message":"Fix
yarn.lock v1 parser for compound package alias headers (#259640)\n\n##
Summary\n\nFixes `extract-version-dependencies` failing with `Unable to
resolve\nd3-color@1 - 2 from yarn.lock dependency graph` when Yarn
merges\nmultiple lockfile descriptors (aliases) into a single
block.\n\n## Changes\n\n- **`yarn_lock_v1.ts`**: Parse each
comma-separated header descriptor\nwith correct scoped vs unscoped `@`
splitting; register `PackageInfo`\nper alias; merge `requestedVersions`
for duplicate\n`name@resolvedVersion` keys. In `focus` mode, include a
block if any\nalias matches.\n- **`yarn_lock_v1.test.ts`**: Regression
test for compound headers.\n- **`yarn.lock`**: Refreshed merged
descriptor lines (e.g. `d3-color` /\n`@elastic/kibana-d3-color`, `ajv` /
`@redocly/ajv`).\n- **`version_dependencies.txt`**: Regenerated
via\n`extract-version-dependencies`.\n\n## Testing\n\n- `node
scripts/jest src/dev/yarn/yarn_lock_v1.test.ts`\n- `moon run
@kbn/ui-shared-deps-npm:extract-version-dependencies`\n- `node
scripts/check_changes.ts`\n\nMade with
[Cursor](https://cursor.com)\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"c82b6d42eb7fecc5116eaab557ad8a4cf8869076"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/259640","number":259640,"mergeCommit":{"message":"Fix
yarn.lock v1 parser for compound package alias headers (#259640)\n\n##
Summary\n\nFixes `extract-version-dependencies` failing with `Unable to
resolve\nd3-color@1 - 2 from yarn.lock dependency graph` when Yarn
merges\nmultiple lockfile descriptors (aliases) into a single
block.\n\n## Changes\n\n- **`yarn_lock_v1.ts`**: Parse each
comma-separated header descriptor\nwith correct scoped vs unscoped `@`
splitting; register `PackageInfo`\nper alias; merge `requestedVersions`
for duplicate\n`name@resolvedVersion` keys. In `focus` mode, include a
block if any\nalias matches.\n- **`yarn_lock_v1.test.ts`**: Regression
test for compound headers.\n- **`yarn.lock`**: Refreshed merged
descriptor lines (e.g. `d3-color` /\n`@elastic/kibana-d3-color`, `ajv` /
`@redocly/ajv`).\n- **`version_dependencies.txt`**: Regenerated
via\n`extract-version-dependencies`.\n\n## Testing\n\n- `node
scripts/jest src/dev/yarn/yarn_lock_v1.test.ts`\n- `moon run
@kbn/ui-shared-deps-npm:extract-version-dependencies`\n- `node
scripts/check_changes.ts`\n\nMade with
[Cursor](https://cursor.com)\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"c82b6d42eb7fecc5116eaab557ad8a4cf8869076"}},{"url":"https://github.com/elastic/kibana/pull/259476","number":259476,"branch":"9.2","state":"OPEN"},{"url":"https://github.com/elastic/kibana/pull/259475","number":259475,"branch":"8.19","state":"OPEN"}]}]
BACKPORT-->

---------

Co-authored-by: Nick Partridge <nicholas.partridge@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Alex Szabo <alex.szabo@elastic.co>
kibanamachine added a commit that referenced this pull request Mar 27, 2026
)

# Backport

This will backport the following commits from `main` to `8.19`:
- [Fix Moon webpack dependency cache invalidation
(#258940)](#258940)
- [Fix yarn.lock v1 parser for compound package alias headers
(#259640)](#259640)
- [[CI] Fix moon cache usage
(#259760)](#259760)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Tyler
Smalley","email":"tyler.smalley@elastic.co"},"sourceCommit":{"committedDate":"2026-03-24T23:56:42Z","message":"Fix
Moon webpack dependency cache invalidation (#258940)\n\nMoon cached
webpack-built shared dependency bundles using only local source files
and webpack config as inputs. When a dependency like `@elastic/eui`
changed after bootstrap, Moon did not see any relevant\ninput change for
`@kbn/ui-shared-deps-npm`, so it could restore a stale cached bundle.
That left the installed dependency tree newer than the built artifact,
which is why code present under\n`node_modules/@elastic/eui` was missing
from the emitted shared deps bundle.\n\nThis change makes Moon
invalidate those webpack bundle caches when, and only when, the actual
resolved dependency graph for the bundle changes. Instead of keying off
the entire workspace yarn.lock, it adds an exact\ntransitive dependency
fingerprint for each affected webpack-built package. That gives correct
rebuilds for updated dependencies, including transitive ones, without
broadly uncaching on unrelated lockfile
churn.\n\n---------\n\nSigned-off-by: Tyler Smalley
<tyler.smalley@elastic.co>","sha":"41b1f045b52a2e3ab40fdf7d71cfb0f7b36eed09","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:all-open","v9.4.0"],"title":"Fix
Moon webpack dependency cache
invalidation","number":258940,"url":"https://github.com/elastic/kibana/pull/258940","mergeCommit":{"message":"Fix
Moon webpack dependency cache invalidation (#258940)\n\nMoon cached
webpack-built shared dependency bundles using only local source files
and webpack config as inputs. When a dependency like `@elastic/eui`
changed after bootstrap, Moon did not see any relevant\ninput change for
`@kbn/ui-shared-deps-npm`, so it could restore a stale cached bundle.
That left the installed dependency tree newer than the built artifact,
which is why code present under\n`node_modules/@elastic/eui` was missing
from the emitted shared deps bundle.\n\nThis change makes Moon
invalidate those webpack bundle caches when, and only when, the actual
resolved dependency graph for the bundle changes. Instead of keying off
the entire workspace yarn.lock, it adds an exact\ntransitive dependency
fingerprint for each affected webpack-built package. That gives correct
rebuilds for updated dependencies, including transitive ones, without
broadly uncaching on unrelated lockfile
churn.\n\n---------\n\nSigned-off-by: Tyler Smalley
<tyler.smalley@elastic.co>","sha":"41b1f045b52a2e3ab40fdf7d71cfb0f7b36eed09"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/258940","number":258940,"mergeCommit":{"message":"Fix
Moon webpack dependency cache invalidation (#258940)\n\nMoon cached
webpack-built shared dependency bundles using only local source files
and webpack config as inputs. When a dependency like `@elastic/eui`
changed after bootstrap, Moon did not see any relevant\ninput change for
`@kbn/ui-shared-deps-npm`, so it could restore a stale cached bundle.
That left the installed dependency tree newer than the built artifact,
which is why code present under\n`node_modules/@elastic/eui` was missing
from the emitted shared deps bundle.\n\nThis change makes Moon
invalidate those webpack bundle caches when, and only when, the actual
resolved dependency graph for the bundle changes. Instead of keying off
the entire workspace yarn.lock, it adds an exact\ntransitive dependency
fingerprint for each affected webpack-built package. That gives correct
rebuilds for updated dependencies, including transitive ones, without
broadly uncaching on unrelated lockfile
churn.\n\n---------\n\nSigned-off-by: Tyler Smalley
<tyler.smalley@elastic.co>","sha":"41b1f045b52a2e3ab40fdf7d71cfb0f7b36eed09"}}]}]
BACKPORT-->

---------

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
Co-authored-by: Tyler Smalley <tyler.smalley@elastic.co>
Co-authored-by: Nick Partridge <nicholas.partridge@elastic.co>
Co-authored-by: Alex Szabo <alex.szabo@elastic.co>
SoniaSanzV pushed a commit to SoniaSanzV/kibana that referenced this pull request Mar 30, 2026
## Summary
Test clearing the moon cache before trying to store one for the job.
jeramysoucy pushed a commit to jeramysoucy/kibana that referenced this pull request Apr 1, 2026
## Summary
Test clearing the moon cache before trying to store one for the job.
paulinashakirova pushed a commit to paulinashakirova/kibana that referenced this pull request Apr 2, 2026
## Summary
Test clearing the moon cache before trying to store one for the job.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes v8.19.14 v9.2.8 v9.3.3 v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants