Skip to content

[APIView] Project/package linking from multi-emitter TypeSpec metadata#15146

Open
AlitzelMendez wants to merge 6 commits intoAzure:mainfrom
AlitzelMendez:metadata-emitter-format
Open

[APIView] Project/package linking from multi-emitter TypeSpec metadata#15146
AlitzelMendez wants to merge 6 commits intoAzure:mainfrom
AlitzelMendez:metadata-emitter-format

Conversation

@AlitzelMendez
Copy link
Copy Markdown
Member

@AlitzelMendez AlitzelMendez commented Apr 14, 2026

closes: #14975

Projects now correctly handle TypeSpec specs where:

  • A language has more than one emitter but a single underlying SDK package

The database looks like

image

Copilot AI review requested due to automatic review settings April 14, 2026 22:56
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.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Fixes project-to-package/review linkage and namespace decision handling for TypeSpec metadata scenarios where a single language can emit multiple SDK packages, and improves project lookup efficiency via a flattened package token index.

Changes:

  • Extend TypeSpec metadata and project models to support multiple packages per language and multiple review IDs per language.
  • Add PackageLookup tokens (language::packagename) for efficient Cosmos queries when linking reviews to projects.
  • Update namespace decision data structures and UI/API flows to support multiple active namespace entries per language (per package).

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/dotnet/APIView/ClientSPA/src/app/_services/projects/projects.service.ts Updates namespace status API payload to include the namespace identifier.
src/dotnet/APIView/ClientSPA/src/app/_models/projectModel.ts Changes related reviews shape from language map to array.
src/dotnet/APIView/ClientSPA/src/app/_models/namespaceModel.ts Changes current namespace status to multi-entry per language.
src/dotnet/APIView/ClientSPA/src/app/_components/namespace-page/namespace-page.component.ts Builds rows per (language, package) namespace entry and deduplicates revision fetches.
src/dotnet/APIView/APIViewWeb/Repositories/CosmosProjectRepository.cs Switches project lookup-by-package to PackageLookup/ARRAY_CONTAINS.
src/dotnet/APIView/APIViewWeb/Models/TypeSpecMetadataModel.cs Supports multiple LanguageConfig entries per language.
src/dotnet/APIView/APIViewWeb/Models/ProjectModel.cs Stores multiple expected packages per language, adds PackageLookup, and multiple review IDs per language.
src/dotnet/APIView/APIViewWeb/Models/NamespaceModel.cs Stores multiple current namespace decisions per language.
src/dotnet/APIView/APIViewWeb/Managers/ProjectsManager.cs Builds/uses multi-package expected packages, maintains multi-review links, and generates PackageLookup.
src/dotnet/APIView/APIViewWeb/Managers/NamespaceManager.cs Updates namespace approval/update logic to operate on specific namespace entries per language/package.
src/dotnet/APIView/APIViewWeb/Managers/Interfaces/INamespaceManager.cs Updates interface to accept namespace identifier and multi-package dictionaries.
src/dotnet/APIView/APIViewWeb/LeanControllers/ProjectsController.cs Adjusts related review retrieval and namespace status resolution for multi-entry states.
src/dotnet/APIView/APIViewWeb/Helpers/LanguageServiceHelpers.cs Expands language alias mapping (e.g., dotnet→C#, ts/typescript→JavaScript).
src/dotnet/APIView/APIViewUnitTests/TypeSpecMetadataIntegrationTests.cs Updates integration tests for multi-config-per-language metadata.
src/dotnet/APIView/APIViewUnitTests/ProjectsManagerTests.cs Updates tests for multi-review-per-language and multi-package-per-language behavior.
src/dotnet/APIView/APIViewUnitTests/NamespaceManagerTests.cs Expands tests for multi-entry namespace behaviors and a real-world multi-package scenario.
src/dotnet/APIView/APIViewUnitTests/CodeFileManagerTests.cs Updates tests for metadata language configs now being lists.
src/dotnet/APIView/APIViewUnitTests/APIRevisionsManagerTests.cs Updates tests for metadata language configs now being lists.

Comment thread src/dotnet/APIView/APIViewWeb/LeanControllers/ProjectsController.cs
Comment thread src/dotnet/APIView/APIViewWeb/LeanControllers/ProjectsController.cs Outdated
Comment thread src/dotnet/APIView/APIViewWeb/Repositories/CosmosProjectRepository.cs Outdated
Comment thread src/dotnet/APIView/APIViewWeb/Managers/NamespaceManager.cs
Comment thread src/dotnet/APIView/APIViewWeb/Managers/ProjectsManager.cs Outdated
@AlitzelMendez AlitzelMendez requested a review from Copilot April 14, 2026 23:33
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.

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.

Comment thread src/dotnet/APIView/APIViewWeb/LeanControllers/ProjectsController.cs Outdated
Comment thread src/dotnet/APIView/APIViewWeb/Managers/ProjectsManager.cs Outdated
Comment thread src/dotnet/APIView/APIViewWeb/Managers/NamespaceManager.cs
@AlitzelMendez AlitzelMendez changed the title [APIView] Project/package linking bugs from multi-emitter TypeSpec metadata [APIView] Project/package linking from multi-emitter TypeSpec metadata Apr 15, 2026
Comment thread src/dotnet/APIView/APIViewUnitTests/NamespaceManagerTests.cs
Copy link
Copy Markdown
Member

@tjprescott tjprescott left a comment

Choose a reason for hiding this comment

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

A few questions.

It seems like most of the tests were just upgraded in place to use a single entry array. But we've seen at least two scenarios where I'm very curious how we handle them:

  1. The Java scenario where there is one tspconfig entry with a "flavor" key that changes the scope of approval (the azure vs azurev2 scenario). Yet end up with two packages with different namespaces from different emitters.
  2. The C# scenarios where there are two tspconfig entries that point to the SAME namespace and only one package gets generated.
  3. The other C# scenarios where there are two tspconfig entries that point to different namespaces and generate different packages.

Are we accommodating these scenarios?

Copy link
Copy Markdown
Member

@tjprescott tjprescott left a comment

Choose a reason for hiding this comment

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

Still not entirely following. Might make more sense to just have a call to discuss.

Comment thread src/dotnet/APIView/APIViewUnitTests/ProjectsManagerTests.cs Outdated
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.

[APIView] Handle multiple emitters per language in tspconfig.yaml

3 participants