Skip to content

Normalize TypeSpec path inputs ending in tspconfig.yaml for release plan updates#15785

Merged
praveenkuttappan merged 3 commits into
mainfrom
copilot/fix-tspconfig-path-error
May 28, 2026
Merged

Normalize TypeSpec path inputs ending in tspconfig.yaml for release plan updates#15785
praveenkuttappan merged 3 commits into
mainfrom
copilot/fix-tspconfig-path-error

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 28, 2026

azsdk_update_release_plan and related TypeSpec path handling assumed a project-directory input and could mis-handle paths that already included tspconfig.yaml (e.g., appending it again). This change normalizes both relative and absolute .../tspconfig.yaml inputs to the project root before validation/parsing/path extraction.

  • Path normalization in TypeSpec model parsing

    • Updated TypeSpecProject path handling to canonicalize inputs:
      • specification/.../service/tspconfig.yamlspecification/.../service
      • /abs/.../service/tspconfig.yaml/abs/.../service
    • Applied consistently in:
      • IsValidTypeSpecProjectPath
      • ParseTypeSpecConfig
  • Helper-level sanitization for release-plan flows

    • Updated TypeSpecHelper to treat tspconfig.yaml inputs as project-root paths in:
      • ParseTypeSpecProjectAsync
      • GetTypeSpecProjectRelativePath
    • Relative path extraction now returns the project path (not the config file path), preserving expected specification/... behavior.
  • Focused test coverage

    • Added tests to verify:
      • validation succeeds for both relative and absolute .../tspconfig.yaml inputs
      • relative-path extraction strips tspconfig.yaml
      • UpdateReleasePlan succeeds with both relative and absolute .../tspconfig.yaml inputs
var relativeConfigPath = "specification/containerservice/.../fleet/tspconfig.yaml";
var absoluteConfigPath = Path.GetFullPath(relativeConfigPath);

// Both are normalized to project root before validation/parsing/path extraction.

Copilot AI and others added 2 commits May 28, 2026 15:49
Co-authored-by: praveenkuttappan <55455725+praveenkuttappan@users.noreply.github.com>
Co-authored-by: praveenkuttappan <55455725+praveenkuttappan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix AzSDK MCP tool path handling for tspconfig.yaml Normalize TypeSpec path inputs ending in tspconfig.yaml for release plan updates May 28, 2026
Copilot AI requested a review from praveenkuttappan May 28, 2026 15:51
Comment thread tools/azsdk-cli/Azure.Sdk.Tools.Cli/Helpers/TypeSpecHelper.cs
@praveenkuttappan praveenkuttappan marked this pull request as ready for review May 28, 2026 20:10
Copilot AI review requested due to automatic review settings May 28, 2026 20:10
@praveenkuttappan praveenkuttappan requested a review from a team as a code owner May 28, 2026 20:10
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@praveenkuttappan praveenkuttappan merged commit ee2090a into main May 28, 2026
12 of 13 checks passed
@praveenkuttappan praveenkuttappan deleted the copilot/fix-tspconfig-path-error branch May 28, 2026 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AzSDK MCP tool to update release plan is failing when TypeSpec path ends with tspconfig.yaml

4 participants