test(e2e): guard BundleExport comma + document DeleteAreaAsync (review fixes)
This commit is contained in:
@@ -194,6 +194,15 @@ public static partial class CliRunner
|
|||||||
/// swallows any failure.
|
/// swallows any failure.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="id">Area id.</param>
|
/// <param name="id">Area id.</param>
|
||||||
|
/// <remarks>
|
||||||
|
/// This method intentionally does NOT delegate to <see cref="BestEffortAsync"/>
|
||||||
|
/// even though the behaviour is identical. <see cref="BestEffortAsync"/> models
|
||||||
|
/// two-word commands (<c><group> <verb></c>), whereas
|
||||||
|
/// <c>site area delete</c> is a three-word command; extracting it would require
|
||||||
|
/// changing <see cref="BestEffortAsync"/>'s signature or adding an overload.
|
||||||
|
/// The inline try/catch is kept here deliberately — if you need to fix teardown
|
||||||
|
/// logic, update both this method and any other three-word deletes together.
|
||||||
|
/// </remarks>
|
||||||
public static async Task DeleteAreaAsync(int id)
|
public static async Task DeleteAreaAsync(int id)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -267,6 +276,16 @@ public static partial class CliRunner
|
|||||||
string outputPath, int templateId, string passphrase, string sourceEnvironment)
|
string outputPath, int templateId, string passphrase, string sourceEnvironment)
|
||||||
{
|
{
|
||||||
var templateName = await ResolveTemplateNameAsync(templateId);
|
var templateName = await ResolveTemplateNameAsync(templateId);
|
||||||
|
|
||||||
|
// The CLI's --templates flag is comma-separated, so a name that itself
|
||||||
|
// contains a comma would silently split into multiple selectors and scope
|
||||||
|
// the export to the wrong set of templates.
|
||||||
|
if (templateName.Contains(','))
|
||||||
|
{
|
||||||
|
throw new InvalidOperationException(
|
||||||
|
$"Template name '{templateName}' contains a comma and cannot be used with '--templates'.");
|
||||||
|
}
|
||||||
|
|
||||||
await RunAsync(
|
await RunAsync(
|
||||||
"bundle", "export",
|
"bundle", "export",
|
||||||
"--output", outputPath,
|
"--output", outputPath,
|
||||||
|
|||||||
Reference in New Issue
Block a user