Revisit the use of removeNPMAbsolutePaths

未关闭
#509 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
重构
描述清晰度
需要澄清
活跃度
停滞
技术栈
typescript
领域
ci-cd, devops

调研方向

首先定位 removeNPMAbsolutePaths,并检查它如何处理 node_modules 中的 package.json 文件。使用当前的 package-lock.json 重现 npm ci,并比较生成的 diff,包括末尾换行符的变化。完成的标准是确定 CI 中是否仍需要进行清理,并避免这里描述的冲突更改。

由索引模型根据 Issue 内容生成。

描述

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.
主要语言
TypeScript
星标
1.6k
派生
493
平均合并
1 天 13 小时
30 天内合并 PR
44

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

github/codeql-action 的其他 Issue

查看 github/codeql-action 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。