Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[KeyVault] - Migrate Key Vault Admin package to Core V2 #15881

Merged
merged 17 commits into from
Jun 23, 2021

Conversation

maorleger
Copy link
Member

@maorleger maorleger commented Jun 21, 2021

What

  • Migrate @azure/keyvault-admin to core V2
  • Migrate KeyVaultBackupClient and KeyVaultAccessControlClient to core CAE
  • Bump our minimum @azure/core-lro version to 1.0.6

Why

This PR proves out two important things: it demonstrates that core continuous access evaluation works for both container
registry (already done) and Key Vault (this PR). It also demonstrates the migration path for Core V2 for Key Vault.

The change to core-lro addresses an issue where core-lro was incorrectly depending on core-http (#15880) That has been fixed on 1.0.6
and allows package owners to migrate to core-rest-pipeline and remove core-http without seeing build breaks.

Resolves #15522
Resolves #14306

@ghost ghost added the KeyVault label Jun 21, 2021
@check-enforcer
Copy link

This pull request is protected by Check Enforcer.

What is Check Enforcer?

Check Enforcer helps ensure all pull requests are covered by at least one check-run (typically an Azure Pipeline). When all check-runs associated with this pull request pass then Check Enforcer itself will pass.

Why am I getting this message?

You are getting this message because Check Enforcer did not detect any check-runs being associated with this pull request within five minutes. This may indicate that your pull request is not covered by any pipelines and so Check Enforcer is correctly blocking the pull request being merged.

What should I do now?

If the check-enforcer check-run is not passing and all other check-runs associated with this PR are passing (excluding license-cla) then you could try telling Check Enforcer to evaluate your pull request again. You can do this by adding a comment to this pull request as follows:
/check-enforcer evaluate
Typically evaulation only takes a few seconds. If you know that your pull request is not covered by a pipeline and this is expected you can override Check Enforcer using the following command:
/check-enforcer override
Note that using the override command triggers alerts so that follow-up investigations can occur (PRs still need to be approved as normal).

What if I am onboarding a new service?

Often, new services do not have validation pipelines associated with them, in order to bootstrap pipelines for a new service, you can issue the following command as a pull request comment:
/azp run prepare-pipelines
This will run a pipeline that analyzes the source tree and creates the pipelines necessary to build and validate your pull request. Once the pipeline has been created you can trigger the pipeline using the following comment:
/azp run js - [service] - ci

@@ -93,7 +93,7 @@
"dependencies": {
"@azure/abort-controller": "^1.0.0",
"@azure/core-auth": "^1.3.0",
"@azure/core-tracing": "1.0.0-preview.12",
"@azure/core-tracing": "1.0.0-preview.11",
Copy link
Member Author

Choose a reason for hiding this comment

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

Because core-client depends on core-rest-pipeline 1.0.3 which still references preview 11, we need to downgrade here as well.

Once we GA core-rest-pipeline 1.1.0 and move all the packages to it we should be able to bump everyone to preview 12 in unison

Copy link
Member Author

Choose a reason for hiding this comment

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

Going to try addressing this in #15881

sdk/keyvault/keyvault-admin/package.json Show resolved Hide resolved
/**
* The accepted versions of the Key Vault's service API.
*/
serviceVersion?: SUPPORTED_API_VERSIONS;
}

/** Known values of {@link DataAction} that the service accepts. */
export enum KnownKeyVaultDataAction {
Copy link
Member Author

Choose a reason for hiding this comment

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

Moved these here while Azure/autorest.typescript#1013 is investigated

@maorleger maorleger marked this pull request as ready for review June 21, 2021 20:04
@maorleger
Copy link
Member Author

/check-enforcer evaluate

@praveenkuttappan
Copy link
Member

test comment

@praveenkuttappan
Copy link
Member

/azp run js - keyvault - ci

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@maorleger
Copy link
Member Author

/azp run js - keyvault - ci

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@maorleger
Copy link
Member Author

/azp run js - keyvault - ci

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

}
| {
status: "complete";
};
Copy link
Contributor

Choose a reason for hiding this comment

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

:o this is pretty!

}
}
return Promise.resolve();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh wow! This is a lot more thought through than what we had. I appreciate it!

Copy link
Contributor

@sadasant sadasant left a comment

Choose a reason for hiding this comment

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

No stones left unturned! Bravo :)

@maorleger maorleger force-pushed the keyvault-admin-core-v2 branch from 36a760d to 4dbb469 Compare June 22, 2021 01:06

// @public
export interface AccessControlClientOptions extends coreHttp.PipelineOptions {
export interface AccessControlClientOptions extends CommonClientOptions {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maor and I have talked about whether this is a breaking change. I don’t think so, but Let’s get @xirzec ‘s thoughts

Copy link
Member

Choose a reason for hiding this comment

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

There are 3 relatively minor breaking changes:

  • Optional property mode was removed from retryOptions since it only ever had a single enum value and was never used.
  • handleRedirects was removed from redirectOptions, as the policy can now be controlled by removing it from the pipeline or setting maxRedirects to 0.
  • keepAliveOptions were removed. Keep alive can be disabled on a per-request basis with disableKeepAlive.

These were all fairly niche options that tended to be used internally by our clients rather than set by consumers, but since we did expose them, we should consider what versioning implication this poses.

Alongside the change to remove _response, a strict semver interpretation would be to major version the package, but debatably a minor bump could be sufficient. /cc @chradek @ramya-rao-a @jeremymeng - I think we should have broad agreement on what our policy is here.

Copy link
Member Author

Choose a reason for hiding this comment

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

I do plan to merge this PR, but leaving this conversation open if folks want to chime in. I'll also add it to the list of team meeting topics I have here 👍

Copy link
Member

Choose a reason for hiding this comment

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

Since this package is still a beta I am less worried about it and don't think the discussion is blocking this PR

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we log an issue to ensure the discussion is continued and we come to a conclusion before this package goes GA?

Copy link
Member Author

@maorleger maorleger Jun 23, 2021

Choose a reason for hiding this comment

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

Sure, opened #15916

Copy link
Member

@jeremymeng jeremymeng left a comment

Choose a reason for hiding this comment

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

Did you re-generate from swagger? I am wondering why there isn't user agent related changes in generated code as we have seen in https://github.com/Azure/azure-sdk-for-js/pull/15777/files#diff-7a8e7d3e28eff9b33911029639e9b1582d1a692a0e39893e9fc6970916506c02

sdk/keyvault/keyvault-admin/package.json Outdated Show resolved Hide resolved
sdk/keyvault/keyvault-admin/src/accessControlClient.ts Outdated Show resolved Hide resolved
sdk/keyvault/keyvault-admin/src/backupClient.ts Outdated Show resolved Hide resolved
@maorleger maorleger force-pushed the keyvault-admin-core-v2 branch from 4252827 to d651fd1 Compare June 22, 2021 22:20
Copy link
Member

@xirzec xirzec left a comment

Choose a reason for hiding this comment

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

Nice work on this! Very clean upgrade.

common/config/rush/common-versions.json Outdated Show resolved Hide resolved

// @public
export interface AccessControlClientOptions extends coreHttp.PipelineOptions {
export interface AccessControlClientOptions extends CommonClientOptions {
Copy link
Member

Choose a reason for hiding this comment

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

Since this package is still a beta I am less worried about it and don't think the discussion is blocking this PR

@maorleger maorleger merged commit b499bfb into Azure:main Jun 23, 2021
@maorleger maorleger deleted the keyvault-admin-core-v2 branch June 23, 2021 03:27
openapi-sdkautomation bot pushed a commit to AzureSDKAutomation/azure-sdk-for-js that referenced this pull request Sep 24, 2021
[Hub Generated] Review request for Microsoft.RecoveryServices to add version stable/2021-08-01 (Azure#15881)

* Adds base for updating Microsoft.RecoveryServices from version stable/2021-07-01 to version 2021-08-01

* Updates readme

* Updates API version in new specs and examples

* Fixing readme file
openapi-sdkautomation bot pushed a commit to AzureSDKAutomation/azure-sdk-for-js that referenced this pull request Oct 19, 2021
[Hub Generated] Review request for Microsoft.RecoveryServices to add version stable/2021-08-01 (Azure#15881)

* Adds base for updating Microsoft.RecoveryServices from version stable/2021-07-01 to version 2021-08-01

* Updates readme

* Updates API version in new specs and examples

* Fixing readme file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Key Vault] Move one Key Vault package to use core-rest-pipeline [Key Vault] Use the CAE feature.
6 participants