Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 19, 2025

Packages impacted by this PR

  • @azure/keyvault-common
  • @azure/keyvault-keys
  • @azure/keyvault-secrets
  • @azure/keyvault-certificates

Issues associated with this PR

Addresses issue requesting removal of @azure/core-http-compat dependency from keyvault packages as they only used a single type import.

Describe the problem that is addressed by this PR

The keyvault packages depended on @azure/core-http-compat solely for the ExtendedCommonClientOptions type, creating an unnecessary runtime dependency.

What are the possible designs available to address the problem? If there are more than one possible design, why was the one in this PR chosen?

Chosen approach: Define required types in @azure/keyvault-common and export them for use by all keyvault client packages.

  • Created @azure/keyvault-common/src/extendedClientOptions.ts containing:
    • CommonClientOptions - extends PipelineOptions from existing @azure/core-rest-pipeline dependency
    • AdditionalPolicyConfig, KeepAliveOptions, RedirectOptions
    • ExtendedCommonClientOptions - combines the above

Alternative considered: Add @azure/core-client dependency to each package. Rejected to avoid introducing new dependencies.

Removed dependencies:

  • @azure/core-http-compat from keyvault-keys, keyvault-secrets, keyvault-certificates
  • @azure/core-client from keyvault-common (previously unused at runtime)

Are there test cases added in this PR? (If not, why?)

No new tests added. This is a refactoring that maintains identical type signatures and behavior. Existing tests validate functionality.

Provide a list of related PRs (if any)

None

Command used to generate this PR:**(Applicable only to SDK release request PRs)

N/A

Checklists

  • Added impacted package name to the issue description
  • Does this PR needs any fixes in the SDK Generator?** (If so, create an Issue in the Autorest/typescript repository and link it here)
  • Added a changelog (if necessary)
Original prompt

This section details on the original issue you should resolve

<issue_title>[keyvault] remove dependency on @azure/core-http-compat</issue_title>
<issue_description>It appears that current version of keyvault packages only uses a type from @azure/core-http-compat

keyvault-keys/src/keysModels.ts:5:import type { ExtendedCommonClientOptions } from "@azure/core-http-compat";
keyvault-secrets/src/secretsModels.ts:5:import type { ExtendedCommonClientOptions } from "@azure/core-http-compat";
keyvault-certificates/src/certificatesModels.ts:6:import type { ExtendedCommonClientOptions } from "@azure/core-http-compat";

It's better to define that inline if there's no runtime dependency on @azure/core-http-compat any more.</issue_description>

<agent_instructions>Remove dependency on @azure/core-http-runtime from keyvault client SDK packages. Defined the needed type in source instead.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI self-assigned this Dec 19, 2025
Copilot AI and others added 4 commits December 19, 2025 23:54
- Defined KeepAliveOptions, RedirectOptions, and ExtendedCommonClientOptions inline in keysModels.ts, secretsModels.ts, and certificatesModels.ts
- Removed import of ExtendedCommonClientOptions from @azure/core-http-compat
- Added import of CommonClientOptions from @azure/core-client
- Removed @azure/core-http-compat dependency from package.json files
- Added @azure/core-client dependency to package.json files

Co-authored-by: jeremymeng <[email protected]>
- Created extendedClientOptions.ts in keyvault-common with KeepAliveOptions, RedirectOptions, and ExtendedCommonClientOptions types
- Updated keyvault-common index.ts to export the new types
- Updated keyvault-keys, keyvault-secrets, and keyvault-certificates to import ExtendedCommonClientOptions from @azure/keyvault-common
- Removed inline type definitions from the three keyvault packages
- No new dependencies added to package.json files

Co-authored-by: jeremymeng <[email protected]>
- Defined CommonClientOptions and AdditionalPolicyConfig inline in extendedClientOptions.ts
- Updated to import PipelineOptions, HttpClient, and PipelinePolicy from @azure/core-rest-pipeline
- Removed @azure/core-client dependency from keyvault-common/package.json
- All needed types are now self-contained within keyvault-common

Co-authored-by: jeremymeng <[email protected]>
- Updated keyvault-common API review to export new types: AdditionalPolicyConfig, CommonClientOptions, ExtendedCommonClientOptions, KeepAliveOptions, RedirectOptions
- Updated keyvault-keys API review to import ExtendedCommonClientOptions from @azure/keyvault-common
- Updated keyvault-secrets API review to import ExtendedCommonClientOptions from @azure/keyvault-common
- Updated keyvault-certificates API review to import ExtendedCommonClientOptions from @azure/keyvault-common
- All packages successfully built with no errors

Co-authored-by: jeremymeng <[email protected]>
Copilot AI changed the title [WIP] Remove dependency on @azure/core-http-compat from keyvault Remove @azure/core-http-compat dependency from keyvault packages Dec 20, 2025
Copilot AI requested a review from jeremymeng December 20, 2025 00:24
"dependencies": {
"@azure/abort-controller": "^2.0.0",
"@azure/core-auth": "^1.3.0",
"@azure/core-client": "^1.5.0",
Copy link
Member

Choose a reason for hiding this comment

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

reason for removal: keyvault packages moved to depend on @azure-rest/core-client. It makes sense to not depend on @azure/core-client anymore even just for types.

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.

[keyvault] remove dependency on @azure/core-http-compat

2 participants