Revisit the use of removeNPMAbsolutePaths

Đang mở
#509 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
25/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
typescript
Lĩnh vực
ci-cd, devops

Hướng nghiên cứu

Bắt đầu bằng cách tìm removeNPMAbsolutePaths và kiểm tra cách nó xử lý các tệp package.json trong node_modules. Tái hiện npm ci với package-lock.json hiện tại và so sánh diff tạo ra, bao gồm cả các thay đổi ở ký tự xuống dòng cuối cùng. Hoàn thành có nghĩa là xác định liệu việc dọn dẹp còn cần thiết trong CI hay không và tránh các thay đổi xung đột được mô tả ở đây.

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

Mô tả

It appears that npm ci creates a huge diff. None of the package.json files in node_modules have a final newline. Is this something that should be done separate from this PR?

Originally posted by @RA80533 in https://github.com/github/codeql-action/issues/487#issuecomment-838000019

  • The current package-lock.json file was generated as a v2 lock file by npm 7.x. Major releases of npm prior to 7.x inserted an extra property in package.json files residing in the node_modules folder for which removeNPMAbsolutePaths was used. In other words, removeNPMAbsolutePaths no longer has anything to clean up. EDIT: This might not be true for the CI. This specific detail needs to be investigated.
  • removeNPMAbsolutePaths has the unfortunate side effect of stripping the final newline from any file it touches. npm attempts to insert a final newline if it finds that it's missing. The two work against each other to a disastrous effect. VS Code's version control integration has to be reloaded if either of them tries to undo the other because of the enormous amount of changes they make.
Ngôn ngữ chính
TypeScript
Star
1.6k
Fork
493
Merge trung bình
1 ngày 13 giờ
Pull request đã merge (30 ngày)
44

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

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 github/codeql-action

Tất cả issue của github/codeql-action

Issue tương tự

Thêm issue về TypeScript

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.