Skip to content

fix(NA): yarn_lock_v1.ts parser for aliased packages#259654

Open
mistic wants to merge 7 commits intoelastic:mainfrom
mistic:fix-yarn-v1-parser-for-aliased-packages
Open

fix(NA): yarn_lock_v1.ts parser for aliased packages#259654
mistic wants to merge 7 commits intoelastic:mainfrom
mistic:fix-yarn-v1-parser-for-aliased-packages

Conversation

@mistic
Copy link
Copy Markdown
Contributor

@mistic mistic commented Mar 25, 2026

When yarn v1 merges aliased packages (like d3-color aliased to @elastic/kibana-d3-color) into a single yarn.lock header, the parser assumed all entries shared the same package name. It extracted the name from the first entry (@elastic/kibana-d3-color) and stripped it from all entries to compute versions, producing garbage for entries with a different name (d3-color@1 - 2).

So in this PR:

  • Each header entry is now parsed individually to extract its own name and version
  • Entries are grouped by package name using a Map<string, string[]>
  • The block body (version, resolved URL, integrity, dependencies) is parsed once
  • A separate PackageInfo is created for each unique name, so both d3-color@2.0.1 and @elastic/kibana-d3-color@2.0.1 are properly indexed

@mistic mistic self-assigned this Mar 25, 2026
@mistic mistic added chore Team:Operations Kibana-Operations Team release_note:skip Skip the PR/issue when compiling release notes backport:all-open Backport to all branches that could still receive a release v9.4.0 labels Mar 25, 2026
@mistic mistic marked this pull request as ready for review March 25, 2026 20:00
@mistic mistic requested a review from a team as a code owner March 25, 2026 20:00
@elasticmachine
Copy link
Copy Markdown
Contributor

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

@mistic mistic requested a review from jbudz March 25, 2026 20:00
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp bot commented Mar 25, 2026

Approvability

Verdict: Needs human review

This is a bug fix to dev tooling (yarn.lock parser) with tests, but the author does not own these files—they belong to @elastic/kibana-operations. The designated code owners should review changes to their infrastructure tooling.

You can customize Macroscope's approvability policy. Learn more.

@tylersmalley
Copy link
Copy Markdown
Member

@mistic did you see #259640? Does this do anything different?

@elastic elastic deleted a comment from elasticmachine Mar 26, 2026
@mistic
Copy link
Copy Markdown
Contributor Author

mistic commented Mar 26, 2026

I've only got in touch with the other PR after I put mine up. The end results are similar but I just think this changes are a closer fit to the past code structure that we had there before. Up to decide if we either close this or still merge it . I'm okay either way

@mistic mistic enabled auto-merge (squash) March 26, 2026 17:30
@mistic mistic requested a review from Ikuni17 March 26, 2026 17:30
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

cc @mistic

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

Labels

backport:all-open Backport to all branches that could still receive a release chore release_note:skip Skip the PR/issue when compiling release notes Team:Operations Kibana-Operations Team v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants