Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,10 @@ configurationSamples:
{
"$type": "TfsWorkItemTypeValidatorToolOptions",
"Enabled": true,
"IncludeWorkItemtypes": [],
"ExcludeWorkItemtypes": [],
"IncludeWorkItemTypes": [],
"ExcludeWorkItemTypes": [],
"ExcludeDefaultWorkItemTypes": true,
"SourceFieldMappings": {
"User Story": {
"Microsoft.VSTS.Common.Prirucka": "Custom.Prirucka"
}
},
"FixedTargetFields": {
"User Story": [
"Custom.Prirucka"
]
}
"ExcludeSourceFields": {}
}
sampleFor: MigrationTools.Tools.TfsWorkItemTypeValidatorToolOptions
description: >-
Expand All @@ -83,48 +74,36 @@ options:
- parameterName: ExcludeDefaultWorkItemTypes
type: Boolean
description: >-
If `true`, some work item types will be automatically added to `ExcludeWorkItemtypes` list.
If `true`, some work item types will be automatically added to `ExcludeWorkItemTypes` list.
Work item types excluded by default are: Code Review Request, Code Review Response, Feedback Request,
Feedback Response, Shared Parameter, Shared Steps.
defaultValue: missing XML code comments
isRequired: false
dotNetType: System.Boolean, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
- parameterName: ExcludeWorkItemtypes
type: List
description: List of work item types which will be excluded from validation.
defaultValue: missing XML code comments
isRequired: false
dotNetType: System.Collections.Generic.List`1[[System.String, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
- parameterName: FixedTargetFields
- parameterName: ExcludeSourceFields
type: Dictionary
description: >-
List of target fields that are considered as `fixed`.
A field marked as fixed will not stop the migration if differences are found.
Instead of a warning, only an informational message will be logged.
List of fields in source work itemt types, that are excluded from validation.
Fields excluded from validation are still validated and all found issues are logged.
But the result of the validation is 'valid' and the issues are logged as information instead of warning.

Use this list when you already know about the differences and have resolved them,
for example by using `FieldMappingTool`.

The key is the target work item type name.
You can also use `*` to define fixed fields that apply to all work item types.
The key is the source work item type name.
You can also use `*` to exclude fields from all source work item types.
defaultValue: null
isRequired: false
dotNetType: System.Collections.Generic.Dictionary`2[[System.String, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Collections.Generic.List`1[[System.String, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
- parameterName: IncludeWorkItemtypes
- parameterName: ExcludeWorkItemTypes
type: List
description: List of work item types which will be validated. If this list is empty, all work item types will be validated.
defaultValue: null
description: List of work item types which will be excluded from validation.
defaultValue: missing XML code comments
isRequired: false
dotNetType: System.Collections.Generic.List`1[[System.String, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
- parameterName: SourceFieldMappings
type: Dictionary
description: >-
Field reference name mappings. Key is work item type name, value is dictionary of mapping source filed name to
target field name. Target field name can be empty string to indicate that this field will not be validated in target.
As work item type name, you can use `*` to define mappings which will be applied to all work item types.
- parameterName: IncludeWorkItemTypes
type: List
description: List of work item types which will be validated. If this list is empty, all work item types will be validated.
defaultValue: null
isRequired: false
dotNetType: System.Collections.Generic.Dictionary`2[[System.String, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Collections.Generic.Dictionary`2[[System.String, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.String, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
dotNetType: System.Collections.Generic.List`1[[System.String, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
status: missing XML code comments
processingTarget: missing XML code comments
classFile: src/MigrationTools.Clients.TfsObjectModel/Tools/TfsWorkItemTypeValidatorTool.cs
Expand Down
65 changes: 27 additions & 38 deletions docs/static/schema/configuration.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2182,22 +2182,6 @@
}
}
},
"TfsChangeSetMappingTool": {
"title": "TfsChangeSetMappingTool",
"description": "missing XML code comments",
"type": "object",
"properties": {
"ChangeSetMappingFile": {
"description": "missing XML code comments",
"type": "string"
},
"Enabled": {
"description": "If set to `true` then the tool will run. Set to `false` and the processor will not run.",
"type": "boolean",
"default": "true"
}
}
},
"TfsEmbededImagesTool": {
"title": "TfsEmbededImagesTool",
"description": "missing XML code comments",
Expand Down Expand Up @@ -2234,6 +2218,22 @@
}
}
},
"TfsChangeSetMappingTool": {
"title": "TfsChangeSetMappingTool",
"description": "missing XML code comments",
"type": "object",
"properties": {
"Enabled": {
"description": "If set to `true` then the tool will run. Set to `false` and the processor will not run.",
"type": "boolean",
"default": "true"
},
"ChangeSetMappingFile": {
"description": "missing XML code comments",
"type": "string"
}
}
},
"TfsNodeStructureTool": {
"title": "TfsNodeStructureTool",
"description": "Tool for creating missing area and iteration path nodes in the target project during migration. Configurable through TfsNodeStructureToolOptions to specify which node types to create.",
Expand Down Expand Up @@ -2469,20 +2469,11 @@
"default": "true"
},
"ExcludeDefaultWorkItemTypes": {
"description": "If `true`, some work item types will be automatically added to `ExcludeWorkItemtypes` list.\r\n Work item types excluded by default are: Code Review Request, Code Review Response, Feedback Request,\r\n Feedback Response, Shared Parameter, Shared Steps.",
"description": "If `true`, some work item types will be automatically added to `ExcludeWorkItemTypes` list.\r\n Work item types excluded by default are: Code Review Request, Code Review Response, Feedback Request,\r\n Feedback Response, Shared Parameter, Shared Steps.",
"type": "boolean"
},
"ExcludeWorkItemtypes": {
"description": "List of work item types which will be excluded from validation.",
"type": "array",
"prefixItems": [
{
"type": "string"
}
]
},
"FixedTargetFields": {
"description": "List of target fields that are considered as `fixed`.\r\n A field marked as fixed will not stop the migration if differences are found.\r\n Instead of a warning, only an informational message will be logged.\r\n\n Use this list when you already know about the differences and have resolved them,\r\n for example by using `FieldMappingTool`.\r\n\n The key is the target work item type name.\r\n You can also use `*` to define fixed fields that apply to all work item types.",
"ExcludeSourceFields": {
"description": "List of fields in source work itemt types, that are excluded from validation.\r\n Fields excluded from validation are still validated and all found issues are logged.\r\n But the result of the validation is 'valid' and the issues are logged as information instead of warning.\r\n\n The key is the source work item type name.\r\n You can also use `*` to exclude fields from all source work item types.",
"type": "object",
"default": "null",
"additionalProperties": {
Expand All @@ -2494,26 +2485,24 @@
]
}
},
"IncludeWorkItemtypes": {
"description": "List of work item types which will be validated. If this list is empty, all work item types will be validated.",
"ExcludeWorkItemTypes": {
"description": "List of work item types which will be excluded from validation.",
"type": "array",
"default": "null",
"prefixItems": [
{
"type": "string"
}
]
},
"SourceFieldMappings": {
"description": "Field reference name mappings. Key is work item type name, value is dictionary of mapping source filed name to\r\n target field name. Target field name can be empty string to indicate that this field will not be validated in target.\r\n As work item type name, you can use `*` to define mappings which will be applied to all work item types.",
"type": "object",
"IncludeWorkItemTypes": {
"description": "List of work item types which will be validated. If this list is empty, all work item types will be validated.",
"type": "array",
"default": "null",
"additionalProperties": {
"type": "object",
"additionalProperties": {
"prefixItems": [
{
"type": "string"
}
}
]
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,22 @@
"default": "true"
},
"ExcludeDefaultWorkItemTypes": {
"description": "If `true`, some work item types will be automatically added to `ExcludeWorkItemtypes` list.\r\n Work item types excluded by default are: Code Review Request, Code Review Response, Feedback Request,\r\n Feedback Response, Shared Parameter, Shared Steps.",
"description": "If `true`, some work item types will be automatically added to `ExcludeWorkItemTypes` list.\r\n Work item types excluded by default are: Code Review Request, Code Review Response, Feedback Request,\r\n Feedback Response, Shared Parameter, Shared Steps.",
"type": "boolean"
},
"ExcludeWorkItemtypes": {
"description": "List of work item types which will be excluded from validation.",
"type": "array"
},
"FixedTargetFields": {
"description": "List of target fields that are considered as `fixed`.\r\n A field marked as fixed will not stop the migration if differences are found.\r\n Instead of a warning, only an informational message will be logged.\r\n\n Use this list when you already know about the differences and have resolved them,\r\n for example by using `FieldMappingTool`.\r\n\n The key is the target work item type name.\r\n You can also use `*` to define fixed fields that apply to all work item types.",
"ExcludeSourceFields": {
"description": "List of fields in source work itemt types, that are excluded from validation.\r\n Fields excluded from validation are still validated and all found issues are logged.\r\n But the result of the validation is 'valid' and the issues are logged as information instead of warning.\r\n\n The key is the source work item type name.\r\n You can also use `*` to exclude fields from all source work item types.",
"type": "object",
"default": "null"
},
"IncludeWorkItemtypes": {
"ExcludeWorkItemTypes": {
"description": "List of work item types which will be excluded from validation.",
"type": "array"
},
"IncludeWorkItemTypes": {
"description": "List of work item types which will be validated. If this list is empty, all work item types will be validated.",
"type": "array",
"default": "null"
},
"SourceFieldMappings": {
"description": "Field reference name mappings. Key is work item type name, value is dictionary of mapping source filed name to\r\n target field name. Target field name can be empty string to indicate that this field will not be validated in target.\r\n As work item type name, you can use `*` to define mappings which will be applied to all work item types.",
"type": "object",
"default": "null"
}
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,13 @@
.ToProject()
.WorkItemTypes
.Cast<WorkItemType>()
.OrderBy(wit => wit.Name)
.ToList();
var targetWits = Target.WorkItems.Project
.ToProject()
.WorkItemTypes
.Cast<WorkItemType>()
.OrderBy(wit => wit.Name)
.ToList();

// Reflected work item ID field is mandatory for migration, so it is validated even if the validator tool is disabled.
Expand Down Expand Up @@ -437,7 +439,7 @@
newWorkItem.Fields["Microsoft.VSTS.Common.ClosedDate"].Value = oldWorkItem.Fields["Microsoft.VSTS.Common.ClosedDate"].Value;
}
}
catch (FieldDefinitionNotExistException ex)

Check warning on line 442 in src/MigrationTools.Clients.TfsObjectModel/Processors/TfsWorkItemMigrationProcessor.cs

View workflow job for this annotation

GitHub Actions / Build, Test, Sonar Cloud Analysis, & Package

The variable 'ex' is declared but never used

Check warning on line 442 in src/MigrationTools.Clients.TfsObjectModel/Processors/TfsWorkItemMigrationProcessor.cs

View workflow job for this annotation

GitHub Actions / Build, Test, Sonar Cloud Analysis, & Package

The variable 'ex' is declared but never used
{
// Eat exception coz the TFS API Sucks
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,13 @@ protected override void InternalExecute()
.ToProject()
.WorkItemTypes
.Cast<WorkItemType>()
.OrderBy(wit => wit.Name)
.ToList();
List<WorkItemType> targetWits = Target.WorkItems.Project
.ToProject()
.WorkItemTypes
.Cast<WorkItemType>()
.OrderBy(wit => wit.Name)
.ToList();
bool containsReflectedWorkItemId = CommonTools.WorkItemTypeValidatorTool
.ValidateReflectedWorkItemIdField(sourceWits, targetWits, Target.Options.ReflectedWorkItemIdField);
Expand Down
Loading
Loading