Commit 5451700
authored
Refactor StringManipulator tool so it works just with string and not work item field (#2548)
This should fix #2538
As mention id that bug report, custom user mapping is not applied during
migration. @LudekStipal pointed to the code it was responsible for this.
The problem is not the `StringManipulatorTool` itself, but the value
which is used in that branch of code. The user mapping and all the other
field mapping is done using `oldWorkItem` object, which is of type
`Field`. But that specific branch for strings was processed using
`oldWorkItemData` object which is of type `FieldItem`. So **it is the
different object** and for user fields, it is not working with mapped
user names, because the are mapped in the other place.
This is at least a bug for user fields which are mapped as @LudekStipal
found. But I think, that is is also a potential source of bugs in the
future, if something will be changing here. Because the one who will be
changing something here may not notice, that populating work item fields
it is done in different way for the strings.
`StringManipulatorTool` was working with `FieldItem` type. At first, I
wanted to change it to work with `Field` type, so it would work the same
way as user mapping. But this is not possible, because `Field` type is
from TFS client library, but `StringManipulatorTool` in in different
(lower level) assembly where this is not accessible. So I changes
`StringManipulatorTool` that it does not take a whole field as argument,
but just a string and returns new string. Basically, it does what it
name suggests – takes a plain string, manipulates it and returns a new
string. It was used only in this one place.
This may be a breaking change. The potential problem may be, than
`FieldItem` was modified by `StringManipulatorTool` until now and now it
remains the same. I am not sure if this can be a real issue.File tree
5 files changed
+135
-98
lines changed- src
- MigrationTools.Clients.TfsObjectModel/Processors
- MigrationTools.Shadows/Tools
- MigrationTools.Tests/ProcessorEnrichers
- MigrationTools/Tools
- Interfaces
5 files changed
+135
-98
lines changedLines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
449 | 449 | | |
450 | 450 | | |
451 | 451 | | |
452 | | - | |
453 | | - | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
454 | 455 | | |
455 | 456 | | |
456 | 457 | | |
| |||
Lines changed: 2 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
| 1 | + | |
9 | 2 | | |
10 | 3 | | |
11 | 4 | | |
12 | 5 | | |
13 | 6 | | |
14 | | - | |
| 7 | + | |
15 | 8 | | |
16 | 9 | | |
17 | 10 | | |
| |||
Lines changed: 95 additions & 46 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | 5 | | |
| 6 | + | |
11 | 7 | | |
12 | 8 | | |
13 | 9 | | |
| |||
21 | 17 | | |
22 | 18 | | |
23 | 19 | | |
24 | | - | |
| 20 | + | |
25 | 21 | | |
26 | 22 | | |
27 | 23 | | |
| |||
40 | 36 | | |
41 | 37 | | |
42 | 38 | | |
43 | | - | |
| 39 | + | |
44 | 40 | | |
45 | | - | |
46 | | - | |
| 41 | + | |
| 42 | + | |
47 | 43 | | |
48 | 44 | | |
49 | 45 | | |
| |||
56 | 52 | | |
57 | 53 | | |
58 | 54 | | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
| 55 | + | |
| 56 | + | |
69 | 57 | | |
70 | | - | |
| 58 | + | |
71 | 59 | | |
72 | 60 | | |
73 | 61 | | |
74 | 62 | | |
75 | 63 | | |
76 | 64 | | |
77 | 65 | | |
78 | | - | |
| 66 | + | |
79 | 67 | | |
80 | 68 | | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
| 69 | + | |
| 70 | + | |
91 | 71 | | |
92 | | - | |
| 72 | + | |
93 | 73 | | |
94 | 74 | | |
95 | 75 | | |
| |||
100 | 80 | | |
101 | 81 | | |
102 | 82 | | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
| 83 | + | |
| 84 | + | |
111 | 85 | | |
112 | | - | |
| 86 | + | |
| 87 | + | |
113 | 88 | | |
114 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
115 | 112 | | |
116 | 113 | | |
117 | | - | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
118 | 120 | | |
119 | | - | |
120 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
121 | 170 | | |
122 | 171 | | |
123 | 172 | | |
| |||
134 | 183 | | |
135 | 184 | | |
136 | 185 | | |
137 | | - | |
| 186 | + | |
Lines changed: 2 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
| 1 | + | |
8 | 2 | | |
9 | 3 | | |
10 | 4 | | |
11 | | - | |
| 5 | + | |
12 | 6 | | |
13 | 7 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | 6 | | |
12 | 7 | | |
13 | 8 | | |
| |||
19 | 14 | | |
20 | 15 | | |
21 | 16 | | |
22 | | - | |
23 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
27 | | - | |
| 26 | + | |
28 | 27 | | |
29 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
30 | 32 | | |
31 | 33 | | |
32 | | - | |
33 | | - | |
| 34 | + | |
| 35 | + | |
34 | 36 | | |
35 | | - | |
| 37 | + | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
| |||
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
53 | | - | |
| 55 | + | |
54 | 56 | | |
55 | 57 | | |
56 | 58 | | |
57 | | - | |
| 59 | + | |
58 | 60 | | |
59 | | - | |
| 61 | + | |
60 | 62 | | |
61 | 63 | | |
62 | | - | |
| 64 | + | |
63 | 65 | | |
64 | 66 | | |
65 | 67 | | |
66 | 68 | | |
67 | | - | |
| 69 | + | |
68 | 70 | | |
69 | 71 | | |
70 | 72 | | |
71 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
72 | 80 | | |
73 | 81 | | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
| 82 | + | |
78 | 83 | | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
| 84 | + | |
83 | 85 | | |
84 | | - | |
85 | 86 | | |
86 | | - | |
0 commit comments