P4DTI issue job000181

TitleAssertion failure in translate_1_to_0
Assigned userGareth Rees
DescriptionIf an optional field in Perforce has no value, then a field translator may fail with an assertion error.
AnalysisThis is because replicator.translate_issue_p4_to_dt substitutes None for the Perforce value when it the field doesn't appear in the job. But the translate_0_to_1 functions don't take proper account of this.
One solution is to change the translate_0_to_1 functions so that they work with None. The other solution is to use the empty string '' rather than None as the default value (in replicator.translate_issue_p4_to_dt). The latter is sensible since all Perforce field values are strings, and a missing field does indeed correspond to an empty string in an 'optional' field.
How foundcustomer
Observed in0.4.2
Introduced in0.4.0
Test procedure<http://www.ravenbrook.com/project/p4dti/master/test/test_p4dti.py>
Created byGareth Rees
Created on2001-01-18 16:31:19
Last modified byGareth Rees
Last modified on2001-12-10 19:19:45
History2001-01-18 GDR Created.


Change Effect Date User Description
7372 closed 2001-01-19 15:39:48 Gareth Rees Merged fix for job000181 into version/0.5/.
7371 closed 2001-01-19 15:38:19 Gareth Rees Merged fix for job000181 into master sources.
7370 closed 2001-01-19 15:32:15 Gareth Rees Fixing job000181:
Replicator uses empty string as default value when a Perforce field is missing.
When the replicator checks to see if the defect tracker has made changes to the issue it must consider 'field is empty' and 'field missing in Perforce' as being equivalent.
Translators in dt_teamtrack.py map the empty string to something appropriate (or raise an error saying they can't translate it).