triaging-tickets.txt 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468
  1. ================
  2. Triaging tickets
  3. ================
  4. Django uses Trac_ for managing the work on the code base. Trac is a
  5. community-tended garden of the bugs people have found and the features people
  6. would like to see added. As in any garden, sometimes there are weeds to be
  7. pulled and sometimes there are flowers and vegetables that need picking. We need
  8. your help to sort out one from the other, and in the end, we all benefit
  9. together.
  10. Like all gardens, we can aspire to perfection, but in reality there's no such
  11. thing. Even in the most pristine garden there are still snails and insects.
  12. In a community garden there are also helpful people who -- with the best of
  13. intentions -- fertilize the weeds and poison the roses. It's the job of the
  14. community as a whole to self-manage, keep the problems to a minimum, and
  15. educate those coming into the community so that they can become valuable
  16. contributing members.
  17. Similarly, while we aim for Trac to be a perfect representation of the state of
  18. Django's progress, we acknowledge that this will not happen. By distributing
  19. the load of Trac maintenance to the community, we accept that there will be
  20. mistakes. Trac is "mostly accurate", and we give allowances for the fact that
  21. sometimes it will be wrong. That's okay. We're perfectionists with deadlines.
  22. We rely on the community to keep participating, keep tickets as accurate as
  23. possible, and raise issues for discussion on our mailing lists when there is
  24. confusion or disagreement.
  25. Django is a community project, and every contribution helps. We can't do this
  26. without **you**!
  27. Triage workflow
  28. ===============
  29. Unfortunately, not all bug reports and feature requests in the ticket tracker
  30. provide all the :doc:`required details<bugs-and-features>`. A number of
  31. tickets have proposed solutions, but those don't necessarily meet all the
  32. requirements :ref:`adhering to the guidelines for contributing <patch-style>`.
  33. One way to help out is to *triage* tickets that have been created by other
  34. users.
  35. Most of the workflow is based around the concept of a ticket's
  36. :ref:`triage stages <triage-stages>`. Each stage describes where in its
  37. lifetime a given ticket is at any time. Along with a handful of flags, this
  38. attribute easily tells us what and who each ticket is waiting on.
  39. Since a picture is worth a thousand words, let's start there:
  40. .. image:: /internals/_images/triage_process.*
  41. :height: 750
  42. :width: 600
  43. :alt: Django's ticket triage workflow
  44. We've got two roles in this diagram:
  45. * Mergers: people with commit access who are responsible for making the
  46. final decision to merge a change.
  47. * Ticket triagers: anyone in the Django community who chooses to
  48. become involved in Django's development process. Our Trac installation
  49. is intentionally left open to the public, and anyone can triage tickets.
  50. Django is a community project, and we encourage :ref:`triage by the
  51. community<how-can-i-help-with-triaging>`.
  52. By way of example, here we see the lifecycle of an average ticket:
  53. * Alice creates a ticket and sends an incomplete pull request (no tests,
  54. incorrect implementation).
  55. * Bob reviews the pull request, marks the ticket as "Accepted", "needs tests",
  56. and "patch needs improvement", and leaves a comment telling Alice how the
  57. patch could be improved.
  58. * Alice updates the pull request, adding tests (but not changing the
  59. implementation). She removes the two flags.
  60. * Charlie reviews the pull request and resets the "patch needs improvement"
  61. flag with another comment about improving the implementation.
  62. * Alice updates the pull request, fixing the implementation. She removes the
  63. "patch needs improvement" flag.
  64. * Daisy reviews the pull request and marks the ticket as "Ready for checkin".
  65. * Jacob, a :ref:`merger <mergers-team>`, reviews the pull request and merges
  66. it.
  67. Some tickets require much less feedback than this, but then again some tickets
  68. require much much more.
  69. .. _triage-stages:
  70. Triage stages
  71. =============
  72. Below we describe in more detail the various stages that a ticket may flow
  73. through during its lifetime.
  74. Unreviewed
  75. ----------
  76. The ticket has not been reviewed by anyone who felt qualified to make a
  77. judgment about whether the ticket contained a valid issue, a viable feature,
  78. or ought to be closed for any of the various reasons.
  79. Accepted
  80. --------
  81. The big gray area! The absolute meaning of "accepted" is that the issue
  82. described in the ticket is valid and is in some stage of being worked on.
  83. Beyond that there are several considerations:
  84. * **Accepted + No Flags**
  85. The ticket is valid, but no one has submitted a patch for it yet. Often this
  86. means you could safely start writing a fix for it. This is generally more
  87. true for the case of accepted bugs than accepted features. A ticket for a bug
  88. that has been accepted means that the issue has been verified by at least one
  89. triager as a legitimate bug - and should probably be fixed if possible. An
  90. accepted new feature may only mean that one triager thought the feature would
  91. be good to have, but this alone does not represent a consensus view or imply
  92. with any certainty that a patch will be accepted for that feature. Seek more
  93. feedback before writing an extensive contribution if you are in doubt.
  94. * **Accepted + Has Patch**
  95. The ticket is waiting for people to review the supplied solution. This means
  96. downloading the patch and trying it out, verifying that it contains tests
  97. and docs, running the test suite with the included patch, and leaving
  98. feedback on the ticket.
  99. * **Accepted + Has Patch + Needs ...**
  100. This means the ticket has been reviewed, and has been found to need further
  101. work. "Needs tests" and "Needs documentation" are self-explanatory. "Patch
  102. needs improvement" will generally be accompanied by a comment on the ticket
  103. explaining what is needed to improve the code.
  104. Ready For Checkin
  105. -----------------
  106. The ticket was reviewed by any member of the community other than the person
  107. who supplied the patch and found to meet all the requirements for a
  108. commit-ready contribution. A :ref:`merger <mergers-team>` now needs to give
  109. a final review prior to being committed.
  110. There are a lot of pull requests. It can take a while for your patch to get
  111. reviewed. See the :ref:`contributing code FAQ<new-contributors-faq>` for some
  112. ideas here.
  113. Someday/Maybe
  114. -------------
  115. This stage isn't shown on the diagram. It's used sparingly to keep track of
  116. high-level ideas or long-term feature requests.
  117. These tickets are uncommon and overall less useful since they don't describe
  118. concrete actionable issues. They are enhancement requests that we might
  119. consider adding someday to the framework if an excellent patch is submitted.
  120. They are not a high priority.
  121. Other triage attributes
  122. =======================
  123. A number of flags, appearing as checkboxes in Trac, can be set on a ticket:
  124. Has patch
  125. ---------
  126. This means the ticket has an associated solution. These will be reviewed to
  127. ensure they adhere to the :doc:`documented guidelines
  128. <writing-code/submitting-patches>`.
  129. The following three fields (Needs documentation, Needs tests,
  130. Patch needs improvement) apply only if a patch has been supplied.
  131. Needs documentation
  132. -------------------
  133. This flag is used for tickets with patches that need associated
  134. documentation. Complete documentation of features is a prerequisite
  135. before we can check them into the codebase.
  136. Needs tests
  137. -----------
  138. This flags the patch as needing associated unit tests. Again, this
  139. is a required part of a valid contribution.
  140. Patch needs improvement
  141. -----------------------
  142. This flag means that although the ticket *has* a solution, it's not quite
  143. ready for checkin. This could mean the patch no longer applies
  144. cleanly, there is a flaw in the implementation, or that the code
  145. doesn't meet our standards.
  146. Easy pickings
  147. -------------
  148. Tickets that would require small, easy, changes.
  149. Type
  150. ----
  151. Tickets should be categorized by *type* between:
  152. * New Feature
  153. For adding something new.
  154. * Bug
  155. For when an existing thing is broken or not behaving as expected.
  156. * Cleanup/optimization
  157. For when nothing is broken but something could be made cleaner,
  158. better, faster, stronger.
  159. Component
  160. ---------
  161. Tickets should be classified into *components* indicating which area of
  162. the Django codebase they belong to. This makes tickets better organized and
  163. easier to find.
  164. Severity
  165. --------
  166. The *severity* attribute is used to identify blockers, that is, issues that
  167. should get fixed before releasing the next version of Django. Typically those
  168. issues are bugs causing regressions from earlier versions or potentially
  169. causing severe data losses. This attribute is quite rarely used and the vast
  170. majority of tickets have a severity of "Normal".
  171. Version
  172. -------
  173. It is possible to use the *version* attribute to indicate in which
  174. version the reported bug was identified.
  175. UI/UX
  176. -----
  177. This flag is used for tickets that relate to User Interface and User
  178. Experiences questions. For example, this flag would be appropriate for
  179. user-facing features in forms or the admin interface.
  180. Cc
  181. --
  182. You may add your username or email address to this field to be notified when
  183. new contributions are made to the ticket.
  184. Keywords
  185. --------
  186. With this field you may label a ticket with multiple keywords. This can be
  187. useful, for example, to group several tickets on the same theme. Keywords can
  188. either be comma or space separated. Keyword search finds the keyword string
  189. anywhere in the keywords. For example, clicking on a ticket with the keyword
  190. "form" will yield similar tickets tagged with keywords containing strings such
  191. as "formset", "modelformset", and "ManagementForm".
  192. .. _closing-tickets:
  193. Closing Tickets
  194. ===============
  195. When a ticket has completed its useful lifecycle, it's time for it to be
  196. closed. Closing a ticket is a big responsibility, though. You have to be sure
  197. that the issue is really resolved, and you need to keep in mind that the
  198. reporter of the ticket may not be happy to have their ticket closed (unless
  199. it's fixed!). If you're not certain about closing a ticket, leave a comment
  200. with your thoughts instead.
  201. If you do close a ticket, you should always make sure of the following:
  202. * Be certain that the issue is resolved.
  203. * Leave a comment explaining the decision to close the ticket.
  204. * If there is a way they can improve the ticket to reopen it, let them know.
  205. * If the ticket is a duplicate, reference the original ticket. Also
  206. cross-reference the closed ticket by leaving a comment in the original one
  207. -- this allows to access more related information about the reported bug
  208. or requested feature.
  209. * **Be polite.** No one likes having their ticket closed. It can be
  210. frustrating or even discouraging. The best way to avoid turning people
  211. off from contributing to Django is to be polite and friendly and to offer
  212. suggestions for how they could improve this ticket and other tickets in
  213. the future.
  214. A ticket can be resolved in a number of ways:
  215. * fixed
  216. Used once a patch has been rolled into Django and the issue is fixed.
  217. * invalid
  218. Used if the ticket is found to be incorrect. This means that the
  219. issue in the ticket is actually the result of a user error, or
  220. describes a problem with something other than Django, or isn't
  221. a bug report or feature request at all (for example, some new users
  222. submit support queries as tickets).
  223. * wontfix
  224. Used when someone decides that the request isn't appropriate for
  225. consideration in Django. Sometimes a ticket is closed as "wontfix" with a
  226. request for the reporter to start a discussion on the `Django Forum`_ or
  227. |django-developers| mailing list if they feel differently from the
  228. rationale provided by the person who closed the ticket. Other times, a
  229. discussion precedes the decision to close a ticket. Always use the forum
  230. or mailing list to get a consensus before reopening tickets closed as
  231. "wontfix".
  232. * duplicate
  233. Used when another ticket covers the same issue. By closing duplicate
  234. tickets, we keep all the discussion in one place, which helps
  235. everyone.
  236. * worksforme
  237. Used when the ticket doesn't contain enough detail to replicate
  238. the original bug.
  239. * needsinfo
  240. Used when the ticket does not contain enough information to replicate
  241. the reported issue but is potentially still valid. The ticket
  242. should be reopened when more information is supplied.
  243. If you believe that the ticket was closed in error -- because you're
  244. still having the issue, or it's popped up somewhere else, or the triagers have
  245. made a mistake -- please reopen the ticket and provide further information.
  246. Again, please do not reopen tickets that have been marked as "wontfix" and
  247. bring the issue to the `Django Forum`_ or |django-developers| instead.
  248. .. _how-can-i-help-with-triaging:
  249. How can I help with triaging?
  250. =============================
  251. The triage process is primarily driven by community members. Really,
  252. **ANYONE** can help.
  253. To get involved, start by `creating an account on Trac`_. If you have an
  254. account but have forgotten your password, you can reset it using the `password
  255. reset page`_.
  256. Then, you can help out by:
  257. * Closing "Unreviewed" tickets as "invalid", "worksforme", or "duplicate", or
  258. "wontfix".
  259. * Closing "Unreviewed" tickets as "needsinfo" when the description is too
  260. sparse to be actionable, or when they're feature requests requiring a
  261. discussion on the `Django Forum`_ or |django-developers|.
  262. * Correcting the "Needs tests", "Needs documentation", or "Has patch"
  263. flags for tickets where they are incorrectly set.
  264. * Setting the "`Easy pickings`_" flag for tickets that are small and
  265. relatively straightforward.
  266. * Set the *type* of tickets that are still uncategorized.
  267. * Checking that old tickets are still valid. If a ticket hasn't seen
  268. any activity in a long time, it's possible that the problem has been
  269. fixed but the ticket hasn't yet been closed.
  270. * Identifying trends and themes in the tickets. If there are a lot of bug
  271. reports about a particular part of Django, it may indicate we should
  272. consider refactoring that part of the code. If a trend is emerging,
  273. you should raise it for discussion (referencing the relevant tickets)
  274. on the `Django Forum`_ or |django-developers|.
  275. * Verify if solutions submitted by others are correct. If they are correct
  276. and also contain appropriate documentation and tests then move them to the
  277. "Ready for Checkin" stage. If they are not correct then leave a comment to
  278. explain why and set the corresponding flags ("Patch needs improvement",
  279. "Needs tests" etc.).
  280. .. note::
  281. The `Reports page`_ contains links to many useful Trac queries, including
  282. several that are useful for triaging tickets and reviewing proposals as
  283. suggested above.
  284. You can also find more :doc:`new-contributors`.
  285. .. _Reports page: https://code.djangoproject.com/wiki/Reports
  286. However, we do ask the following of all general community members working in
  287. the ticket database:
  288. * Please **don't** promote your own tickets to "Ready for checkin". You
  289. may mark other people's tickets that you've reviewed as "Ready for
  290. checkin", but you should get at minimum one other community member to
  291. review a patch that you submit.
  292. * Please **don't** reverse a decision without posting a message to the
  293. `Django Forum`_ or |django-developers| to find consensus.
  294. * If you're unsure if you should be making a change, don't make the
  295. change but instead leave a comment with your concerns on the ticket,
  296. or post a message to the `Django Forum`_ or |django-developers|. It's okay to
  297. be unsure, but your input is still valuable.
  298. .. _Trac: https://code.djangoproject.com/
  299. .. _`easy pickings`: https://code.djangoproject.com/query?status=!closed&easy=1
  300. .. _`creating an account on Trac`: https://www.djangoproject.com/accounts/register/
  301. .. _password reset page: https://www.djangoproject.com/accounts/password/reset/
  302. .. _Django Forum: https://forum.djangoproject.com/
  303. Bisecting a regression
  304. ======================
  305. A regression is a bug that's present in some newer version of Django but not in
  306. an older one. An extremely helpful piece of information is the commit that
  307. introduced the regression. Knowing the commit that caused the change in
  308. behavior helps identify if the change was intentional or if it was an
  309. inadvertent side-effect. Here's how you can determine this.
  310. Begin by writing a regression test for Django's test suite for the issue. For
  311. example, we'll pretend we're debugging a regression in migrations. After you've
  312. written the test and confirmed that it fails on the latest main branch, put it
  313. in a separate file that you can run standalone. For our example, we'll pretend
  314. we created ``tests/migrations/test_regression.py``, which can be run with:
  315. .. code-block:: shell
  316. $ ./runtests.py migrations.test_regression
  317. Next, we mark the current point in history as being "bad" since the test fails:
  318. .. code-block:: shell
  319. $ git bisect bad
  320. You need to start by "git bisect start"
  321. Do you want me to do it for you [Y/n]? y
  322. Now, we need to find a point in git history before the regression was
  323. introduced (i.e. a point where the test passes). Use something like
  324. ``git checkout HEAD~100`` to check out an earlier revision (100 commits earlier,
  325. in this case). Check if the test fails. If so, mark that point as "bad"
  326. (``git bisect bad``), then check out an earlier revision and recheck. Once you
  327. find a revision where your test passes, mark it as "good":
  328. .. code-block:: shell
  329. $ git bisect good
  330. Bisecting: X revisions left to test after this (roughly Y steps)
  331. ...
  332. Now we're ready for the fun part: using ``git bisect run`` to automate the rest
  333. of the process:
  334. .. code-block:: shell
  335. $ git bisect run tests/runtests.py migrations.test_regression
  336. You should see ``git bisect`` use a binary search to automatically checkout
  337. revisions between the good and bad commits until it finds the first "bad"
  338. commit where the test fails.
  339. Now, report your results on the Trac ticket, and please include the regression
  340. test as an attachment. When someone writes a fix for the bug, they'll already
  341. have your test as a starting point.