Skip to content

Commit c777576

Browse files
Disable response file handling for command line (#13796)
* Disable response file handling for command line
1 parent d887cf7 commit c777576

File tree

3 files changed

+32
-6
lines changed

3 files changed

+32
-6
lines changed

tools/azsdk-cli/Azure.Sdk.Tools.Cli.Tests/Tools/ReleasePlan/PackageReleaseStatusToolTests.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
3+
using System.CommandLine;
34
using Azure.Sdk.Tools.Cli.Models;
45
using Azure.Sdk.Tools.Cli.Models.AzureDevOps;
56
using Azure.Sdk.Tools.Cli.Services;
@@ -470,5 +471,27 @@ public async Task UpdatePackageReleaseStatus_WhenNoMatchingReleasePlanFound_Retu
470471
x => x.UpdateWorkItemAsync(It.IsAny<int>(), It.IsAny<Dictionary<string, string>>()),
471472
Times.Never);
472473
}
474+
475+
[Test]
476+
public void Verify_cli_parses_package_name()
477+
{
478+
var command = packageReleaseStatusTool.GetCommandInstances().First();
479+
var parseConfig = new CommandLineConfiguration(command)
480+
{
481+
ResponseFileTokenReplacer = null
482+
};
483+
484+
var parseResult = command.Parse("--package-name @azure/template --language JavaScript", parseConfig);
485+
Assert.That(parseResult.Errors, Is.Empty);
486+
487+
parseResult = command.Parse("--package-name sdk/template/aztemplate --language Go", parseConfig);
488+
Assert.That(parseResult.Errors, Is.Empty);
489+
490+
parseResult = command.Parse("--package-name azure-template --language Python", parseConfig);
491+
Assert.That(parseResult.Errors, Is.Empty);
492+
493+
parseResult = command.Parse("--package-name Azure.Template --language .NET", parseConfig);
494+
Assert.That(parseResult.Errors, Is.Empty);
495+
}
473496
}
474497
}

tools/azsdk-cli/Azure.Sdk.Tools.Cli/CHANGELOG.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
# Release History
22

3-
## 0.5.15 (Unreleased)
3+
## 0.5.15 (2026-01-30)
44

55
### Features Added
66

7-
- Added a new CLI command to update the package release status in release plan.
87
- Added new MCP tools azsdk_package_generate_samples and azsdk_package_translate_samples for end-to-end sample workflows.
98

10-
### Breaking Changes
11-
129
### Bugs Fixed
1310

14-
### Other Changes
11+
- Disabled response file handling for command line to avoid considering JavaScript package name with '@' as response file name.
1512

1613
## 0.5.14 (2026-01-27)
1714

tools/azsdk-cli/Azure.Sdk.Tools.Cli/Commands/CommandRunner.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,14 @@ public static async Task<int> BuildAndRun(
7676
#if DEBUG
7777
ValidateCommandTree(rootCommand);
7878
#endif
79+
// Disable response file support as it led to unexpected behaviour when cli command takes package name with '@' symbol as value.
80+
// @azure/template package name causes the parser to look for a response file named 'azure/template' which is not the intended behaviour.
81+
var parseConfig = new CommandLineConfiguration(rootCommand)
82+
{
83+
ResponseFileTokenReplacer = null
84+
};
7985

80-
var parseResult = rootCommand.Parse(args);
86+
var parseResult = rootCommand.Parse(args, parseConfig);
8187
return await parseResult.InvokeAsync();
8288
}
8389

0 commit comments

Comments
 (0)