Bugzilla - 工作流程定制
我想更改 Bugzilla 工作流程,以便用户无法关闭错误,除非错误已经经历了某些阶段(例如已分配、正在进行中等)。
如何更改 Bugzilla 以创建我自己的工作流程?
I want to change the Bugzilla workflow so that a user won't be able to close a bug unless the bug has gone through some phases (e.g. ASSIGNED, IN_PROGRESS, etc).
How do I change Bugzilla in order to create my own work flow?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您是否尝试过从 bugzilla 本身更改工作流程?
(编辑:更新了 5.0 的 URL)
Have you tried changing the workflow from within bugzilla itself?
(Edit: updated URL for 5.0)
如果您主要关心的是权限,您需要查看 Bugzilla/Bug.pm 中的 check_can_change_field 。
If your primary concern is permissions, you'll want to check out check_can_change_field in Bugzilla/Bug.pm.
在 editworkflow.cgi 中您只能进行这么多自定义,因为从任何其他状态都可以访问“已解决”(例如,当它被标记为重复项时,它就会变为“已解决”)。工作流程本身不考虑错误的历史记录。
如果您确实想强制执行这种业务逻辑,您应该开始深入研究 process_bug.cgi。如果有人想将状态设置为 FOO 但之前需要处于状态 BAR,您可以在 bugs_activity 中检查错误的历史记录。
但这是一项繁重的工作,而且您可能会遇到特殊情况、更多规则、更多特殊情况等。
我认为您最好在事后识别未经过正确工作流程的错误。当您发现此类错误时,您将重新打开它们或将它们置于任何状态。
您可以通过检查 bugs_activity 以查看添加/删除了 bug_status 的哪些值来完成此操作。
There's only so much customization you can do in editworkflow.cgi, because RESOLVED much be reachable from any other status (because when it is marked as a duplicate, for instance, it becomes RESOLVED). The workflow itself doesn't consider the history of the bug.
If you really wanted to enforce this sort of business logic, you should start diving into process_bug.cgi. If someone want to set the status to FOO but it needs to have been in status BAR before, you could check the bug's history in bugs_activity.
But that's a lot of work, and you're likely to have special cases, more rules, more special cases, etc.
I think you would be better off identifying bugs that didn't go through the proper workflow after the fact. When you identify such a bug, you would reopen them or put them into whatever status.
You would do this by examining bugs_activity to see what values of bug_status have been added/removed.
您需要分两步完成:
You need to do it in two steps:
这是一种执行方式。
It is a way of doing