Skip to content
This repository was archived by the owner on Mar 22, 2023. It is now read-only.

Commit 5a6eb02

Browse files
Updating options on GH-Valet with new ADO options (#104)
* Updating options on GH valet for new ADO configs * Update audit option * update dry run options * remove space * Add option * Updated location of source file * Pipeline id is not required for build pipelines now with config/source files * typo
1 parent 848d112 commit 5a6eb02

8 files changed

Lines changed: 38 additions & 8 deletions

File tree

src/Valet/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/Valet/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/Valet/Commands/AzureDevOps/BuildPipeline/Migrate.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,9 @@ 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+
15+
protected override ImmutableArray<Option> Options => ImmutableArray.Create<Option>(
16+
Common.SourceFilePath,
17+
Common.PipelineIdNotRequired
18+
);
1519
}

src/Valet/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/Valet/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/Valet/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/Valet/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/Valet/Commands/AzureDevOps/ReleasePipeline/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 => "release";
1313
protected override string Description => "Target a release pipeline";
14-
protected override ImmutableArray<Option> Options => ImmutableArray<Option>.Empty;
14+
15+
protected override ImmutableArray<Option> Options => ImmutableArray.Create<Option>(
16+
Common.PipelineIdRequired
17+
);
1518
}

0 commit comments

Comments
 (0)