You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "Frun1na (via GitHub)" <gi...@apache.org> on 2026/09/24 13:10:18 UTC

[PR] fix(web): finalize the license manifest after vite's bundle injections [rocketmq-dashboard]

Frun1na opened a new pull request, #5083:
URL: https://github.com/apache/rocketmq-dashboard/pull/5083

   ### Which Issue(s) This PR Fixes
   
   - Fixes #<issue-id>
   
   ### Brief Description
   
   `npm run build` fails on every run at the `license:check` gate with `build artifact verification failed: assets/index-*.js`. Two deterministic causes, both rooted in the manifest being finalized too early:
   
   1. `distributionLicenses()` records the output checksums in its own `generateBundle`, but `vite:build-import-analysis` injects the `__vite__mapDeps` preload map into the entry chunk in its own (later) `generateBundle`, so the written entry chunk always differs from what was hashed.
   2. `checkDistribution` re-collects the license sources from `manifest.modules` and compares the components. `legalFiles()` walks each package directory without excluding the build output directory, so at check time the just-written `dist/legal/licenses/**` files and `dist/NOTICE` are picked up as new "license sources" of the app package, and the components comparison always diverges.
   
   Fixes:
   
   - the manifest is now finalized in `writeBundle` (final chunk contents, after all injections) and written straight into the build output directory; the license materials themselves are still emitted during `generateBundle` as before;
   - `legalFiles()` skips `dist/` so build-time and check-time collections see the same sources (no bundled dependency keeps its license under a `dist/` directory, verified against the generated manifest).
   
   The existing packaging test did not catch this because its fixture has no dynamic import, so no preload map was ever injected; the updated test builds with `write: true` and a new regression test adds a dynamic-import fixture that reproduces the injection.
   
   ### How Did You Test This Change?
   
   ```
   cd web && node --test scripts/licenses.test.mjs
   
   # tests 5
   # pass 5
   # fail 0
   ```
   
   The new regression test fails on the unpatched plugin:
   
   ```
   # pass 4
   # fail 1
   ✖ vitePackagingSurvivesDynamicImportPreloadInjectionTest
     Error: dependency versions/license texts changed; a rebuild is required
   ```
   
   and with only the `legalFiles` fix applied it fails with the original symptom (`build artifact verification failed: assets/index-*.js`), which is what every `npm run build` currently reports.
   
   End-to-end on the app itself (failed before this change, passes now):
   
   ```
   cd web && rm -rf dist && npm run build
   
   > node scripts/licenses.mjs check
   
   web license check passed: 133 actual components, 140 license files
   ```
   
   ### Checklist
   
   - [x] One coherent change; unrelated modifications are not bundled in
   - [x] Commit subject follows Conventional Commits (`feat:` / `fix:` / `refactor:` / `chore:` / `docs:` / `perf:`)
   - [x] Tests added or updated for non-trivial changes, test methods named `...Test`
   - [x] New UI text has both Chinese and English entries under `web/src/i18n/`
   - [ ] Architecture constraints stay green (`mvn test` runs the ArchUnit checks)
   - [x] New source files carry the ASF license header
   - [ ] Documentation touched where behaviour changed (README / `docs/` / in-app help)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(web): finalize the license manifest after vite's bundle injections [rocketmq-dashboard]

Posted by "zmuxuny (via GitHub)" <gi...@apache.org>.
zmuxuny commented on PR #5083:
URL: https://github.com/apache/rocketmq-dashboard/pull/5083#issuecomment-5817457318

   Thanks for investigating this. This overlaps with #5019 (tracked in #5018): both address the frontend license-gate failure and change `web/scripts/licenses.mjs` and its tests. The implementations and regression tests differ, so I'm linking them here to help maintainers compare the approaches. Happy to coordinate if combining parts of the two fixes would help.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(web): finalize the license manifest after vite's bundle injections [rocketmq-dashboard]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #5083:
URL: https://github.com/apache/rocketmq-dashboard/pull/5083#issuecomment-5963522575

   This pull request has been automatically closed because there has been no activity for 7 days. If you would like to continue working on this, please reopen the PR with updated changes.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(web): finalize the license manifest after vite's bundle injections [rocketmq-dashboard]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #5083: fix(web): finalize the license manifest after vite's bundle injections
URL: https://github.com/apache/rocketmq-dashboard/pull/5083


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org