Commit cd66dbd
authored
TfsUserMappingTool: make user map public, fix user mapping (de)serialization (#2528)
User mapping was defined in `TfsUserMappingTool._UserMappings` _private_
field and used only in one place by
`TfsUserMappingTool.MapUserIdentityField` method. I believe, that user
mapping can be used in some other places, for example users are loaded
when migrating team backlog capacities. Now it triggers a lot of warning
for us, because users in source are not the same as users in target. So
I want to use user mapping also in this case. (I do not know yet, but
maybe there are more places where user mapping can be used.)
So this PR makes public property `TfsUserMappingTool.UserMappings` as a
lazy dictionary, that can be used later anywhere.
During this, I noticed a bug, which means, that probably no-one is using
user mappings. The problem is, that user mapping JSON file was generated
in `TfsExportUsersForMappingProcessor` and it serialized simple
`Dictionary<string, string>`. But when used, the file is deserialized in
`TfsUserMappingTool`, but it tried to deserialize data as
`List<IdentityMapData>`. I moved serialization and deserialization to
`TfsUserMappingTool` as static method, so they are next to each other
and both works with `Dictionary<string, string>`.File tree
2 files changed
+39
-26
lines changed- src/MigrationTools.Clients.TfsObjectModel
- Processors
- Tools
2 files changed
+39
-26
lines changedLines changed: 2 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
75 | | - | |
| 74 | + | |
76 | 75 | | |
77 | 76 | | |
78 | 77 | | |
| |||
Lines changed: 37 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| |||
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
22 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
23 | 30 | | |
| 31 | + | |
24 | 32 | | |
25 | 33 | | |
26 | 34 | | |
27 | 35 | | |
28 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
29 | 58 | | |
30 | 59 | | |
31 | 60 | | |
| |||
53 | 82 | | |
54 | 83 | | |
55 | 84 | | |
56 | | - | |
57 | | - | |
| 85 | + | |
58 | 86 | | |
59 | 87 | | |
60 | | - | |
| 88 | + | |
61 | 89 | | |
62 | 90 | | |
63 | 91 | | |
64 | 92 | | |
65 | 93 | | |
66 | | - | |
| 94 | + | |
67 | 95 | | |
68 | 96 | | |
69 | 97 | | |
70 | | - | |
| 98 | + | |
71 | 99 | | |
72 | 100 | | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
| 101 | + | |
88 | 102 | | |
89 | | - | |
| 103 | + | |
90 | 104 | | |
91 | 105 | | |
92 | 106 | | |
| |||
0 commit comments