diff --git a/collect-commit-labels.js b/collect-commit-labels.js index d0f3918..b0d5c6a 100644 --- a/collect-commit-labels.js +++ b/collect-commit-labels.js @@ -1,7 +1,7 @@ 'use strict' import { auth } from './auth.js' -import ghissues from 'ghissues' +import { get as ghget } from 'ghissues' import async from 'async' export async function collectCommitLabels (list) { @@ -39,15 +39,7 @@ export async function collectCommitLabels (list) { // from hitting the network at the same time, immediately assign a Promise // to the cache that all commits with the same ghIssue value will use. const key = `${commit.ghUser}/${commit.ghProject}#${commit.ghIssue}` - cache[key] = cache[key] || new Promise((resolve, reject) => { - ghissues.get(authData, commit.ghUser, commit.ghProject, commit.ghIssue, (err, issue) => { - if (err) { - return reject(err) - } - - resolve(issue) - }) - }) + cache[key] = cache[key] || ghget(authData, commit.ghUser, commit.ghProject, commit.ghIssue) cache[key].then((val) => onFetch(null, val), (err) => onFetch(err)) }, 15) diff --git a/package-lock.json b/package-lock.json index 541ffbe..cb90d95 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "commit-stream": "^2.2.0", "debug": "^4.3.4", "ghauth": "^7.0.0", - "ghissues": "^1.1.4", + "ghissues": "^2.0.0", "gitexec": "^2.0.1", "minimist": "^1.2.8", "pkg-to-id": "^0.0.3", @@ -3020,12 +3020,6 @@ "ieee754": "^1.1.13" } }, - "node_modules/buffer-from": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-0.1.2.tgz", - "integrity": "sha512-RiWIenusJsmI2KcvqQABB83tLxCByE3upSP8QU3rJDMVFGPWLvPQJt/O1Su9moRWeH7d+Q2HYb68f6+v+tw2vg==", - "license": "MIT" - }, "node_modules/builtins": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.1.0.tgz", @@ -4038,6 +4032,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "dev": true, "license": "MIT" }, "node_modules/cosmiconfig": { @@ -4366,39 +4361,6 @@ "node": ">= 0.4" } }, - "node_modules/duplexer2": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.0.2.tgz", - "integrity": "sha512-+AWBwjGadtksxjOQSFDhPNQbed7icNXApT4+2BNpsXzcCBiInq2H9XW0O8sfHFaPmnQRs7cg/P0fAr2IWQSW0g==", - "license": "BSD", - "dependencies": { - "readable-stream": "~1.1.9" - } - }, - "node_modules/duplexer2/node_modules/isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", - "license": "MIT" - }, - "node_modules/duplexer2/node_modules/readable-stream": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", - "integrity": "sha512-+MeVjFf4L44XUkhM1eYbD8fyEsxcV81pqMSR5gblfcLCHfZvbrqy4/qYHE+/R5HoBUT11WV5O08Cr1n3YXkWVQ==", - "license": "MIT", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "node_modules/duplexer2/node_modules/string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==", - "license": "MIT" - }, "node_modules/eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", @@ -6055,21 +6017,24 @@ } }, "node_modules/ghissues": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/ghissues/-/ghissues-1.1.4.tgz", - "integrity": "sha512-YFBe75cEank9WogH1i1kRqDoH8Z+l+O9Y/CopmWCGhsOg9NR0PdMo8E+8THTwCXFAFv4NPhqLQOOPZypnDStjQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ghissues/-/ghissues-2.0.0.tgz", + "integrity": "sha512-LMqvSO8pMG+g9TqZoTkNDitIYX/pa8mdAiAMmUEqAkt52/i8zgGkz6ZMo/KywaPXJ7o/JpoUjQbRgVak9P5zgw==", "license": "MIT", "dependencies": { - "ghutils": "^4.0.0" + "ghutils": "^5.0.0" + }, + "engines": { + "node": ">=20" } }, "node_modules/ghutils": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/ghutils/-/ghutils-4.0.0.tgz", - "integrity": "sha512-WRme8qe6SX0WCN1cY9F4hE8/dhjZti2q7i7cDuT0kV7PZZrGceFRNP5ZSQM1+RjHpcqvODQi5YSZSsqG+Yk3zQ==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/ghutils/-/ghutils-5.0.2.tgz", + "integrity": "sha512-B5OPduYDQ8+4kPuj8F9Yi5U6PaEpTHMNhvyD1yree9mjZEcNrP2UW5MRnn67J2L20yetPVpQe0qC+OEeV5Q6bw==", "license": "MIT", - "dependencies": { - "jsonist": "~3.0.1" + "engines": { + "node": ">=20" } }, "node_modules/git-log-parser": { @@ -6469,51 +6434,6 @@ "node": ">=10.17.0" } }, - "node_modules/hyperquest": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/hyperquest/-/hyperquest-2.1.3.tgz", - "integrity": "sha512-fUuDOrB47PqNK/BAMOS13v41UoaqIxqSLHX6CAbOD7OfT+/GCWO1/vPLfTNutOeXrv1ikuaZ3yux+33Z9vh+rw==", - "license": "MIT", - "dependencies": { - "buffer-from": "^0.1.1", - "duplexer2": "~0.0.2", - "through2": "~0.6.3" - } - }, - "node_modules/hyperquest/node_modules/isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", - "license": "MIT" - }, - "node_modules/hyperquest/node_modules/readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg==", - "license": "MIT", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "node_modules/hyperquest/node_modules/string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==", - "license": "MIT" - }, - "node_modules/hyperquest/node_modules/through2": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", - "integrity": "sha512-RkK/CCESdTKQZHdmKICijdKKsCRVHs5KsLZ6pACAmF/1GPUQhonHSXWNERctxEp7RmvjdNbZTL5z9V7nSCXKcg==", - "license": "MIT", - "dependencies": { - "readable-stream": ">=1.0.33-1 <1.1.0-0", - "xtend": ">=4.0.0 <4.1.0-0" - } - }, "node_modules/iconv-lite": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", @@ -7611,12 +7531,6 @@ "dev": true, "license": "MIT" }, - "node_modules/json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", - "license": "ISC" - }, "node_modules/json5": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", @@ -7643,28 +7557,6 @@ "graceful-fs": "^4.1.6" } }, - "node_modules/jsonist": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/jsonist/-/jsonist-3.0.1.tgz", - "integrity": "sha512-+lrAqdk5BO36j5RG7MSY2M8XqBqBwJRt/+iSfLmpelBBsi0kFflqhtlROeioDA5MlHNhZxm0Doslr7QSRzCqTQ==", - "license": "MIT", - "dependencies": { - "bl": "~4.0.0", - "hyperquest": "~2.1.3", - "json-stringify-safe": "~5.0.1" - } - }, - "node_modules/jsonist/node_modules/bl": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/bl/-/bl-4.0.4.tgz", - "integrity": "sha512-7tdr4EpSd7jJ6tuQ21vu2ke8w7pNEstzj1O8wwq6sNNzO3UDi5MA8Gny/gquCj7r2C6fHudg8tKRGyjRgmvNxQ==", - "license": "MIT", - "dependencies": { - "buffer": "^5.5.0", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" - } - }, "node_modules/jsonparse": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", @@ -16752,6 +16644,7 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true, "license": "MIT", "engines": { "node": ">=0.4" diff --git a/package.json b/package.json index f2c9ac7..55b41ed 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "commit-stream": "^2.2.0", "debug": "^4.3.4", "ghauth": "^7.0.0", - "ghissues": "^1.1.4", + "ghissues": "^2.0.0", "gitexec": "^2.0.1", "minimist": "^1.2.8", "pkg-to-id": "^0.0.3",