Skip to content

[9.3] Fix yarn.lock v1 parser for compound package alias headers (#259640)#260060

Closed
tylersmalley wants to merge 1 commit intoelastic:9.3from
tylersmalley:backport/9.3/pr-259640
Closed

[9.3] Fix yarn.lock v1 parser for compound package alias headers (#259640)#260060
tylersmalley wants to merge 1 commit intoelastic:9.3from
tylersmalley:backport/9.3/pr-259640

Conversation

@tylersmalley
Copy link
Copy Markdown
Member

Backport

This will backport the following commits from main to 9.3:

Questions ?

Please refer to the Backport tool documentation

…59640)

## Summary

Fixes `extract-version-dependencies` failing with `Unable to resolve
d3-color@1 - 2 from yarn.lock dependency graph` when Yarn merges
multiple lockfile descriptors (aliases) into a single block.

## Changes

- **`yarn_lock_v1.ts`**: Parse each comma-separated header descriptor
with correct scoped vs unscoped `@` splitting; register `PackageInfo`
per alias; merge `requestedVersions` for duplicate
`name@resolvedVersion` keys. In `focus` mode, include a block if any
alias matches.
- **`yarn_lock_v1.test.ts`**: Regression test for compound headers.
- **`yarn.lock`**: Refreshed merged descriptor lines (e.g. `d3-color` /
`@elastic/kibana-d3-color`, `ajv` / `@redocly/ajv`).
- **`version_dependencies.txt`**: Regenerated via
`extract-version-dependencies`.

## Testing

- `node scripts/jest src/dev/yarn/yarn_lock_v1.test.ts`
- `moon run @kbn/ui-shared-deps-npm:extract-version-dependencies`
- `node scripts/check_changes.ts`

Made with [Cursor](https://cursor.com)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit c82b6d4)
@tylersmalley tylersmalley added the backport This PR is a backport of another PR label Mar 27, 2026
@tylersmalley tylersmalley enabled auto-merge (squash) March 27, 2026 16:58
auto-merge was automatically disabled March 27, 2026 17:01

Pull request was closed

@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #4 / SelectedFilters should render properly

Metrics [docs]

✅ unchanged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants