nodejs / nodejs/node-core-utils

git node wpt <name> crashes if <name> isn't found

未关闭 适合新手
#664 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

bug
主要语言
JavaScript
星标
313
派生
137
平均合并
2 天 8 小时
30 天内合并 PR
24

描述

I just encountered this whilst trying to pull in the FileAPI tests for a backport, and I'd written:

$ git node wpt File

Instead of:

$ git node wpt FileAPI

Which resulted in the following crash:

$ git node wpt File
   ⚠  Please create File.json in test/wpt/status
------------------------- Checking updates for File... -------------------------
No records for File in local test/fixtures/wpt/versions.json
pulling files from scratch...
----------------- Writing assets to test/fixtures/wpt/File... ------------------
⠧ Querying asset list for File...TypeError: Cannot read properties of undefined (reading 'oid')
    at GitHubTree._getLastCommit (file:///usr/local/lib/node_modules/node-core-utils/lib/github/tree.js:38:56)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async GitHubTree.getLastCommit (file:///usr/local/lib/node_modules/node-core-utils/lib/github/tree.js:48:23)
    at async GitHubTree.getFiles (file:///usr/local/lib/node_modules/node-core-utils/lib/github/tree.js:100:20)
    at async WPTUpdater.getAssetList (file:///usr/local/lib/node_modules/node-core-utils/lib/wpt/index.js:61:34)
    at async WPTUpdater.pullAllAssets (file:///usr/local/lib/node_modules/node-core-utils/lib/wpt/index.js:73:16)
    at async WPTUpdater.update (file:///usr/local/lib/node_modules/node-core-utils/lib/wpt/index.js:160:5)
    at async main (file:///usr/local/lib/node_modules/node-core-utils/components/git/wpt.js:80:5)```

It may need a check to see if the specified `<name>` is even a web platform test case, here I'd expect it to exit with -1 and a message saying "We couldn't find the File WPT tests, maybe you misspelled or have the wrong API identifier?"

贡献指南

打开贡献指南

从这里开始

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

调研方向

首先重现 git node wpt File,然后沿着堆栈跟踪检查 components/git/wpt.jslib/wpt/index.jslib/github/tree.js。当未知的 WPT 名称能够以干净的方式退出并显示有用的消息,而不是尝试查找后崩溃时,即表示完成。

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

评估

技术栈
javascript
领域
cli
Issue 类型
缺陷
难度
2/5
预计耗时
1-3 小时
活跃度
冷清
描述清晰度
基本清楚
新手友好度
62/100

把新 issue 发到你的邮箱

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