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

Commit

Permalink
Updating options on GH-Valet with new ADO options (#104)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
begonaguereca authored Jan 5, 2023
1 parent 848d112 commit 5a6eb02
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 8 deletions.
7 changes: 7 additions & 0 deletions src/Valet/Commands/AzureDevOps/Audit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,14 @@ public Audit(string[] args)
protected override string Name => "azure-devops";
protected override string Description => "An audit will output a list of data used in an Azure DevOps instance.";

private static readonly Option<FileInfo> ConfigFilePath = new("--config-file-path")
{
Description = "The file path corresponding to the Azure DevOps configuration file.",
IsRequired = false,
};

protected override ImmutableArray<Option> Options => ImmutableArray.Create<Option>(
ConfigFilePath,
Common.Organization,
Common.Project,
Common.InstanceUrl,
Expand Down
6 changes: 5 additions & 1 deletion src/Valet/Commands/AzureDevOps/BuildPipeline/DryRun.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,9 @@ public DryRun(string[] args) : base(args)

protected override string Name => "pipeline";
protected override string Description => "Target a designer or YAML pipeline";
protected override ImmutableArray<Option> Options => ImmutableArray<Option>.Empty;

protected override ImmutableArray<Option> Options => ImmutableArray.Create<Option>(
Common.SourceFilePath,
Common.PipelineIdNotRequired
);
}
6 changes: 5 additions & 1 deletion src/Valet/Commands/AzureDevOps/BuildPipeline/Migrate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,9 @@ public Migrate(string[] args) : base(args)

protected override string Name => "pipeline";
protected override string Description => "Target a designer or YAML pipeline";
protected override ImmutableArray<Option> Options => ImmutableArray<Option>.Empty;

protected override ImmutableArray<Option> Options => ImmutableArray.Create<Option>(
Common.SourceFilePath,
Common.PipelineIdNotRequired
);
}
16 changes: 14 additions & 2 deletions src/Valet/Commands/AzureDevOps/Common.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,21 @@ public static class Common
IsRequired = false,
};

public static readonly Option<int> PipelineId = new(new[] { "--pipeline-id", "-i" })
public static readonly Option<int> PipelineIdRequired = new(new[] { "--pipeline-id", "-i" })
{
Description = "The Azure DevOps pipeline id.",
Description = "The Azure DevOps pipeline ID.",
IsRequired = true,
};

public static readonly Option<int> PipelineIdNotRequired = new(new[] { "--pipeline-id", "-i" })
{
Description = "The Azure DevOps pipeline ID.",
IsRequired = false,
};

public static readonly Option<FileInfo> SourceFilePath = new("--source-file-path")
{
Description = "The file path corresponding to the Azure DevOps pipeline file.",
IsRequired = false,
};
}
1 change: 0 additions & 1 deletion src/Valet/Commands/AzureDevOps/DryRun.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ protected override Command GenerateCommand(App app)
{
var command = base.GenerateCommand(app);

command.AddGlobalOption(Common.PipelineId);
command.AddGlobalOption(Common.InstanceUrl);
command.AddGlobalOption(Common.Organization);
command.AddGlobalOption(Common.Project);
Expand Down
1 change: 0 additions & 1 deletion src/Valet/Commands/AzureDevOps/Migrate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ protected override Command GenerateCommand(App app)
{
var command = base.GenerateCommand(app);

command.AddGlobalOption(Common.PipelineId);
command.AddGlobalOption(Common.InstanceUrl);
command.AddGlobalOption(Common.Organization);
command.AddGlobalOption(Common.Project);
Expand Down
4 changes: 3 additions & 1 deletion src/Valet/Commands/AzureDevOps/ReleasePipeline/DryRun.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@ public DryRun(string[] args) : base(args)

protected override string Name => "release";
protected override string Description => "Target a release pipeline";
protected override ImmutableArray<Option> Options => ImmutableArray<Option>.Empty;
protected override ImmutableArray<Option> Options => ImmutableArray.Create<Option>(
Common.PipelineIdRequired
);
}
5 changes: 4 additions & 1 deletion src/Valet/Commands/AzureDevOps/ReleasePipeline/Migrate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@ public Migrate(string[] args) : base(args)

protected override string Name => "release";
protected override string Description => "Target a release pipeline";
protected override ImmutableArray<Option> Options => ImmutableArray<Option>.Empty;

protected override ImmutableArray<Option> Options => ImmutableArray.Create<Option>(
Common.PipelineIdRequired
);
}

0 comments on commit 5a6eb02

Please sign in to comment.