Bundle analysis: `normalizePath` replaces everything after the first `-` in a file name, so different assets collide
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 72/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript, node.js
- Lĩnh vực
- backend
Hướng nghiên cứu
Bắt đầu bằng cách kiểm tra normalizePath trong @codecov/bundler-plugin-core và các bài kiểm thử cho mẫu tên tệp Vite của nó. Tái hiện xung đột với hai đường dẫn maplibre trong issue, sau đó kiểm tra rằng quá trình chuẩn hóa giữ nguyên toàn bộ tên asset trước hash. Hoàn tất khi các đường dẫn đó được chuẩn hóa khác nhau và các asset không thay đổi không còn tạo ra thay đổi kích thước giả.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
normalizePath in @codecov/bundler-plugin-core replaces everything from the first - in a file name up to the extension with *, not only the hash. If two assets share the text before their first -, they get the same normalized path, and the bundle comparison matches the wrong files against each other.
On https://github.com/kristof-mattei/endless-ssh-rs-with-web/pull/3817#issuecomment-6641294034 (the rows are in the comment's edit history), the bundle report contained these two rows:
| Asset Name | Size Change | Total Size | Change (%) |
|---|---|---|---|
assets/maplibre-*.js |
-517.19kB | 1.85kB | -99.64% |
assets/maplibre-*.js |
517.19kB | 519.04kB | 27926.19% ⚠️ |
Both rows come from two unchanged files matched against each other: maplibre-gl-worker-Br3j0JGE.js (519.04 kB) and maplibre-gl-AxBTEyzg.js (1.85 kB). The size changes cancel out exactly. The bundle totals in the same comment are correct.
Environment
@codecov/vite-plugin2.0.1 and@codecov/bundler-plugin-core2.0.1 (the latest release of both)- Vite 8.3.5 with Rolldown 1.2.16, default
chunkFileNamesandassetFileNames - CI on GitHub Actions. Reproduced locally on Node.js 26.13.0
To Reproduce
import { normalizePath } from "@codecov/bundler-plugin-core";
normalizePath("assets/maplibre-gl-AxBTEyzg.js", "assets/[name]-[hash].js", "vite");
// "assets/maplibre-*.js"
normalizePath("assets/maplibre-gl-worker-Br3j0JGE.js", "assets/[name]-[hash][extname]", "vite");
// "assets/maplibre-*.js"
normalizePath("assets/preload-helper-BRbzi6Nc.js", "assets/[name]-[hash].js", "vite");
// "assets/preload-*.js"
Expected behavior
normalizePath replaces only the hash: assets/maplibre-gl-*.js, assets/maplibre-gl-worker-*.js, assets/preload-helper-*.js. If an asset is unchanged, the bundle report lists no size change for it.
Additional context
None at the moment
- Ngôn ngữ chính
- Không có dữ liệu ngôn ngữ
- Star
- 52
- Fork
- 26
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của codecov/feedback
-
Docs Waiting for: Product Owner
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
-
Feature RequestĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 5/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 54/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 8/100
Tất cả issue của codecov/feedback
Issue tương tự
-
Type: Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
eyalgolan/statecraft-israel#2732 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Create Noise Latents ignores randomize_seed and produces the same noise every runCó thể đã có người làm @griptapeops đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
griptape-ai/griptape-nodes-library-diffusers#127 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Jenkins capacity report: metrics history is lost when archiving a month failsCó thể đã có người làm @RaphaelFakhri đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
adoptium/infrastructure#4568 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
SAP/crossplane-provider-btp#1175 ·
Maintainer thường phản hồi trong vòng 1 ngày