Skip to content

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

Merged
tylersmalley merged 2 commits intoelastic:9.3from
tylersmalley:backport/9.3/pr-259640
Mar 27, 2026
Merged

[9.3] Fix yarn.lock v1 parser for compound package alias headers (#259640)#260090
tylersmalley merged 2 commits intoelastic:9.3from
tylersmalley:backport/9.3/pr-259640

Conversation

@tylersmalley
Copy link
Copy Markdown
Member

@tylersmalley tylersmalley commented Mar 27, 2026

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 18:41
## Summary
Test clearing the moon cache before trying to store one for the job.
@tylersmalley tylersmalley merged commit cccfe50 into elastic:9.3 Mar 27, 2026
14 checks passed
@tylersmalley tylersmalley deleted the backport/9.3/pr-259640 branch March 27, 2026 19:52
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

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.

4 participants