Skip to content

fix: disambiguate TypeScript navigation metadata for repeated segments - #8247

Open
Shubham Padkonde (Shubham-Padkonde) wants to merge 11 commits into
microsoft:mainfrom
Shubham-Padkonde:fix/typescript-navigation-collision
Open

Shubham Padkonde (Shubham-Padkonde) wants to merge 11 commits into
microsoft:mainfrom
Shubham-Padkonde:fix/typescript-navigation-collision

Conversation

@Shubham-Padkonde

Copy link
Copy Markdown
Contributor

Repeated route segments such as /api/foo/foo/bar generate parent and child request builders with the same name. TypeScript aliases the imported interface but leaves the navigation constant unaliased, producing conflicting declarations and a self-reference.

Alias imported symbols against all declarations in their code file. Resolve navigation and request metadata from the actual target request builder's file and emit its imported alias, instead of looking up a matching name under the parent namespace.

Fixes #6771.

Validation:

  • Original generated minimal client fails TypeScript compilation with TS2395 and TS2448. The fixed expanded client compiles with TypeScript 5.8.2 and Kiota runtime preview.107.
  • Three generator/refiner/writer regressions cover repeated segments, indexed navigation and three consecutive repeated segments. The original direct-repeat regression fails on its missing alias. All three pass after the fix.
  • All 189 TypeScript writer/refiner tests pass, including existing escaped path-parameter coverage.
  • .NET 10 CLI build and formatting verification pass (four SourceLink warnings from the Linux/Windows worktree setup).
  • Actual generated-client runtime checks verify distinct parent/child metadata objects and five fluent request URLs: /api/foo, /api/foo/foo, /api/foo/foo/bar, /api/foo/foo/foo/bar, and /api/foo/42/foo/bar. A local stub adapter returns the response; no external HTTP calls are made.

Developed and tested with AI assistance. No human review or service-side validation is claimed.

@baywet

Copy link
Copy Markdown
Member

Shubham Padkonde (@Shubham-Padkonde) your behaviour is disruptive, opening about 30 PRs on the repos in a couple of hours time, most likely code that was AI generated and not tested/reviewed, will only clog our review pipeline. Please stop opening additional pull requests and work on the comments added to existing ones. We have turned on pull requests limits on this repository, and will proceed to blocking you at the organization level if additional pull requests are opened on other repositories before the already opened ones are reviewed and closed/or merged.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

A critical issue remains in navigation metadata resolution for repeated segments.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity

Open (1)
What changed in this PR

Fixes TypeScript metadata name collisions caused by repeated route segments.

Changes:

  • Aliases imports that conflict with declarations.
  • Resolves navigation metadata from target request-builder files.
  • Adds regression tests and changelog coverage.
File Summary
tests/​Kiota.Builder.Tests/​KiotaBuilderTests.TypeScriptNavigation.cs Adds repeated-route navigation regression tests.
src/​Kiota.Builder/​Writers/​TypeScript/​CodeConstantWriter.cs Resolves and emits navigation metadata references; a critical lookup issue remains.
src/​Kiota.Builder/​Refiners/​TypeScriptRefiner.cs Adds file-level import aliasing.
CHANGELOG.md Documents the fix.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/Kiota.Builder/Writers/TypeScript/CodeConstantWriter.cs
Copilot AI review requested due to automatic review settings September 21, 2026 15:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@baywet

Copy link
Copy Markdown
Member

Shubham Padkonde (@Shubham-Padkonde) can you solve the conflicts please?

@Shubham-Padkonde

Copy link
Copy Markdown
Contributor Author

Shubham Padkonde (@Shubham-Padkonde) can you solve the conflicts please?

Okay man, I will try to get merging open PR's and then start working on new contributions.

@baywet

Copy link
Copy Markdown
Member

then start working on new contributions.

please don't, you have over 20 PRs that are still open, let's see those to a resolution first.

@Shubham-Padkonde

Copy link
Copy Markdown
Contributor Author

then start working on new contributions.

please don't, you have over 20 PRs that are still open, let's see those to a resolution first.

Yes thanks for input, will wait till resolution's for all. Happy to contribute and work with you guys 🫡

Copilot AI review requested due to automatic review settings September 21, 2026 16:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Shubham-Padkonde

Copy link
Copy Markdown
Contributor Author

Resolved the changelog conflict in 79b29e3 by merging current main and retaining both entries. The .NET 10 build passes with no warnings; 191 TypeScript tests and all nine repeated-navigation/path-collision generation cases pass. No production changes were added beyond the existing PR and upstream main.

This follow-up was prepared and tested with Codex assistance. New Microsoft submissions remain on hold while the existing PRs reach resolution.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

No unresolved issues block approval.

Review effort: Lite
Findings: None

Resolved since last review (1)

Copilot AI review requested due to automatic review settings September 22, 2026 09:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings September 22, 2026 14:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@baywet

Copy link
Copy Markdown
Member

Shubham Padkonde (@Shubham-Padkonde) this PR is conflicting, would you mind handling the conflicts when you have a minute please?

Copilot AI review requested due to automatic review settings September 23, 2026 12:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings September 23, 2026 14:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has conflicting changes, the author must resolve the conflicts before this pull request can be merged.

Copilot AI review requested due to automatic review settings September 23, 2026 17:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown
Contributor

Conflicts have been resolved. A maintainer will take a look shortly.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has conflicting changes, the author must resolve the conflicts before this pull request can be merged.

Copilot AI review requested due to automatic review settings September 24, 2026 01:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown
Contributor

Conflicts have been resolved. A maintainer will take a look shortly.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has conflicting changes, the author must resolve the conflicts before this pull request can be merged.

Copilot AI review requested due to automatic review settings September 25, 2026 01:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown
Contributor

Conflicts have been resolved. A maintainer will take a look shortly.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has conflicting changes, the author must resolve the conflicts before this pull request can be merged.

Copilot AI review requested due to automatic review settings September 25, 2026 21:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown
Contributor

Conflicts have been resolved. A maintainer will take a look shortly.

This branch has not been deployed

No deployments
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.

Typescript RequestBuilderNavigationMetadata name collision unhandled

3 participants