Suggestion: add contributing instructions


(David Piepgrass) #1

zkat suggested submitting a PR for npm but wait, how? There are no instructions in CONTRIBUTING.md for how to work on npm.

So I guessed…

  1. Fork the repo
  2. npm install
  3. Examine the error message.
  4. npm install --global rimraf
  5. npm install again
  6. npm test
  7. Wait a long time for stuff to start happening
  8. Wait a long time for tests to run
  9. Notice that lots of the tests are failing (the first failing test soon scrolled its way out of the terminal buffer, but eventually I Ctrl+C restarted the tests and noticed that the first failing test was “not ok git started up successfully”. But git is installed and is in my PATH.)

At this point I wonder,

  1. What did I do wrong?
  2. If I make a change, how do I check if it was correct? Do I have to make a new test for the change? If so, how?
  3. Since the tests take a long time to execute, how do I set up a fast edit-test cycle for the one tiny thing I’m working on?

As I post this, the tests are still going like Energizer bunny… edit results:

4638 passing (30m)
  19 pending
  57 failing

(Kat Marchán) #2

This sounds like a great idea to document!

We’ll of course want full docs for different kinds of contributors, but the high-level version looks something like this:

  1. $ git clone git@github.com:<you>/npm.git && cd npm
  2. $ npm install
  3. $ make link
  4. Write your patch
  5. npm t // This will take a LONG time. Around 5-10 minutes. It’s a big and old test suite that’s gonna take a lot of work to speed up.
  6. Push to your clone and make a PR. Wait an hour or two for CI to run on all the CI platorms.

If the above doesn’t work as-is, then I consider those bugs in our onboarding process and I would love to have them addressed individually.