Skip to content

Commit 46d3fb8

Browse files
MrHinshcolin-cdp
andauthored
Fix regex pattern in TfsWorkItemMigrationProcessorOptionsValidator (#2970)
This pull request updates the regular expression used to detect the `[System.TeamProject] = @TeamProject` condition in queries, making it more robust by allowing optional single quotes around `@TeamProject`. - Improved query validation: * Updated the regular expression in `TfsWorkItemMigrationProcessorOptionsValidator.cs` to match `[System.TeamProject] = @TeamProject` with or without single quotes around `@TeamProject`, increasing flexibility and reducing false negatives. Fixes #2915 Co-Authored-By: colin-cdp <[email protected]>
2 parents 7a06de2 + d0e08f3 commit 46d3fb8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class TfsWorkItemMigrationProcessorOptionsValidator : IValidateOptions<Tf
1313
{
1414
public ValidateOptionsResult Validate(string name, TfsWorkItemMigrationProcessorOptions options)
1515
{
16-
16+
1717
var errors = new List<string>();
1818
ValidateOptionsResult baseResult = options.Validate(name, options);
1919
if (baseResult != ValidateOptionsResult.Success)
@@ -50,7 +50,7 @@ public ValidateOptionsResult Validate(string name, TfsWorkItemMigrationProcessor
5050
private bool ContainsTeamProjectCondition(string query)
5151
{
5252
// Regex to match '[System.TeamProject] = @TeamProject'
53-
string teamProjectPattern = @"\[System\.TeamProject\]\s*=\s*@TeamProject";
53+
string teamProjectPattern = @"\[System\.TeamProject\]\s*=\s*'?@TeamProject'?";
5454

5555
return Regex.IsMatch(query, teamProjectPattern, RegexOptions.IgnoreCase);
5656
}

0 commit comments

Comments
 (0)