contributing.rst 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. ============
  2. Contributing
  3. ============
  4. Contributions to distro-tracker are greatly appreciated!
  5. You can contribute in many ways, be it writing documentation and blog
  6. posts, or fixing bugs and implementing new features.
  7. Join the community
  8. ------------------
  9. The recommended way to send feedback is to write to the Debian Quality
  10. Assurance mailing list <debian-qa@lists.debian.org>. You can also reach us
  11. using IRC on the #debian-qa channel at irc.debian.org.
  12. You can also report bugs against the `tracker.debian.org pseudo-package
  13. <https://bugs.debian.org/cgi-bin/pkgreport.cgi?pkg=tracker.debian.org>`_, to do so
  14. please follow `the usual instructions
  15. <https://www.debian.org/Bugs/Reporting>`_.
  16. When you report a bug, ensure you include detailed steps to reproduce it
  17. and any details that might be helpful in troubleshooting.
  18. If you are proposing a feature, please explain in detail how it would work,
  19. and keep the scope as narrow as possible, to make it easier to implement.
  20. If you do not know where to start, we have `a list of tasks suitable for
  21. newcomers
  22. <https://bugs.debian.org/cgi-bin/pkgreport.cgi?dist=unstable;package=tracker.debian.org;tag=newcomer>`_,
  23. mentors will review your changes with special care when you try to tackle
  24. those.
  25. Please remember this is a volunteer-driven project, and that contributions are
  26. welcome.
  27. Contribute
  28. ----------
  29. Ready to contribute? Here's how to set up `distro-tracker` for local
  30. development:
  31. Usual workflow
  32. ~~~~~~~~~~~~~~
  33. 1. Clone distro-tracker locally::
  34. $ git clone git://anonscm.debian.org/qa/distro-tracker.git
  35. Note that you can also browse the sources at
  36. https://anonscm.debian.org/cgit/qa/distro-tracker.git
  37. 2. Follow the steps in the chapter :ref:`setting-up`.
  38. 3. Start a local test server::
  39. $ ./manage.py runserver
  40. [...]
  41. Starting development server at http://127.0.0.1:8000/
  42. Quit the server with CONTROL-C.
  43. Visit the URL returned to have access to the test website.
  44. 4. Configure the package repositories as explained in
  45. :ref:`repositories`. With your test server, the URL of
  46. the admin web interface is http://127.0.0.1:8000/admin/.
  47. 5. Switch to a new branch::
  48. $ git checkout -b name-of-your-bugfix-or-feature
  49. 6. Develop your new feature, ideally following the rules of :ref:`tdd`.
  50. 7. When you're done, check that all tests are succeeding in all
  51. supported platforms::
  52. $ tox
  53. This basically runs “./manage.py test” with multiple versions
  54. of Django and Python.
  55. 8. Push your changes on a public repository or send them by
  56. email to the Debian Quality Assurance team::
  57. $ git format-patch -o . origin/master
  58. $ mutt debian-qa@lists.debian.org -a *.patch
  59. .. _tdd:
  60. Test Driven Development
  61. ~~~~~~~~~~~~~~~~~~~~~~~
  62. Have a look at `Test-Driven Web Development with Python
  63. <http://www.obeythetestinggoat.com/>`_ if you don't know yet about this
  64. development methodology.
  65. The suggested workflow looks like this:
  66. 1. Add a functional test that covers the new feature from the point of
  67. view of the user. This test will fail since the feature doesn't exist
  68. yet.
  69. 2. Think about what's the next step to let the functional test go
  70. further (i.e. fail later).
  71. 3. Write a failing unit test for the new code that you want to write.
  72. 4. Write the minimal code to make your unit test pass. You will
  73. typically run this very often::
  74. $ ./manage.py test path-to-the-testing-folder
  75. 5. Refactor (if needed). You might have introduced some duplication in
  76. your code or in your tests. Clean that up now before it's too late.
  77. 6. Commit (optional). Commit together the (working) unit tests and the
  78. new code.
  79. 7. If you made progress from the functional tests point of view, go back
  80. to point 2, otherwise go back to point 3. If the functional test
  81. passes, continue.
  82. 8. Commit. The functional tests are committed at this point to ensure
  83. that they are committed in a working state::
  84. $ git add .
  85. $ git commit
  86. When you don't develop a new feature, your workflow is restricted to steps
  87. 3 to 6.
  88. Conventions
  89. ~~~~~~~~~~~
  90. 1. In regard to coding style, we observe `PEP8\
  91. <http://legacy.python.org/dev/peps/pep-0008/>`_ with a few exceptions.
  92. 2. Functions are documented using doctrings with `Sphinx markup
  93. <http://sphinx-doc.org/contents.html>`_.
  94. Write access to the git repository
  95. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  96. Debian developers in the "qa" group have write access to the
  97. repository and should use the following command to checkout
  98. a git repository where they can push changes::
  99. $ git clone ssh://<yourdebianlogin>@git.debian.org/git/qa/distro-tracker.git
  100. Anyone with commit access can use topic branches in the
  101. “people/`debianlogin`/” hierarchy.