"Incremental build equals clean build" is claimed but never tested

Đang mở Phù hợp với người mới
#265 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

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
82/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
build-system, testing

Hướng nghiên cứu

Bắt đầu ở site/build.mjs, quanh writeOut và pruneDist, sau đó đọc site/lib/lib.test.mjs và lệnh chạy kiểm thử trong phần hướng dẫn bắt đầu. Thay đổi được đề xuất là chuyển các hàm sang site/lib/dist-writer.mjs, tham số hóa thư mục dist và kiểm thử chúng trong một thư mục tạm. Công việc được xem là hoàn tất khi các kiểm thử bao quát những phép so sánh byte, việc ghi lại, xóa tệp cũ và dọn dẹp thư mục đã liệt kê.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

priority: low tests

Summary

build.mjs says the incremental result is byte-identical to a clean build, but writeOut, pruneDist and the produced-file set are not tested, and CI always builds from a fresh checkout, so the incremental path never runs there.

Where

  • site/build.mjs:272-275 (claim)
  • site/build.mjs:288-299 (writeOut)
  • site/build.mjs:323-335 (pruneDist)
  • site/build.mjs:526-531, :638, :745

Impact

A stale file left in local dist, or a needed file pruned, would only show locally.

Suggested fix

Move writeOut and pruneDist into site/lib/dist-writer.mjs with the dist directory as a parameter and test them in a temp directory.

Acceptance criteria

  • Same bytes written twice: 0 writes the second time
  • Same-size file with different bytes is rewritten
  • Stale old/x.html removed and its empty directory pruned
  • Directory holding a produced file is kept
  • Optional: hashes of build and build --clean match in a temp copy

Getting started

  • Relevant files: site/build.mjs, site/lib/lib.test.mjs
  • Run the tests: npm test; the full local gate is npm run check (Node 22+, no install step)
  • Related docs: CONTRIBUTING.md, site/README.md

Related: #85


Filed by repo-audit/full-audit at 4adb944. Severity: low. Effort: S. audit-key: testing|site/build.mjs|writeOut

Ngôn ngữ chính
JavaScript
Star
58
Fork
15
Merge trung bình
1 ngày 15 giờ
Pull request đã merge (30 ngày)
12

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của TMHSDigital/Free-Game-Dev-Assets

Tất cả issue của TMHSDigital/Free-Game-Dev-Assets

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.