Skip to content

feat: add allowlist compatibility check for API proposals in extensions#289923

Merged
joaomoreno merged 1 commit intomainfrom
joao/bronze-guan
Jan 23, 2026
Merged

feat: add allowlist compatibility check for API proposals in extensions#289923
joaomoreno merged 1 commit intomainfrom
joao/bronze-guan

Conversation

@joaomoreno
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings January 23, 2026 14:35
@joaomoreno joaomoreno enabled auto-merge (squash) January 23, 2026 14:35
@joaomoreno joaomoreno self-assigned this Jan 23, 2026
@vs-code-engineering
Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@lszomoru

Matched files:

  • build/azure-pipelines/common/releaseBuild.ts
  • build/azure-pipelines/common/versionCompatibility.ts

@vs-code-engineering vs-code-engineering bot added this to the January 2026 milestone Jan 23, 2026
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

This PR adds a new validation step to check that API proposals declared in an extension's package.json are properly allowlisted in VS Code's product.json. This ensures consistency between what extensions use and what VS Code explicitly allows.

Changes:

  • Added areAllowlistedApiProposalsMatching function to validate API proposal allowlist consistency
  • Integrated the new validation into the Copilot Chat compatibility check in release builds
  • Added comprehensive test coverage for the new validation logic

Reviewed changes

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

File Description
build/azure-pipelines/common/versionCompatibility.ts Added new areAllowlistedApiProposalsMatching function with logic to validate that all API proposals declared in an extension's package.json are allowlisted in product.json, handling versioned proposals by stripping version suffixes. Includes comprehensive unit tests covering various scenarios.
build/azure-pipelines/common/releaseBuild.ts Integrated the new allowlist validation into the Copilot Chat compatibility check, loading product.json and calling the validation function with appropriate error handling and console output.
Comments suppressed due to low confidence (2)

build/azure-pipelines/common/versionCompatibility.ts:431

  • Trailing whitespace found at the end of the line. This should be removed to maintain code cleanliness.
    build/azure-pipelines/common/versionCompatibility.ts:164
  • The error message is inconsistent with VS Code's capitalization conventions. In the codebase, "product.json" is typically capitalized as "Product.json" when referring to it in user-facing messages (see line 89 in releaseBuild.ts and line 121 in the same file). For consistency with the user-facing message on line 121 of releaseBuild.ts, consider using "Product.json" instead of "product.json".
			errors.push(`API proposal '${proposal}' is declared in extension '${extensionId}' package.json but is not allowlisted in product.json`);

Comment on lines +428 to +431

// Versioned proposal not in allowlist - incompatible
assert.strictEqual(areAllowlistedApiProposalsMatching('test.ext', ['proposalA'], ['proposalB@2']).compatible, false);

Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

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

Trailing whitespace found at the end of the line. This should be removed to maintain code cleanliness.

This issue also appears in the following locations of the same file:

  • line 431
Suggested change
// Versioned proposal not in allowlist - incompatible
assert.strictEqual(areAllowlistedApiProposalsMatching('test.ext', ['proposalA'], ['proposalB@2']).compatible, false);
// Versioned proposal not in allowlist - incompatible
assert.strictEqual(areAllowlistedApiProposalsMatching('test.ext', ['proposalA'], ['proposalB@2']).compatible, false);

Copilot uses AI. Check for mistakes.
compatible: false,
errors: [
`Extension '${extensionId}' declares API proposals in package.json (${manifestProposals.join(', ')}) ` +
`but product.json does not allowlist any API proposals for this extension`
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

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

The error message is inconsistent with VS Code's capitalization conventions. In the codebase, "product.json" is typically capitalized as "Product.json" when referring to it in user-facing messages (see line 89 in releaseBuild.ts and line 121 in the same file). However, when used in technical contexts or inline in sentences, it's kept lowercase. For consistency with the user-facing message on line 121 of releaseBuild.ts, consider using "Product.json" at the start of error messages.

This issue also appears in the following locations of the same file:

  • line 164

Copilot uses AI. Check for mistakes.
@joaomoreno joaomoreno merged commit 69390a6 into main Jan 23, 2026
27 of 28 checks passed
@joaomoreno joaomoreno deleted the joao/bronze-guan branch January 23, 2026 14:56
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Mar 9, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants