nodejs / nodejs/node-core-utils

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

Aperta Adatta ai principianti
#664 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

bug
Lingua principale
JavaScript
Stelle
314
Fork
137
Merge medio
2g 8h
PR unite (30g)
24

Descrizione

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?"

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia riproducendo git node wpt File, poi ispeziona components/git/wpt.js, lib/wpt/index.js e lib/github/tree.js lungo lo stack trace. Il lavoro è terminato quando un nome WPT sconosciuto termina correttamente con un messaggio utile, invece di tentare la ricerca e andare in crash.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript
Ambito
cli
Tipo di issue
Bug
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
62/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.