P4DTI issue job000102

TitleThe resolver exists but shouldn't
Assigned userGareth Rees
DescriptionWe've decided to abolish the role of the "resolver" but the code to handle it still exists, and the right people don't always get e-mail.
AnalysisFor version 0.4, write a conflict resolution policy that effectively abolishes the resolver, and make sure e-mail goes to the other people involved (see <http://info.ravenbrook.com/mail/2000/11/28/17-30-34/0.txt> for decisions).
If there's no adverse feedback during the beta programme, remove all the code for this and thus simplify the integration. RB 2000-11-30
How foundinspection
Created byRichard Brooksby
Created on2000-11-30 15:43:46
Last modified byGareth Rees
Last modified on2001-12-10 19:07:01
History2000-11-30 RB Created.


Change Effect Date User Description
5388 closed 2000-12-04 18:41:38 Gareth Rees Removing resolver role from the integration:

Tidied up the replication and mailing methods to make this part of the replicator clearer. Changed replicate_issue_to_job() to replicate_issue_dt_to_p4() and replicate_job_to_issue() to replicate_issue_p4_to_dt() for consistency with other method names. Added new methods overwrite_issue_dt_to_p4() and overwrite_issue_p4_to_dt(), which are wrappers around the above methods that also e-mail the affected parties. In order to be able to e-mail the owner of a job, added the replicator method user_email_address for getting a Perforce user's e-mail address and the replicator configuration parameter job-owner-field that names the owner field in a job (the automatic configuration generator specifies 'Owner' for this). Removed the mail_administrator method() (use mail instead), and improved the mail() method. Improved many log entries by using issue.readable_name instead of issue.id. Re-organized and documented the replicate() function. It's no less complicated than it was before, but I think it's easier to understand. Functions like replicate() and replicate_issue_p4_to_dt() no longer return a meaningful error code. They either return or throw an exception.

Changed conflict_policy so that it always returns 'dt'. This is the key change that removes the resolver's role.

Changed the handling of errors to support the change in the conflict policy. There's now no need for conflict_error, so this is gone. The reverting of jobs to the corresponding issue is handled by the revert_issue_dt_to_p4() method: this ensures that it gets called in the correct place only (that is, normal replication from Perforce to the defect tracker has failed). The replicate_many() method no longer does any handling of errors. All other errors are caught by the run() method so that the replicator can keep on going, except AssertionError and KeyboardInterrupt, both of which stop the replicator.