Expressing rules as code is not ideal. Code has to be changed, reviewed, committed and then wait for the next deployment. This can take quite a bit of time. The current code resides in extensions/BMO/Extension.pm in the bug_check_can_change_field() function. A better way would be for an empowered user be able to write rules in a structured format language and be able to submit them using an admin UI causing the changes to take affect immediately.
Dylan started this using a proof of concept PR which gets us some of the way there . I am going to finish this up and extend it to allow using YAML for the rules definition. The YAML must be validated before saving and also should not cause any performance slow down of the system.
Proposed YAML stucture:
- desc: Deny if new bug page, product is Firefox, field is priority and not in editbugs group
- desc: Deny if show bug, product is Firefox, field is assignee, and not in editbugs group
- desc: You need at least canconfirm to mark a bug as FIXED
We will need to extend this as more selective criteria is needed. Current hard coded rulesinitially would be moved over to the new format and removed from the BMO extension. Some of the hard coded rules may be too complicated and would not fit in and would be left in place.