Skip to content

Commit 25a8276

Browse files
Merge pull request #33 from github/azure-devops-config-options
Updating options on GH-Actions-Importer with new ADO options
2 parents 62d46c1 + cdeeec6 commit 25a8276

File tree

8 files changed

+36
-8
lines changed

8 files changed

+36
-8
lines changed

src/ActionsImporter/Commands/AzureDevOps/Audit.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,14 @@ public Audit(string[] args)
1313
protected override string Name => "azure-devops";
1414
protected override string Description => "An audit will output a list of data used in an Azure DevOps instance.";
1515

16+
private static readonly Option<FileInfo> ConfigFilePath = new("--config-file-path")
17+
{
18+
Description = "The file path corresponding to the Azure DevOps configuration file.",
19+
IsRequired = false,
20+
};
21+
1622
protected override ImmutableArray<Option> Options => ImmutableArray.Create<Option>(
23+
ConfigFilePath,
1724
Common.Organization,
1825
Common.Project,
1926
Common.InstanceUrl,

src/ActionsImporter/Commands/AzureDevOps/BuildPipeline/DryRun.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,9 @@ public DryRun(string[] args) : base(args)
1111

1212
protected override string Name => "pipeline";
1313
protected override string Description => "Target a designer or YAML pipeline";
14-
protected override ImmutableArray<Option> Options => ImmutableArray<Option>.Empty;
14+
15+
protected override ImmutableArray<Option> Options => ImmutableArray.Create<Option>(
16+
Common.SourceFilePath,
17+
Common.PipelineIdNotRequired
18+
);
1519
}

src/ActionsImporter/Commands/AzureDevOps/BuildPipeline/Migrate.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,8 @@ public Migrate(string[] args) : base(args)
1111

1212
protected override string Name => "pipeline";
1313
protected override string Description => "Target a designer or YAML pipeline";
14-
protected override ImmutableArray<Option> Options => ImmutableArray<Option>.Empty;
14+
protected override ImmutableArray<Option> Options => ImmutableArray.Create<Option>(
15+
Common.SourceFilePath,
16+
Common.PipelineIdNotRequired
17+
);
1518
}

src/ActionsImporter/Commands/AzureDevOps/Common.cs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,21 @@ public static class Common
2828
IsRequired = false,
2929
};
3030

31-
public static readonly Option<int> PipelineId = new(new[] { "--pipeline-id", "-i" })
31+
public static readonly Option<int> PipelineIdRequired = new(new[] { "--pipeline-id", "-i" })
3232
{
33-
Description = "The Azure DevOps pipeline id.",
33+
Description = "The Azure DevOps pipeline ID.",
3434
IsRequired = true,
3535
};
36+
37+
public static readonly Option<int> PipelineIdNotRequired = new(new[] { "--pipeline-id", "-i" })
38+
{
39+
Description = "The Azure DevOps pipeline ID.",
40+
IsRequired = false,
41+
};
42+
43+
public static readonly Option<FileInfo> SourceFilePath = new("--source-file-path")
44+
{
45+
Description = "The file path corresponding to the Azure DevOps pipeline file.",
46+
IsRequired = false,
47+
};
3648
}

src/ActionsImporter/Commands/AzureDevOps/DryRun.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ protected override Command GenerateCommand(App app)
1818
{
1919
var command = base.GenerateCommand(app);
2020

21-
command.AddGlobalOption(Common.PipelineId);
2221
command.AddGlobalOption(Common.InstanceUrl);
2322
command.AddGlobalOption(Common.Organization);
2423
command.AddGlobalOption(Common.Project);

src/ActionsImporter/Commands/AzureDevOps/Migrate.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ protected override Command GenerateCommand(App app)
1818
{
1919
var command = base.GenerateCommand(app);
2020

21-
command.AddGlobalOption(Common.PipelineId);
2221
command.AddGlobalOption(Common.InstanceUrl);
2322
command.AddGlobalOption(Common.Organization);
2423
command.AddGlobalOption(Common.Project);

src/ActionsImporter/Commands/AzureDevOps/ReleasePipeline/DryRun.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,7 @@ public DryRun(string[] args) : base(args)
1111

1212
protected override string Name => "release";
1313
protected override string Description => "Target a release pipeline";
14-
protected override ImmutableArray<Option> Options => ImmutableArray<Option>.Empty;
14+
protected override ImmutableArray<Option> Options => ImmutableArray.Create<Option>(
15+
Common.PipelineIdRequired
16+
);
1517
}

src/ActionsImporter/Commands/AzureDevOps/ReleasePipeline/Migrate.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,7 @@ public Migrate(string[] args) : base(args)
1111

1212
protected override string Name => "release";
1313
protected override string Description => "Target a release pipeline";
14-
protected override ImmutableArray<Option> Options => ImmutableArray<Option>.Empty;
14+
protected override ImmutableArray<Option> Options => ImmutableArray.Create<Option>(
15+
Common.PipelineIdRequired
16+
);
1517
}

0 commit comments

Comments
 (0)