Skip to content

Commit

Permalink
Patch for tests, and new model...
Browse files Browse the repository at this point in the history
  • Loading branch information
MrHinsh committed Mar 4, 2024
1 parent adf6527 commit 7408762
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
4 changes: 2 additions & 2 deletions configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"Processors": [
{
"$type": "WorkItemMigrationConfig",
"Enabled": false,
"Enabled": true,
"UpdateCreatedDate": true,
"UpdateCreatedBy": true,
"WIQLQuery": "SELECT [System.Id] FROM WorkItems WHERE [System.TeamProject] = @TeamProject AND [System.WorkItemType] NOT IN ('Test Suite', 'Test Plan','Shared Steps','Shared Parameter','Feedback Request') ORDER BY [System.ChangedDate] desc",
Expand All @@ -96,7 +96,7 @@
"SkipRevisionWithInvalidAreaPath": false
}
],
"Version": "14.2",
"Version": "15.0",
"workaroundForQuerySOAPBugEnabled": false,
"WorkItemTypeDefinition": {
"sourceWorkItemTypeName": "targetWorkItemTypeName"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ public EngineConfiguration()
public IMigrationClientConfig Source { get; set; }
public IMigrationClientConfig Target { get; set; }

public List<IFieldMapConfig> FieldMaps { get; set; }
public Dictionary<string, string> GitRepoMapping { get; set; }
public List<IFieldMapConfig> FieldMaps { get; set; } = new List<IFieldMapConfig>();
public Dictionary<string, string> GitRepoMapping { get; set; } = new Dictionary<string, string>();

public string LogLevel { get; private set; }
public List<IProcessorEnricherOptions> CommonEnrichersConfig { get; set; }
public List<IProcessorEnricherOptions> CommonEnrichersConfig { get; set; } = new List<IProcessorEnricherOptions>();
public List<IProcessorConfig> Processors { get; set; }
public string Version { get; set; }
public bool workaroundForQuerySOAPBugEnabled { get; set; }
public Dictionary<string, string> WorkItemTypeDefinition { get; set; }
public Dictionary<string, string> WorkItemTypeDefinition { get; set; } = new Dictionary<string, string>();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ protected void PullCommonEnrichersConfig<TEnricher, TEnricherOptions> (List<IPro
where TEnricherOptions : IProcessorEnricherOptions, new()
where TEnricher : IProcessorEnricher
{
var config = commonEnrichersStore.OfType<TEnricherOptions>().FirstOrDefault();
TEnricherOptions config = default(TEnricherOptions);
if (commonEnrichersStore != null)
{
config = commonEnrichersStore.OfType<TEnricherOptions>().FirstOrDefault();
}
if (config == null)
{
var result = new TEnricherOptions();
Expand Down
5 changes: 5 additions & 0 deletions src/VstsSyncMigrator.Core.Tests/WorkItemMigrationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ public void Setup()
},
});

//IMigrationEngine xx = _services.GetRequiredService<IMigrationEngine>();
// IOptions < EngineConfiguration> engine = _services.GetRequiredService<IOptions<EngineConfiguration>>();


_underTest = new WorkItemMigrationContext(_services.GetRequiredService<IMigrationEngine>(),
_services,
_services.GetRequiredService<ITelemetryLogger>(),
Expand All @@ -54,6 +58,7 @@ public void Setup()
_services.GetRequiredService<TfsWorkItemEmbededLinkEnricher>(),
_services.GetRequiredService<TfsValidateRequiredField>(),
_services.GetRequiredService<IOptions<EngineConfiguration>>());

_underTest.Configure(new WorkItemMigrationConfig
{

Expand Down

0 comments on commit 7408762

Please sign in to comment.