Django uses Trac for managing the work on the code base. Trac is a community-tended garden of the bugs people have found and the features people would like to see added. As in any garden, sometimes there are weeds to be pulled and sometimes there are flowers and vegetables that need picking. We need your help to sort out one from the other, and in the end, we all benefit together.
Like all gardens, we can aspire to perfection, but in reality there's no such thing. Even in the most pristine garden there are still snails and insects. In a community garden there are also helpful people who -- with the best of intentions -- fertilize the weeds and poison the roses. It's the job of the community as a whole to self-manage, keep the problems to a minimum, and educate those coming into the community so that they can become valuable contributing members.
Similarly, while we aim for Trac to be a perfect representation of the state of Django's progress, we acknowledge that this will not happen. By distributing the load of Trac maintenance to the community, we accept that there will be mistakes. Trac is "mostly accurate", and we give allowances for the fact that sometimes it will be wrong. That's okay. We're perfectionists with deadlines.
We rely on the community to keep participating, keep tickets as accurate as possible, and raise issues for discussion on our mailing lists when there is confusion or disagreement.
Django是一个社区项目,每个贡献都有帮助。没有**你**我们不能这样做!
不幸的是,并不是工单跟踪程序中的所有bug报告和功能请求都提供 required details 。很多工单都有补丁,但这些补丁并不满足一个 good patch 的要求。
One way to help out is to triage tickets that have been created by other users.
大多数工作流都是基于工单的 :ref:`triage stages ` 。每个阶段都描述了在其生命周期中,给定的工单在任何时间的位置。除了一些标志,这个属性可以很容易地告诉我们每张工单在等待什么和谁。
既然一张图片胜过千言万语,那就从这里开始吧:
在这张图表中我们有两个角色:
举个例子,我们可以看到一张普通工单的生命周期:
有些工单需要的反馈比这少得多,但同样有些工单需要更多的反馈。
下面我们将更详细地描述工单在其生命周期中可能经历的各个阶段。
没有任何人对工单是否包含有效问题、可行功能或是否应因任何原因关闭而对工单进行审阅。
大灰色区域!“已接受”的绝对含义是,工单中描述的问题是有效的,并且正处于处理的某个阶段。除此之外,还有几个考虑因素:
已接受并且没有标识
工单是有效的,但是还没有人提交补丁。通常这意味着您可以安全地开始为它编写补丁。对于可接受的bug,这通常比接受的特性更真实。对于一个已经被接受的bug的工单意味着这个问题已经被至少一个trigger验证为合法的bug,并且如果可能的话应该被修复。一个被接受的新特性可能只意味着一个试验者认为该特性将是好的,但这本身并不代表一致的观点,也不意味着某个补丁将被接受。如果您有疑问,请在编写大量补丁之前寻求更多反馈。
已接受并且有补丁
工单正在等待人们查看提供的修补程序。这意味着下载并试用补丁,验证它是否包含测试和文档,使用包含的补丁运行测试套件,并在工单上留下反馈。
已接受并且有补丁,需要...
这意味着工单已经过审核,需要进一步的工作。“需求测试”和“需求文档”是不言而喻的,“补丁需要改进”通常会在工单上附上注释,解释需要改进的代码。
The ticket was reviewed by any member of the community other than the person who supplied the patch and found to meet all the requirements for a commit-ready patch. A merger now needs to give the patch a final review prior to being committed.
There are a lot of pull requests. It can take a while for your patch to get reviewed. See the contributing code FAQ for some ideas here.
This stage isn't shown on the diagram. It's used sparingly to keep track of high-level ideas or long-term feature requests.
这些工单并不常见,而且总体上没有多大用处,因为它们没有描述具体的可操作问题。如果提交了一个优秀的补丁,我们可能会考虑在框架中添加这些增强请求。它们不是优先考虑的问题。
A number of flags, appearing as checkboxes in Trac, can be set on a ticket:
此标志用于具有需要相关文档的修补程序的工单。完整的特性文档是我们将它们检入代码库之前的先决条件。
这会将补丁标记为需要相关联的单元测试。同样,这是有效补丁程序的必需部分。
需要小的,容易的补丁的工单。
工单应该被分类到*组件*中,指出它们属于Django代码库的哪个区域。这使得工单更有条理,更容易找到。
The severity attribute is used to identify blockers, that is, issues that should get fixed before releasing the next version of Django. Typically those issues are bugs causing regressions from earlier versions or potentially causing severe data losses. This attribute is quite rarely used and the vast majority of tickets have a severity of "Normal".
可以使用*version*属性来指示在哪个版本中发现了报告的bug。
此标志用于与用户界面和用户体验问题相关的工单。例如,此标志适用于表单或管理后台接口界面中面向用户的功能。
您可以将您的用户名或电子邮件地址添加到该字段,以便在对工单进行新的投稿时收到通知。
With this field you may label a ticket with multiple keywords. This can be useful, for example, to group several tickets on the same theme. Keywords can either be comma or space separated. Keyword search finds the keyword string anywhere in the keywords. For example, clicking on a ticket with the keyword "form" will yield similar tickets tagged with keywords containing strings such as "formset", "modelformset", and "ManagementForm".
当一个工单已经完成了它的有用的生命周期,是时候关闭它了。不过,关闭工单是一个很大的责任。你必须确保这个问题真的得到了解决,而且你需要记住,工单的报告者可能不乐意关闭他们的工单(除非它被修复了!)。如果你不确定是否要关闭工单,请留下你的注释。
如果您确实关闭了工单,则应始终确保以下事项:
工单可以通过多种方式收尾:
如果您认为错误地关闭了工单——因为您仍然有问题,或者它在其他地方弹出,或者审阅人员出错——请重新打开工单并提供进一步的信息。同样,请不要重新打开标记为“wontfix”的工单,而是将问题提交给| django developers |。
分流过程主要由社区成员推动。真的,**任何人**都能帮上忙。
要想参与其中,首先要 “在Trac上创建一个账户”_ 。如果您有账户但忘记了密码,可以使用 “密码重置页”_ 重置它。
然后,你可这样帮忙:
但是,我们确实要求在工单数据库中工作的所有普通社区成员:
回归是一些较新版本的Django中存在,而较旧的版本中没有的错误。 引入回归的提交是非常有用的信息。了解导致行为改变的提交有助于识别改变是有意的还是无意的副作用。以下是您如何确定这个的。
Begin by writing a regression test for Django's test suite for the issue. For
example, we'll pretend we're debugging a regression in migrations. After you've
written the test and confirmed that it fails on the latest main branch, put it
in a separate file that you can run standalone. For our example, we'll pretend
we created tests/migrations/test_regression.py
, which can be run with:
$ ./runtests.py migrations.test_regression
Next, we mark the current point in history as being "bad" since the test fails:
$ git bisect bad
You need to start by "git bisect start"
Do you want me to do it for you [Y/n]? y
Now, we need to find a point in git history before the regression was
introduced (i.e. a point where the test passes). Use something like
git checkout HEAD~100
to check out an earlier revision (100 commits earlier,
in this case). Check if the test fails. If so, mark that point as "bad"
(git bisect bad
), then check out an earlier revision and recheck. Once you
find a revision where your test passes, mark it as "good":
$ git bisect good
Bisecting: X revisions left to test after this (roughly Y steps)
...
Now we're ready for the fun part: using git bisect run
to automate the rest
of the process:
$ git bisect run tests/runtests.py migrations.test_regression
您应该看到 git bisect
使用二分搜索来自动检查好提交和坏提交之间的修订,直到找到测试失败的第一个“坏”提交为止。
现在,在Trac工单上报告您的结果,并在附件中包含回归测试。当某人为该错误编写修复程序时,他们已经以您的测试为起点。
5月 12, 2023