Skip to content

Commit 80e037c

Browse files
committed
Merge branch 'main' into topic/ClosedDate-Fix-When-Not-Exist
2 parents 1d176c4 + 459d674 commit 80e037c

File tree

5 files changed

+32
-52
lines changed

5 files changed

+32
-52
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ jobs:
358358
steps:
359359
- uses: actions/checkout@v4
360360
- name: Setup Ruby
361-
uses: ruby/setup-ruby@8575951200e472d5f2d95c625da0c7bec8217c42 # v1.161.0
361+
uses: ruby/setup-ruby@v1 # v1.161.0
362362
with:
363363
ruby-version: '3.2' # Not needed with a .ruby-version file
364364
bundler-cache: true # runs 'bundle install' and caches installed gems automatically

docs/Reference/Generated/MigrationTools.xml

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/MigrationTools.Host/Commands/ExecuteMigrationCommandSettings.cs

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,6 @@ namespace MigrationTools.Host.Commands
66
{
77
internal class ExecuteMigrationCommandSettings : CommandSettingsBase
88
{
9-
[Description("Domain used to connect to the source TFS instance.")]
10-
[CommandOption("--sourceDomain")]
11-
public string SourceDomain { get; set; }
12-
13-
[Description("User Name used to connect to the source TFS instance.")]
14-
[CommandOption("--sourceUserName")]
15-
public string SourceUserName { get; set; }
16-
17-
[Description("Password used to connect to source TFS instance.")]
18-
[CommandOption("--sourcePassword")]
19-
public string SourcePassword { get; set; }
20-
21-
[Description("Domain used to connect to the target TFS instance.")]
22-
[CommandOption("--targetDomain")]
23-
public string TargetDomain { get; set; }
24-
25-
[Description("User Name used to connect to the target TFS instance.")]
26-
[CommandOption("--targetUserName")]
27-
public string TargetUserName { get; set; }
28-
29-
[Description("Password used to connect to target TFS instance.")]
30-
[CommandOption("--targetPassword")]
31-
public string TargetPassword { get; set; }
9+
3210
}
3311
}

src/MigrationTools.Host/MigrationToolHost.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,18 +117,18 @@ public static IHostBuilder CreateDefaultBuilder(string[] args, Action<IConfigura
117117
{
118118
config.AddCommand<Commands.ExecuteMigrationCommand>("execute")
119119
.WithDescription("Executes the enables processors specified in the configuration file.")
120-
.WithExample("execute -config \"configuration.json\"")
121-
.WithExample("execute -config \"configuration.json\" --skipVersionCheck ");
120+
.WithExample("execute --config \"configuration.json\"")
121+
.WithExample("execute --config \"configuration.json\" --skipVersionCheck ");
122122
config.AddCommand<Commands.InitMigrationCommand>("init")
123123
.WithDescription($"Creates an default configuration file or applies templates! Available templates are `{string.Join("`, `", Enum.GetNames(typeof(OptionsConfigurationTemplate)))}`. With `Reference` loading all options with their defaults.")
124-
.WithExample("init -template Basic");
124+
.WithExample("init --template Basic");
125125
config.AddCommand<Commands.UpgradeConfigCommand>("upgrade")
126126
.WithDescription("Attempts to upgrade your config from the old version to the new one. For each option we will load the defaults, then apply your config. This will only bring across valid settings. This is 'best effort' and you will need to check all the values as we have changed a lot! Also note that it will automatically load any defaults in Environment variables which may require you to remove secrets from the output file.")
127-
.WithExample("upgrade -config \"configuration.json\"");
127+
.WithExample("upgrade --config \"configuration.json\"");
128128

129129
config.AddCommand<Commands.ConfigurationBuilderCommand>("builder")
130130
.WithDescription("Creates or edits a configuration file")
131-
.WithExample("builder -config \"configuration.json\"").IsHidden();
131+
.WithExample("builder --config \"configuration.json\"").IsHidden();
132132

133133
extraCommands?.Invoke(config);
134134
config.PropagateExceptions();

src/MigrationTools/Tools/StringManipulatorTool.cs

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class StringManipulatorTool : Tool<StringManipulatorToolOptions>, IString
2020
{
2121

2222
public StringManipulatorTool(IOptions<StringManipulatorToolOptions> options, IServiceProvider services, ILogger<StringManipulatorTool> logger, ITelemetryLogger telemetryLogger)
23-
: base(options,services, logger, telemetryLogger)
23+
: base(options, services, logger, telemetryLogger)
2424
{
2525
}
2626

@@ -39,19 +39,21 @@ public void ProcessorExecutionWithFieldItem(IProcessor processor, FieldItem fiel
3939
AddDefaultManipulator();
4040
}
4141
foreach (var manipulator in Options.Manipulators)
42+
{
43+
if (manipulator.Enabled)
4244
{
43-
if (manipulator.Enabled)
44-
{
45-
Log.LogDebug("{WorkItemProcessorEnricher}::ProcessorExecutionWithFieldItem::Running::{Description} with {pattern}", GetType().Name, manipulator.Description, manipulator.Pattern);
46-
fieldItem.Value = Regex.Replace((string)fieldItem.Value, manipulator.Pattern, manipulator.Replacement);
47-
48-
}
49-
else
50-
{
51-
Log.LogDebug("{WorkItemProcessorEnricher}::ProcessorExecutionWithFieldItem::Disabled::{Description}", GetType().Name, manipulator.Description);
52-
}
45+
Log.LogDebug("{WorkItemProcessorEnricher}::ProcessorExecutionWithFieldItem::Running::{Description} with {pattern}", GetType().Name, manipulator.Description, manipulator.Pattern);
46+
var originalValue = fieldItem.Value;
47+
fieldItem.Value = Regex.Replace((string)fieldItem.Value, manipulator.Pattern, manipulator.Replacement);
48+
Log.LogTrace("{WorkItemProcessorEnricher}::ProcessorExecutionWithFieldItem::Running::{Description}::Original::{@OriginalValue}", GetType().Name, manipulator.Description, originalValue);
49+
Log.LogTrace("{WorkItemProcessorEnricher}::ProcessorExecutionWithFieldItem::Running::{Description}::New::{@fieldItemValue}", GetType().Name, manipulator.Description, fieldItem.Value);
50+
}
51+
else
52+
{
53+
Log.LogDebug("{WorkItemProcessorEnricher}::ProcessorExecutionWithFieldItem::Disabled::{Description}", GetType().Name, manipulator.Description);
5354
}
54-
55+
}
56+
5557
if (HasStringTooLong(fieldItem))
5658
{
5759
fieldItem.Value = fieldItem.Value.ToString().Substring(0, Math.Min(fieldItem.Value.ToString().Length, Options.MaxStringLength));

0 commit comments

Comments
 (0)