EMBR-12903 fix(licenses): sort discovered license files for deterministic cross-platform notices#1414
Merged
Merged
Conversation
overbalance
force-pushed
the
overbalance/patch-licenses
branch
from
July 7, 2026 17:23
d0d208f to
c716e44
Compare
Contributor
Chrome DevTools Protocol Tracing (Script: 121.39ms, Heap: 13.54MB)
Lighthouse (Script Eval: 135.59ms)
Platform Tests (vite-7 es2015 gzip: 69.66KB)vite-6 Platform Tests
vite-7 Platform Tests
webpack-5 Platform Tests
|
overbalance
enabled auto-merge (squash)
July 7, 2026 17:42
joaquin-diaz
approved these changes
Jul 7, 2026
jpmunz
reviewed
Jul 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem is this solving?
generate-license-filepicks whichever license fileglobreturns first when a package ships more than one (e.g.import-in-the-middleships bothLICENSEand aLICENSE-3rdparty.csvdependency manifest).glob's order and casing differ across filesystems, soTHIRD_PARTY_NOTICES.txtregenerated differently on macOS vs Linux CI and tripped thelicenses:checkdrift gate. It also meant the committed notices listed the CSV manifest forimport-in-the-middleinstead of its actual license.Short description of the changes
generate-license-fileto sort candidate license files case-insensitively before picking, so the same file wins on every platform (upstream: fix: sort discovered license files for deterministic cross-platform output TobyAndToby/generate-license-file#743). A plain.sort()isn't enough here:globyieldsLICENSEon Linux butlicenseon macOS, so code-unit ordering still diverges.patch-package. Since.npmrcsetsignore-scripts=true(nopostinstall), the patch runs from the rootlicensesscript, whichlicenses:check/validate/ CI all funnel through.packages/web-sdk/THIRD_PARTY_NOTICES.txt:import-in-the-middlenow correctly resolves to its Apache license.Chosen over depending on the fork directly because its package lives in a subdirectory of a private bun monorepo and isn't published to npm.
How was this tested?
npm run licenses:checkpasses with no drift; macOS output matches the CI Linux blob byte-for-byte.npm run lintpasses.Checklist
licenses:checkdrift gate