Skip to content

EMBR-12903 fix(licenses): sort discovered license files for deterministic cross-platform notices#1414

Merged
overbalance merged 3 commits into
mainfrom
overbalance/patch-licenses
Jul 7, 2026
Merged

EMBR-12903 fix(licenses): sort discovered license files for deterministic cross-platform notices#1414
overbalance merged 3 commits into
mainfrom
overbalance/patch-licenses

Conversation

@overbalance

@overbalance overbalance commented Jul 7, 2026

Copy link
Copy Markdown
Member

What problem is this solving?

generate-license-file picks whichever license file glob returns first when a package ships more than one (e.g. import-in-the-middle ships both LICENSE and a LICENSE-3rdparty.csv dependency manifest). glob's order and casing differ across filesystems, so THIRD_PARTY_NOTICES.txt regenerated differently on macOS vs Linux CI and tripped the licenses:check drift gate. It also meant the committed notices listed the CSV manifest for import-in-the-middle instead of its actual license.

Short description of the changes

  • Patch generate-license-file to 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: glob yields LICENSE on Linux but license on macOS, so code-unit ordering still diverges.
  • Apply the patch via patch-package. Since .npmrc sets ignore-scripts=true (no postinstall), the patch runs from the root licenses script, which licenses:check / validate / CI all funnel through.
  • Regenerate packages/web-sdk/THIRD_PARTY_NOTICES.txt: import-in-the-middle now 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:check passes with no drift; macOS output matches the CI Linux blob byte-for-byte.
  • npm run lint passes.

Checklist

  • Covered by the existing licenses:check drift gate
  • No changes to public API

@overbalance
overbalance requested a review from a team as a code owner July 7, 2026 17:22
@overbalance
overbalance force-pushed the overbalance/patch-licenses branch from d0d208f to c716e44 Compare July 7, 2026 17:23
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor
Chrome DevTools Protocol Tracing (Script: 121.39ms, Heap: 13.54MB)
Number of Requests Size of Requests Script Duration Task Duration Heap Used Size
Requests +13 requests +41.70 KB
Page Loaded +21.88 ms +23.67 ms +1.17 MB
Generate 100 fetch requests +20.73 ms +89.06 ms +1.68 MB
Generate 100 XHR requests +44.14 ms +108.11 ms +2.91 MB
Click 100 buttons and generate 100 logs +26.05 ms +50.66 ms +2.25 MB
Throw a 100 exceptions -1.08 ms +26.43 ms +2.29 MB
End Session +9.67 ms +37.03 ms +3.24 MB
Total +13 requests +41.70 KB +121.39 ms +334.96 ms +13.54 MB
Lighthouse (Script Eval: 135.59ms)
Difference Description
Total Blocking Time +4 ms Difference in Total Blocking Time: Sum of all time periods between FCP and Time to Interactive, when task length exceeded 50ms, expressed in milliseconds. Learn more about the Total Blocking Time metric.
Main Thread Time +111.56 ms Difference in Main Thread Time: Consider reducing the time spent parsing, compiling and executing JS. You may find delivering smaller JS payloads helps with this. Learn how to minimize main-thread work
Script Evaluation Time +135.59 ms Difference in Script Evaluation Time: Consider reducing the time spent parsing, compiling, and executing JS. You may find delivering smaller JS payloads helps with this. Learn how to reduce Javascript execution time.
Platform Tests (vite-7 es2015 gzip: 69.66KB)

vite-6 Platform Tests

Total Uncompressed Size Total Gzip Size
vite-6 - es2015 +203.00 KB +69.70 KB

vite-7 Platform Tests

Total Uncompressed Size Total Gzip Size
vite-7 - es2015 +203.00 KB +69.66 KB

webpack-5 Platform Tests

Total Uncompressed Size Total Gzip Size
webpack-5 - es2015 0 KB 0 KB

@overbalance overbalance changed the title fix(licenses): sort discovered license files for deterministic cross-platform notices EMBR-12903 fix(licenses): sort discovered license files for deterministic cross-platform notices Jul 7, 2026
@overbalance
overbalance enabled auto-merge (squash) July 7, 2026 17:42
@overbalance
overbalance merged commit 1cb7e8d into main Jul 7, 2026
20 checks passed
@overbalance
overbalance deleted the overbalance/patch-licenses branch July 7, 2026 18:48
Comment thread patches/generate-license-file+4.2.1.patch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants