Skip to content

Commit 33016bf

Browse files
authored
SkipValidateAllUsersExistOrAreMapped can be skippt over options (#2719)
cause uservalidation need mutch time and when create a mapping file before it is not needed. with this option it can be skipped
2 parents 4b1a701 + 1ed929f commit 33016bf

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

src/MigrationTools.Clients.TfsObjectModel/Processors/TfsWorkItemMigrationProcessor.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,12 @@ protected override void InternalExecute()
215215

216216
private void ValidateAllUsersExistOrAreMapped(List<WorkItemData> sourceWorkItems)
217217
{
218+
if (CommonTools.UserMapping.Options.SkipValidateAllUsersExistOrAreMapped)
219+
{
220+
contextLog.Information("Skipped: Validating::Check that all users in the source exist in the target or are mapped!");
221+
return;
222+
}
223+
218224
contextLog.Information("Validating::Check that all users in the source exist in the target or are mapped!");
219225
IdentityMapResult usersToMap = CommonTools.UserMapping.GetUsersInSourceMappedToTargetForWorkItems(this, sourceWorkItems);
220226
if (usersToMap != null && usersToMap.IdentityMap != null && usersToMap.IdentityMap.Count > 0)

src/MigrationTools.Clients.TfsObjectModel/Processors/TfsWorkItemMigrationProcessorOptions.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,7 @@ public class TfsWorkItemMigrationProcessorOptions : ProcessorOptions, IWorkItemP
113113
/// </summary>
114114
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
115115
public bool SkipRevisionWithInvalidAreaPath { get; set; } = false;
116-
117-
118116
}
119117

120118

121-
}
119+
}

src/MigrationTools.Clients.TfsObjectModel/Tools/TfsUserMappingToolOptions.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System.Collections.Generic;
22
using MigrationTools.Tools.Infrastructure;
3+
using Newtonsoft.Json;
34

45
namespace MigrationTools.Tools
56
{
@@ -21,12 +22,19 @@ public class TfsUserMappingToolOptions : ToolOptions, ITfsUserMappingToolOptions
2122
/// users will be mapped by their email address first. If no match is found, then the display name will be used.
2223
/// </summary>
2324
public bool MatchUsersByEmail { get; set; }
25+
26+
/// <summary>
27+
/// When set to true, this setting will skip a validation that all users exists or mapped
28+
/// </summary>
29+
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
30+
public bool SkipValidateAllUsersExistOrAreMapped { get; set; } = false;
2431
}
2532

2633
public interface ITfsUserMappingToolOptions
2734
{
2835
List<string> IdentityFieldsToCheck { get; set; }
2936
string UserMappingFile { get; set; }
3037
bool MatchUsersByEmail { get; set; }
38+
bool SkipValidateAllUsersExistOrAreMapped { get; set; }
3139
}
3240
}

0 commit comments

Comments
 (0)