Browse Source

Initial commit

master
Sven Slootweg 7 months ago
commit
bbfe34c26b
  1. 2
      .gitignore
  2. 1
      all-issues.json
  3. 18
      grab-all.js
  4. 22
      index.js
  5. 47
      match.js
  6. 5
      notes.txt
  7. 20
      package.json
  8. 1
      packages.json
  9. 1
      update-issues.sh
  10. 1
      update-packages.sh
  11. 310
      yarn.lock

2
.gitignore

@ -0,0 +1,2 @@
junk
node_modules

1
all-issues.json

File diff suppressed because one or more lines are too long

18
grab-all.js

@ -0,0 +1,18 @@
"use strict";
const Promise = require("bluebird");
const bhttp = require("bhttp");
const range = require("range").range;
const shuffleArray = require("shuffle-array");
// https://api.github.com/repos/nixos/nixpkgs/issues?per_page=100
Promise.map(range(0, 28), (i) => {
return bhttp.get(`https://api.github.com/repos/nixos/nixpkgs/issues?per_page=100&page=${i}`);
}).reduce((all, response) => {
return all.concat(response.body);
}, []).filter((item) => {
return (item.pull_request == null);
}).then((results) => {
console.log(JSON.stringify(results));
});

22
index.js

@ -0,0 +1,22 @@
"use strict";
const Promise = require("bluebird");
const bhttp = require("bhttp");
const range = require("range").range;
const shuffleArray = require("shuffle-array");
// https://api.github.com/repos/nixos/nixpkgs/issues?per_page=100
Promise.map(range(0, 28), (i) => {
return bhttp.get(`https://api.github.com/repos/nixos/nixpkgs/issues?per_page=100&page=${i}`);
}).reduce((all, response) => {
return all.concat(response.body);
}, []).filter((item) => {
return (item.pull_request == null);
}).then((results) => {
shuffleArray(results);
console.log(results.slice(0, 100).map((item) => {
return item.html_url;
}));
});

47
match.js

@ -0,0 +1,47 @@
"use strict";
const chalk = require("chalk");
const escapeRegexString = require("escape-regex-string");
const packages = require("./packages.json");
const issues = require("./all-issues.json");
let blacklist = new Set(["file", "at", "boot", "instead", "check", "more", "non", "roundup", "root", "screen", "src", "t", "which", "arguments", "wrap", "up", "unit", "units"]);
function normalizeString(string) {
return string.replace(/'/g, "").replace(/[^a-zA-Z0-9]/g, " ").replace(/\s{2,}/g, " ");
}
let classifiedIssues = new Set();
packages.filter((pkg) => {
return !blacklist.has(pkg);
}).forEach((pkg) => {
let searchString = normalizeString(pkg);
let regex = new RegExp(`\\b${escapeRegexString(searchString)}\\b`)
let matches = issues.filter((issue) => {
if (issue.title != null) {
let normalizedTitle = normalizeString(issue.title);
return regex.test(normalizedTitle);
} else {
// occurs on rate-limiting errors
return false;
}
});
matches.forEach((issue) => {
classifiedIssues.add(issue.id);
});
if (matches.length > 0) {
console.log(chalk.yellow.bold(pkg));
matches.forEach((match) => {
console.log(`\t ${chalk.bold(`#${match.number}`)} ${match.title}`);
});
}
});
console.log(`Classified ${classifiedIssues.size} issues. Failed to classify ${issues.length - classifiedIssues.size} issues.`);

5
notes.txt

@ -0,0 +1,5 @@
old packages.json (july 25, 2020), new all-issues.json (april 4, 2022)
Classified 503 issues. Failed to classify 492 issues.
new packages.json (april 4, 2022), new all-issues.json (april 4, 2022)
Classified 636 issues. Failed to classify 359 issues.

20
package.json

@ -0,0 +1,20 @@
{
"name": "nixpkgs-gh-issues",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"bhttp": "^1.2.4",
"bluebird": "^3.5.3",
"chalk": "^2.4.2",
"escape-regex-string": "^1.0.6",
"range": "^0.0.3",
"shuffle-array": "^1.0.1"
}
}

1
packages.json

File diff suppressed because one or more lines are too long

1
update-issues.sh

@ -0,0 +1 @@
node grab-all.js > all-issues.json

1
update-packages.sh

@ -0,0 +1 @@
nix-instantiate --json --eval --expr 'builtins.attrNames (import <nixpkgs> {})' > packages.json

310
yarn.lock

@ -0,0 +1,310 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
ansi-styles@^3.2.1:
version "3.2.1"
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d"
integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==
dependencies:
color-convert "^1.9.0"
bhttp@^1.2.4:
version "1.2.4"
resolved "https://registry.yarnpkg.com/bhttp/-/bhttp-1.2.4.tgz#fed0c24f765b35afc4940b08ab3214813e38f38f"
integrity sha1-/tDCT3ZbNa/ElAsIqzIUgT44848=
dependencies:
bluebird "^2.8.2"
concat-stream "^1.4.7"
debug "^2.1.1"
dev-null "^0.1.1"
errors "^0.2.0"
extend "^2.0.0"
form-data2 "^1.0.0"
form-fix-array "^1.0.0"
lodash "^2.4.1"
stream-length "^1.0.2"
string "^3.0.0"
through2-sink "^1.0.0"
through2-spy "^1.2.0"
tough-cookie "^2.3.1"
bluebird@^2.6.2, bluebird@^2.8.1, bluebird@^2.8.2:
version "2.11.0"
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-2.11.0.tgz#534b9033c022c9579c56ba3b3e5a5caafbb650e1"
integrity sha1-U0uQM8AiyVecVro7Plpcqvu2UOE=
bluebird@^3.5.3:
version "3.5.3"
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.3.tgz#7d01c6f9616c9a51ab0f8c549a79dfe6ec33efa7"
integrity sha512-/qKPUQlaW1OyR51WeCPBvRnAlnZFUJkCSG5HzGnuIqhgyJtF+T94lFnn33eiazjRm2LAHVy2guNnaq48X9SJuw==
buffer-from@^1.0.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef"
integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==
chalk@^2.4.2:
version "2.4.2"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"
integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==
dependencies:
ansi-styles "^3.2.1"
escape-string-regexp "^1.0.5"
supports-color "^5.3.0"
color-convert@^1.9.0:
version "1.9.3"
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8"
integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==
dependencies:
color-name "1.1.3"
color-name@1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25"
integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=
combined-stream2@^1.0.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/combined-stream2/-/combined-stream2-1.1.2.tgz#f6e14b7a015666f8c7b0a1fac506240164ac3570"
integrity sha1-9uFLegFWZvjHsKH6xQYkAWSsNXA=
dependencies:
bluebird "^2.8.1"
debug "^2.1.1"
stream-length "^1.0.1"
concat-stream@^1.4.7:
version "1.6.2"
resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34"
integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==
dependencies:
buffer-from "^1.0.0"
inherits "^2.0.3"
readable-stream "^2.2.2"
typedarray "^0.0.6"
core-util-is@~1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=
debug@^2.1.1:
version "2.6.9"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==
dependencies:
ms "2.0.0"
dev-null@^0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/dev-null/-/dev-null-0.1.1.tgz#5a205ce3c2b2ef77b6238d6ba179eb74c6a0e818"
integrity sha1-WiBc48Ky73e2I41roXnrdMag6Bg=
errors@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/errors/-/errors-0.2.0.tgz#0f51e889daa3e11b19e7186d11f104aa66eb2403"
integrity sha1-D1Hoidqj4RsZ5xhtEfEEqmbrJAM=
escape-regex-string@^1.0.6:
version "1.0.6"
resolved "https://registry.yarnpkg.com/escape-regex-string/-/escape-regex-string-1.0.6.tgz#f536d8997ab19ec395385dcf2ea28b4e080899eb"
integrity sha512-AcaPwAOKpF52ETT4uu4vmpqQphuQGjIEhdDwG/gAJYah8ixJlrSBFjhtLMT7frc9y3RWgOnLov9E0MsRBdeRbw==
escape-string-regexp@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=
extend@^2.0.0:
version "2.0.2"
resolved "https://registry.yarnpkg.com/extend/-/extend-2.0.2.tgz#1b74985400171b85554894459c978de6ef453ab7"
integrity sha512-AgFD4VU+lVLP6vjnlNfF7OeInLTyeyckCNPEsuxz1vi786UuK/nk6ynPuhn/h+Ju9++TQyr5EpLRI14fc1QtTQ==
form-data2@^1.0.0:
version "1.0.3"
resolved "https://registry.yarnpkg.com/form-data2/-/form-data2-1.0.3.tgz#cba5e23601a6944d95ab7d7111ff9397a5cb2a4d"
integrity sha1-y6XiNgGmlE2Vq31xEf+Tl6XLKk0=
dependencies:
bluebird "^2.8.2"
combined-stream2 "^1.0.2"
debug "^2.1.1"
lodash "^2.4.1"
mime "^1.2.11"
uuid "^2.0.1"
form-fix-array@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/form-fix-array/-/form-fix-array-1.0.0.tgz#a1347a47e53117ab7bcdbf3e2f3ec91c66769bc8"
integrity sha1-oTR6R+UxF6t7zb8+Lz7JHGZ2m8g=
has-flag@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd"
integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0=
inherits@^2.0.3, inherits@~2.0.1, inherits@~2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=
isarray@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf"
integrity sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=
isarray@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=
lodash@^2.4.1:
version "2.4.2"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-2.4.2.tgz#fadd834b9683073da179b3eae6d9c0d15053f73e"
integrity sha1-+t2DS5aDBz2hebPq5tnA0VBT9z4=
mime@^1.2.11:
version "1.6.0"
resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1"
integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==
ms@2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=
process-nextick-args@~2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa"
integrity sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==
psl@^1.1.28:
version "1.1.31"
resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.31.tgz#e9aa86d0101b5b105cbe93ac6b784cd547276184"
integrity sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==
punycode@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec"
integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==
range@^0.0.3:
version "0.0.3"
resolved "https://registry.yarnpkg.com/range/-/range-0.0.3.tgz#b5b8eb2463a516b624a563bd32b18fe89e70151b"
integrity sha1-tbjrJGOlFrYkpWO9MrGP6J5wFRs=
readable-stream@^2.2.2:
version "2.3.6"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf"
integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==
dependencies:
core-util-is "~1.0.0"
inherits "~2.0.3"
isarray "~1.0.0"
process-nextick-args "~2.0.0"
safe-buffer "~5.1.1"
string_decoder "~1.1.1"
util-deprecate "~1.0.1"
readable-stream@~1.0.17:
version "1.0.34"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c"
integrity sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=
dependencies:
core-util-is "~1.0.0"
inherits "~2.0.1"
isarray "0.0.1"
string_decoder "~0.10.x"
safe-buffer@~5.1.0, safe-buffer@~5.1.1:
version "5.1.2"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==
shuffle-array@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/shuffle-array/-/shuffle-array-1.0.1.tgz#c4ff3cfe74d16f93730592301b25e6577b12898b"
integrity sha1-xP88/nTRb5NzBZIwGyXmV3sSiYs=
stream-length@^1.0.1, stream-length@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/stream-length/-/stream-length-1.0.2.tgz#8277f3cbee49a4daabcfdb4e2f4a9b5e9f2c9f00"
integrity sha1-gnfzy+5JpNqrz9tOL0qbXp8snwA=
dependencies:
bluebird "^2.6.2"
string@^3.0.0:
version "3.3.3"
resolved "https://registry.yarnpkg.com/string/-/string-3.3.3.tgz#5ea211cd92d228e184294990a6cc97b366a77cb0"
integrity sha1-XqIRzZLSKOGEKUmQpsyXs2anfLA=
string_decoder@~0.10.x:
version "0.10.31"
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94"
integrity sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=
string_decoder@~1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8"
integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==
dependencies:
safe-buffer "~5.1.0"
supports-color@^5.3.0:
version "5.5.0"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f"
integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==
dependencies:
has-flag "^3.0.0"
through2-sink@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/through2-sink/-/through2-sink-1.0.0.tgz#5f106bba1d7330dad3cba5c0ab1863923256c399"
integrity sha1-XxBruh1zMNrTy6XAqxhjkjJWw5k=
dependencies:
through2 "~0.5.1"
xtend "~3.0.0"
through2-spy@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/through2-spy/-/through2-spy-1.2.0.tgz#9c891ca9ca40e1e1e4cf31e1ac57f94cc9d248cb"
integrity sha1-nIkcqcpA4eHkzzHhrFf5TMnSSMs=
dependencies:
through2 "~0.5.1"
xtend "~3.0.0"
through2@~0.5.1:
version "0.5.1"
resolved "https://registry.yarnpkg.com/through2/-/through2-0.5.1.tgz#dfdd012eb9c700e2323fd334f38ac622ab372da7"
integrity sha1-390BLrnHAOIyP9M084rGIqs3Lac=
dependencies:
readable-stream "~1.0.17"
xtend "~3.0.0"
tough-cookie@^2.3.1:
version "2.5.0"
resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2"
integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==
dependencies:
psl "^1.1.28"
punycode "^2.1.1"
typedarray@^0.0.6:
version "0.0.6"
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
util-deprecate@~1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=
uuid@^2.0.1:
version "2.0.3"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a"
integrity sha1-Z+LoY3lyFVMN/zGOW/nc6/1Hsho=
xtend@~3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/xtend/-/xtend-3.0.0.tgz#5cce7407baf642cba7becda568111c493f59665a"
integrity sha1-XM50B7r2Qsunvs2laBEcST9ZZlo=
Loading…
Cancel
Save