feat(cli): deploy area --id <areaId> [--force] bulk-deploys an area subtree with deploy site's deadline and exit-code contract (Gitea #40)

This commit is contained in:
Joseph Doherty
2026-10-22 14:12:46 -04:00
parent f72c72c52f
commit 74d5fba2b0
5 changed files with 165 additions and 3 deletions
@@ -175,6 +175,28 @@ public class CommandTreeTests
Assert.True(withForce.GetValue(forceOption));
}
/// <summary>Verifies that the deploy group has an area verb with a required id and a force flag (Gitea #40).</summary>
[Fact]
public void Deploy_HasAreaVerb_WithRequiredId_AndForceFlag()
{
// Area-subtree bulk deploy: the scope is the verb, like `deploy site`. The
// area id is required (never an accidental site- or fleet-wide push) and
// --force is a flag whose absence is the non-destructive default.
var deploy = DeployCommands.Build(Url, Format, Username, Password);
var area = deploy.Subcommands.Single(c => c.Name == "area");
var forceOption = (Option<bool>)area.Options.Single(o => o.Name == "--force");
Assert.NotEmpty(area.Parse([]).Errors);
var withoutForce = area.Parse(["--id", "12"]);
Assert.Empty(withoutForce.Errors);
Assert.False(withoutForce.GetValue(forceOption));
var withForce = area.Parse(["--id", "12", "--force"]);
Assert.Empty(withForce.Errors);
Assert.True(withForce.GetValue(forceOption));
}
/// <summary>Verifies that the instance native alarm source group has set and clear subcommands.</summary>
[Fact]
public void InstanceNativeAlarmSource_HasSetAndClear()
@@ -465,6 +487,7 @@ public class CommandTreeTests
[InlineData(typeof(DebugSnapshotCommand))]
[InlineData(typeof(MgmtDeployInstanceCommand))]
[InlineData(typeof(MgmtDeploySiteCommand))]
[InlineData(typeof(MgmtDeployAreaCommand))]
[InlineData(typeof(QueryAuditLogCommand))]
[InlineData(typeof(ExportBundleCommand))]
[InlineData(typeof(PreviewBundleCommand))]