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

[Identity] Update identity plugin file structure so that versions aren't strictly tied to identity package #20340

Closed

Conversation

KarishmaGhiya
Copy link
Member

@KarishmaGhiya KarishmaGhiya commented Feb 11, 2022

Packages impacted by this PR

Identity

Issues associated with this PR

Fixes #20429

Describe the problem that is addressed by this PR

Updating version of identity to new beta

Reason why the build fails :

  • In the CI, the plugin packages identity-vscode and identity-cache-persistence are built first. Adn these import AzurePluginContext directly from the source files of identity package. The semver version dependency of these packages depend on the 2.0.x versions of identity and upgrading the local version of identity package - no longer satisfies the semver dependency for identity on these plugin packages.
  • The errors about not being able to find core packages are coming from the src files of identity - that is not yet built and is being pulled in from the src files of the plugin packages. If the reference to AzurePluginContext in the plugin packages was made from the identity package instead of directly importing src files of identity, then we probably would not have run into this issue. It thinks that the identity src files are it's own package files and ofcourse we don't have these core packages as dependencies in the plugin packages.

Design Choices for a solution

  1. Move the definition of AzurePluginContext within the plugin packages OR
  2. Export AzurePluginContext publicly from identity package and modify the references OR
  3. Move the definition of AzurePluginContext into an identity-common folder like we have for keyvault and storage.

With the 3rd option above we will have the following folder structure:

  • identity/
  • identity-vscode/
  • identity-cache-persistence/
  • identity-common/
    --- src/
    ------ plugins/provider.ts
    ------ tokenCachePersistenceOptions.ts
    ------ vsCodeCredentialPlugin.ts

@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

@sadasant
Copy link
Contributor

@willmtemple @KarishmaGhiya we’re a bit constrained with time during this Milestone. What about simply updating the Identity version on the plugin package.json files to 2.1.0-beta.1? That way we can prioritize releasing the upcoming betas of Identity and afterwards we can come back to this PR. Let me know what you think 🙂

@witemple-msft
Copy link
Member

witemple-msft commented Feb 22, 2022

@willmtemple @KarishmaGhiya we’re a bit constrained with time during this Milestone. What about simply updating the Identity version on the plugin package.json files to 2.1.0-beta.1? That way we can prioritize releasing the upcoming betas of Identity and afterwards we can come back to this PR. Let me know what you think 🙂

@sadasant I'm fine with that as long as the plugins don't release a stable version that depends on beta identity and we do it knowing that it's improper for a stable package version to depend on a beta package. (Could/should we pre-emptively update the plugin versions to a beta as well? Maybe not.) At the end of the day either solution is good by me.

Copy link
Member

@witemple-msft witemple-msft left a comment

Choose a reason for hiding this comment

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

Couple of comments. This is looking more complex than I thought it would be.

@@ -0,0 +1,100 @@
// Copyright (c) Microsoft Corporation.
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we should move tests to identity-common, just sources.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is the utility file for the tests that the plugin packages depend on. I had to do that to silence the build errors that I was receiving because of the utils for tests and sources from plugins

@@ -67,6 +67,7 @@
"files": [
"dist/",
"dist-esm/src/",
Copy link
Member

Choose a reason for hiding this comment

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

Doesn't this need to become dist-esm/identity/src?

Copy link
Member Author

Choose a reason for hiding this comment

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

not sure -

@@ -61,6 +61,7 @@
"dependencies": {
"@azure/core-auth": "^1.3.0",
"@azure/identity": "^2.0.1",
"@azure/msal-common": "^4.5.1",
Copy link
Member

Choose a reason for hiding this comment

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

Why is this change required? Are we importing from it anywhere? Does this have to do with msalTestUtils?

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

export * from "../src";
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand this. This is src/index.ts, and it does export * from "../src", so doesn't this module refer to this same file?

Do we need this file at all?

@@ -0,0 +1,75 @@
{
"name": "@azure/identity-common",
Copy link
Member

Choose a reason for hiding this comment

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

If we add this package.json here, we need to also add it to the rush configuration and set up a full build setup for it. There are pros and cons to that approach. At the end of the day I don't think that's what we want, and we need to make sure these files in identity-common are isolated modules without any external dependencies. That's problematic for the shared MSAL test configuration.

I think the easiest solution for the test configuration is probably just to duplicate it, much as it may pain me.

@@ -60,6 +60,7 @@
"sideEffects": false,
"dependencies": {
"@azure/identity": "^2.0.1",
"@azure/msal-common": "^4.5.1",
Copy link
Member

Choose a reason for hiding this comment

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

Same comment about the same line in identity-cache-persistence

@@ -0,0 +1,39 @@
# Azure Identity Common client library for JavaScript
Copy link
Member

Choose a reason for hiding this comment

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

NIT: This isn't a "client" library and we should freely break the README template here. Just "Azure Identity Common Plugin Library" or something like that.

I do think it's nice to have the README, even if we ditch the package.json or other associated files.

@sadasant
Copy link
Contributor

@witemple-msft I'm fine with that as long as the plugins don't release a stable version that depends on beta identity and we do it knowing that it's improper for a stable package version to depend on a beta package.

I completely agree!

Could/should we pre-emptively update the plugin versions to a beta as well?

Why not? I like that idea 🙂 cc: @KarishmaGhiya


What I want to do is for us to focus back on releasing the beta features and then come back to this PR once we’re synced again with other languages.

@KarishmaGhiya KarishmaGhiya changed the title [Identity] Update identity version beta [Identity] Update identity plugin file structure so that versions aren't strictly tied to identity package Apr 15, 2022
@ghost ghost added the no-recent-activity There has been no recent activity on this issue. label Jun 17, 2022
@ghost
Copy link

ghost commented Jun 17, 2022

Hi @KarishmaGhiya. Thank you for your interest in helping to improve the Azure SDK experience and for your contribution. We've noticed that there hasn't been recent engagement on this pull request. If this is still an active work stream, please let us know by pushing some changes or leaving a comment. Otherwise, we'll close this out in 7 days.

@ghost ghost closed this Jun 24, 2022
@ghost
Copy link

ghost commented Jun 24, 2022

Hi @KarishmaGhiya. Thank you for your contribution. Since there hasn't been recent engagement, we're going to close this out. Feel free to respond with a comment containing "/reopen" if you'd like to continue working on these changes. Please be sure to use the command to reopen or remove the "no-recent-activity" label; otherwise, this is likely to be closed again with the next cleanup pass.

@KarishmaGhiya KarishmaGhiya reopened this Jul 2, 2022
@KarishmaGhiya
Copy link
Member Author

please leave this open for now

@ghost ghost removed the no-recent-activity There has been no recent activity on this issue. label Jul 2, 2022
@ghost ghost added the no-recent-activity There has been no recent activity on this issue. label Sep 2, 2022
@ghost
Copy link

ghost commented Sep 2, 2022

Hi @KarishmaGhiya. Thank you for your interest in helping to improve the Azure SDK experience and for your contribution. We've noticed that there hasn't been recent engagement on this pull request. If this is still an active work stream, please let us know by pushing some changes or leaving a comment. Otherwise, we'll close this out in 7 days.

@ghost ghost closed this Sep 9, 2022
@ghost
Copy link

ghost commented Sep 9, 2022

Hi @KarishmaGhiya. Thank you for your contribution. Since there hasn't been recent engagement, we're going to close this out. Feel free to respond with a comment containing "/reopen" if you'd like to continue working on these changes. Please be sure to use the command to reopen or remove the "no-recent-activity" label; otherwise, this is likely to be closed again with the next cleanup pass.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure.Identity no-recent-activity There has been no recent activity on this issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Identity] Move the common files between Identity and Identity plugins to a shared location
3 participants