Name the project contributors
In a previous ticket (which #?), @akavel (or maybe @ibnesayeed) mentioned having a contributors list. While code contributions would establish this on the GitHub interface, we are thankful for bug reports and other contributions. There ought to be a way to ensure those that contribute the latter are recognized in addition to those that contribute code.
https://github.com/mntnr/name-your-contributors might provide a mean of automating this, perhaps via CI or the release.sh script?
If we automate this process to submit changes back to the repo in, say, CONTRIBUTORS.md file, we need to be careful about not not causing a cycle by perhaps ignoring certain files from the build context in the CI system as well as in the DockerHub.
Good call, @ibnesayeed. My objective here is to be more inclusive of GH issues sans explicit code contributions. release.sh might be the best place, as it does not build the project, so should not produce build artifacts.
This sounds like a great idea, to me!
Setting this up to work with Travis should be trivial. Something like
after_script:
- npm i jq name-your-contributors
- node src/cli.js -u oduwsdl -r ipwb | jq '[ .[][].login | " - [@ \(.)](https://github.com/\(.))"]' | jq unique | jq -r .[] > CONTRIBUTORS.md
Just make sure permissions are installed.
@RichardLitt Thanks for the suggestion!
Running this locally via name-your-contributors -u oduwsdl -r ipwb I get:
nyc JSON output:
{
"prCreators": [
{
"login": "machawk1",
"name": "Mat Kelly",
"url": "https://github.com/machawk1",
"count": 99
},
{
"login": "ibnesayeed",
"name": "Sawood Alam",
"url": "https://github.com/ibnesayeed",
"count": 10
}
],
"prCommentators": [
{
"login": "codecov",
"count": 53
},
{
"login": "ibnesayeed",
"name": "Sawood Alam",
"url": "https://github.com/ibnesayeed",
"count": 46
},
{
"login": "machawk1",
"name": "Mat Kelly",
"url": "https://github.com/machawk1",
"count": 44
}
],
"issueCreators": [
{
"login": "machawk1",
"name": "Mat Kelly",
"url": "https://github.com/machawk1",
"count": 240
},
{
"login": "ibnesayeed",
"name": "Sawood Alam",
"url": "https://github.com/ibnesayeed",
"count": 21
},
{
"login": "akavel",
"name": "Mateusz Czapliński",
"url": "https://github.com/akavel",
"count": 9
},
{
"login": "ivilata",
"name": "Ivan Vilata-i-Balaguer",
"url": "https://github.com/ivilata",
"count": 2
},
{
"login": "jbenet",
"name": "Juan Benet",
"url": "https://github.com/jbenet",
"count": 1
},
{
"login": "bobberb",
"name": null,
"url": "https://github.com/bobberb",
"count": 1
},
{
"login": "ikreymer",
"name": "Ilya Kreymer",
"url": "https://github.com/ikreymer",
"count": 1
},
{
"login": "diasdavid",
"name": "David Dias",
"url": "https://github.com/diasdavid",
"count": 1
}
],
"issueCommentators": [
{
"login": "machawk1",
"name": "Mat Kelly",
"url": "https://github.com/machawk1",
"count": 422
},
{
"login": "ibnesayeed",
"name": "Sawood Alam",
"url": "https://github.com/ibnesayeed",
"count": 247
},
{
"login": "akavel",
"name": "Mateusz Czapliński",
"url": "https://github.com/akavel",
"count": 28
},
{
"login": "ikreymer",
"name": "Ilya Kreymer",
"url": "https://github.com/ikreymer",
"count": 8
},
{
"login": "bobberb",
"name": null,
"url": "https://github.com/bobberb",
"count": 6
},
{
"login": "diasdavid",
"name": "David Dias",
"url": "https://github.com/diasdavid",
"count": 6
},
{
"login": "N0taN3rd",
"name": "John Berlin",
"url": "https://github.com/N0taN3rd",
"count": 2
},
{
"login": "phonedude",
"name": "Michael L. Nelson",
"url": "https://github.com/phonedude",
"count": 2
},
{
"login": "jbenet",
"name": "Juan Benet",
"url": "https://github.com/jbenet",
"count": 2
},
{
"login": "ivilata",
"name": "Ivan Vilata-i-Balaguer",
"url": "https://github.com/ivilata",
"count": 2
},
{
"login": "RichardLitt",
"name": "Richard Littauer",
"url": "https://github.com/RichardLitt",
"count": 1
},
{
"login": "VictorBjelkholm",
"name": "ᴠɪᴄᴛᴏʀ ʙᴊᴇʟᴋʜᴏʟᴍ",
"url": "https://github.com/VictorBjelkholm",
"count": 1
},
{
"login": "Kubuxu",
"name": "Jakub Sztandera",
"url": "https://github.com/Kubuxu",
"count": 1
},
{
"login": "whyrusleeping",
"name": "Whyrusleeping",
"url": "https://github.com/whyrusleeping",
"count": 1
}
],
"reviewers": [
{
"login": "machawk1",
"name": "Mat Kelly",
"url": "https://github.com/machawk1",
"count": 24
},
{
"login": "ibnesayeed",
"name": "Sawood Alam",
"url": "https://github.com/ibnesayeed",
"count": 20
}
]
}
...but my system does not seem receptive to the subsequent jq-based piping, e.g.,
name-your-contributors -u oduwsdl -r ipwb | jq '[ .[][].login | " - [@ \(.)](https://github.com/\(.))"]' | jq unique | jq -r .[] > CONTRIBUTORS.md
...throws errors
module.js:540 throw err; ^Error: Cannot find module 'commander'
at Function.Module._resolveFilename (module.js:538:15)
at Function.Module._load (module.js:468:25)
at Module.require (module.js:587:17)
at require (internal/module.js:11:18)
at Object.
Error: Cannot find module 'commander'
at Function.Module._resolveFilename (module.js:538:15)
at Function.Module._load (module.js:468:25)
at Module.require (module.js:587:17)
at require (internal/module.js:11:18)
at Object.
Error: Cannot find module 'commander'
at Function.Module._resolveFilename (module.js:538:15)
at Function.Module._load (module.js:468:25)
at Module.require (module.js:587:17)
at require (internal/module.js:11:18)
at Object.
.
.
Despite this, parsing this JSON one way or the other might be a good way to automate the process for this ticket. Perhaps something bash-based (a la release.sh) would suffice.
I would cat the resultant file and then try jq parsing. This works!
18:37 ~/src/sandbox/sandbox (master) * 🐕 cat result.json | jq '[ .[][].login | " - [@ \(.)](https://github.com/\(.))"]' | jq unique | jq -r .[] > CONTRIBUTORS.md
18:38 ~/src/sandbox/sandbox (master) * 🐕 cat CONTRIBUTORS.md
- [@ Kubuxu](https://github.com/Kubuxu)
- [@ N0taN3rd](https://github.com/N0taN3rd)
- [@ RichardLitt](https://github.com/RichardLitt)
- [@ VictorBjelkholm](https://github.com/VictorBjelkholm)
- [@ akavel](https://github.com/akavel)
- [@ bobberb](https://github.com/bobberb)
- [@ codecov](https://github.com/codecov)
- [@ diasdavid](https://github.com/diasdavid)
- [@ ibnesayeed](https://github.com/ibnesayeed)
- [@ ikreymer](https://github.com/ikreymer)
- [@ ivilata](https://github.com/ivilata)
- [@ jbenet](https://github.com/jbenet)
- [@ machawk1](https://github.com/machawk1)
- [@ phonedude](https://github.com/phonedude)
- [@ whyrusleeping](https://github.com/whyrusleeping)
Thanks again for the followup, @RichardLitt. There was something wonky with jq on my system that I have since resolved. I can replicate your output locally. :+1:
Should we exclude codecov and any other bots from the list?
@ibnesayeed Yes. Any opinion on sorting?
Any opinion on sorting?
Well, that really depends on how detailed do we want to be. We can create separate lists/tables of each category of contributions, list the corresponding count with each name, and sort the list/table entries by count.
And what color should the bike shed be? ;)
"Out of the blue" would a good color, I guess! ;-)
@machawk1 Is this working? :) Need help with anything?
@RichardLitt We have yet to decide how the results ought to be expressed. In the above output, someone making a comment on a repo equates to another user's significant code contributions. While we want to recognize both, some method to sort the results is...in order.
Using the all-contributors spec might help. See this thread: https://github.com/kentcdodds/all-contributors/issues/18