Fix CustomizeCode tool to return package and language#15494
Fix CustomizeCode tool to return package and language#15494
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the azsdk_customized_code_update tool to populate PackageName, Language, PackageType, and TypeSpecProject on most response paths by resolving PackageInfo up-front and funneling returns through a shared response-enrichment helper.
Changes:
- Resolve
PackageInfoearly via the selectedLanguageService(with warning-only failure handling). - Introduce a local
CreateResponse(...)helper that fills in package/language/type metadata consistently. - Wrap most existing early-return responses with
CreateResponse(...)so metadata is present even on failures.
| CustomizedCodeUpdateResponse CreateResponse(CustomizedCodeUpdateResponse response) | ||
| { | ||
| response.PackageName ??= packageInfo?.PackageName; | ||
| response.Language = packageInfo?.Language ?? languageService.Language; | ||
| response.PackageType = packageInfo?.SdkType ?? SdkType.Unknown; |
There was a problem hiding this comment.
@copilot apply changes based on this feedback
There was a problem hiding this comment.
Applied in commit 1ba4648. The remainder of RunUpdateAsync (after languageService/packageInfo are resolved and CreateResponse is defined) is now wrapped in an outer try/catch that:
- Rethrows
OperationCanceledExceptionto honor cancellation - Returns
CreateResponse(...)with enriched package/language metadata for any unexpected errors from downstream operations (regen, build, second classification pass, patching, etc.)
Also fixed the GetPackageInfo catch block (the first reviewer comment) to include catch (OperationCanceledException) when (ct.IsCancellationRequested) { throw; } before the broad catch so cancellation isn't swallowed there either.
…nder in try/catch Agent-Logs-Url: https://github.com/Azure/azure-sdk-tools/sessions/20d768ee-6217-409a-81b5-4be796043ded Co-authored-by: samvaity <16845631+samvaity@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Noticed package_type and language is
Unknownbecause this response path never sets it