ipwb icon indicating copy to clipboard operation
ipwb copied to clipboard

Name the project contributors

Open machawk1 opened this issue 7 years ago • 14 comments

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?

machawk1 avatar Mar 22 '18 16:03 machawk1

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.

ibnesayeed avatar Mar 22 '18 18:03 ibnesayeed

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.

machawk1 avatar Mar 22 '18 18:03 machawk1

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 avatar Mar 22 '18 18:03 RichardLitt

@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. (/usr/local/npm_packages/lib/node_modules/jq/bin/jq:7:15) at Module._compile (module.js:643:30) at Object.Module._extensions..js (module.js:654:10) at Module.load (module.js:556:32) at tryModuleLoad (module.js:499:12) at Function.Module._load (module.js:491:3) 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. (/usr/local/npm_packages/lib/node_modules/jq/bin/jq:7:15) at Module._compile (module.js:643:30) at Object.Module._extensions..js (module.js:654:10) at Module.load (module.js:556:32) at tryModuleLoad (module.js:499:12) at Function.Module._load (module.js:491:3) 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. (/usr/local/npm_packages/lib/node_modules/jq/bin/jq:7:15) at Module._compile (module.js:643:30) at Object.Module._extensions..js (module.js:654:10) at Module.load (module.js:556:32) at tryModuleLoad (module.js:499:12) at Function.Module._load (module.js:491:3)

.

.

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.

machawk1 avatar Mar 26 '18 22:03 machawk1

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)

RichardLitt avatar Mar 26 '18 22:03 RichardLitt

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:

machawk1 avatar Mar 26 '18 22:03 machawk1

Should we exclude codecov and any other bots from the list?

ibnesayeed avatar Mar 26 '18 22:03 ibnesayeed

@ibnesayeed Yes. Any opinion on sorting?

machawk1 avatar Mar 26 '18 23:03 machawk1

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.

ibnesayeed avatar Mar 27 '18 00:03 ibnesayeed

And what color should the bike shed be? ;)

machawk1 avatar Mar 27 '18 00:03 machawk1

"Out of the blue" would a good color, I guess! ;-)

ibnesayeed avatar Mar 27 '18 00:03 ibnesayeed

@machawk1 Is this working? :) Need help with anything?

RichardLitt avatar Apr 14 '18 18:04 RichardLitt

@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.

machawk1 avatar Apr 14 '18 19:04 machawk1

Using the all-contributors spec might help. See this thread: https://github.com/kentcdodds/all-contributors/issues/18

RichardLitt avatar Apr 14 '18 19:04 RichardLitt