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

1ESPT Schema Rollout #543

Merged

Conversation

priyatejankar
Copy link
Collaborator

No description provided.

@priyatejankar
Copy link
Collaborator Author

priyatejankar commented Aug 25, 2023

  • This PR is created in order to be able to rollout 1ESPT schema to the customers.
  • With this feature whenever a user is signed in to VS code with Microsoft account and they have 1ESPT available in their ADO org, they can enable the option to use Intellisense from 1ESPT schema while editing their yaml files.

image

  • Whenever a user is not signed in to VS code, they will get a prompt to sign in in order to be able to use 1ESPT schema
    image

  • If the user has enabled 1ESPT Schema, it will take precedence over any other schemas

  • A folder called '1ESPTSchema' is created to store the schemas. When user signs out this folder gets deleted

  • If user signs out, we will default to behavior as before

  • If user does not sign out of Visual Studio Code, their 1ESPT Schema file configuration will be stored

  • If user signs out and signs back in, they will have to enable 1ESPT again

  • While fetching schemas, we have a caching mechanism in place that remembers the last fetched schema.

  • If the user has enabled 1ESPT schema, we will fetch the schema from the main branch if the last fetched schema is older than 24 hours

@flyingUnderTheRadar
Copy link
Collaborator

@50Wliu, @KonstantinTyukalov - please take a look and share feedback if any.

@priyatejankar priyatejankar marked this pull request as ready for review August 28, 2023 20:32
@priyatejankar priyatejankar requested review from a team as code owners August 28, 2023 20:32
Copy link
Member

@winstliu winstliu left a comment

Choose a reason for hiding this comment

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

In general this looks good! A few suggestions and questions, particularly about the config experience. At a high-level, I'd like to hear the rationale behind introducing a new config setting, rather than doing everything behind the scenes and "silently" upgrading them to 1ESPT if it's supported.

package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
package.json Show resolved Hide resolved
src/extension.ts Outdated Show resolved Hide resolved
src/schema-association-service-1espt.ts Show resolved Hide resolved
src/schema-association-service-1espt.ts Outdated Show resolved Hide resolved
src/schema-association-service.ts Outdated Show resolved Hide resolved
src/schema-association-service.ts Outdated Show resolved Hide resolved
src/schema-association-service.ts Show resolved Hide resolved
src/schema-association-service.ts Outdated Show resolved Hide resolved
@priyatejankar
Copy link
Collaborator Author

@50Wliu Thanks for reviewing the PR :) I have addressed your comments. Please let me know if you have any other concerns.

@priyatejankar priyatejankar requested a review from winstliu August 29, 2023 17:03
package.json Outdated Show resolved Hide resolved
src/schema-association-service-1espt.ts Outdated Show resolved Hide resolved
src/schema-association-service-1espt.ts Outdated Show resolved Hide resolved
src/schema-association-service-1espt.ts Outdated Show resolved Hide resolved
src/schema-association-service.ts Show resolved Hide resolved
src/schema-association-service.ts Outdated Show resolved Hide resolved
src/schema-association-service.ts Outdated Show resolved Hide resolved
src/schema-association-service.ts Outdated Show resolved Hide resolved
src/schema-association-service-1espt.ts Outdated Show resolved Hide resolved
src/schema-association-service-1espt.ts Outdated Show resolved Hide resolved
src/schema-association-service.ts Outdated Show resolved Hide resolved
src/schema-association-service.ts Outdated Show resolved Hide resolved
src/schema-association-service-1espt.ts Outdated Show resolved Hide resolved
src/schema-association-service-1espt.ts Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
src/schema-association-service-1espt.ts Outdated Show resolved Hide resolved
Copy link
Member

@winstliu winstliu left a comment

Choose a reason for hiding this comment

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

Just a few more comments! I'll want to give it a spin for myself to see what the config experience is like, but code-wise it's looking good :).

Ask: could you please go through and make sure all the lines you added:

  • have semicolon endings
  • use const/let, not var
  • don't use any types

src/extension.ts Outdated Show resolved Hide resolved
src/schema-association-service-1espt.ts Outdated Show resolved Hide resolved
src/schema-association-service-1espt.ts Outdated Show resolved Hide resolved
src/schema-association-service.ts Outdated Show resolved Hide resolved
src/schema-association-service-1espt.ts Outdated Show resolved Hide resolved
src/schema-association-service-1espt.ts Outdated Show resolved Hide resolved
Copy link
Member

@winstliu winstliu left a comment

Choose a reason for hiding this comment

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

  1. On startup, I see the following error: Cannot read properties of undefined (reading 'name') at src\schema-association-service.ts:72:72. I would imagine this is because I don't have a workspace folder opened.
  2. I'm really not a fan of persisting config changes without user input.
    • This creates unnecessary churn that will show up when going to commit changes
    • Whether they have access to 1ES Pipeline Templates is not controllable
    • If/when 1ESPT is added to their org, they need to remember to manually re-enable the setting. Knowing how to do this isn't obvious, because at a glance it'll look like the setting is already enabled (see picture below)
  3. I would recommend changing the wording of the non-MS account message to use the 2nd-person (you vs user). In addition, "Microsoft account" here is ambiguous. I am signed in with a Microsoft account - my personal MSA. I would suggest finding a way to clarify that this is for Microsoft employees only.
  4. Why do I get a message that the 1ESPT Schema is disabled even if I don't have the setting enabled in the first place? And why does it keep recreating a settings.json every time I try to remove it?

I am blocking on points 1, 3, and 4. Regarding point 2 specifically, I know we've already gone over this. I respect you and your team's stance and won't block this PR because we have different config philosophies, but to reduce friction and increase discoverability of this feature I would highly suggest:

  1. Turning this feature on by default (even better would be removing the setting entirely)
  2. Silently falling back to the other schemas if the prerequisites aren't met

This way anyone using this extension automatically gets the best intellisense available to them without needing to configure anything (other than signing in once).

unclear-enablement-state

@priyatejankar
Copy link
Collaborator Author

priyatejankar commented Sep 12, 2023

@50Wliu I have addressed your comments here. Please find my responses in bold:

  1. On startup, I see the following error: Cannot read properties of undefined (reading 'name') at src\schema-association-service.ts:72:72. I would imagine this is because I don't have a workspace folder opened. -- This is same behavior as before and not something newly introduced

  2. I'm really not a fan of persisting config changes without user input.**_

    • This creates unnecessary churn that will show up when going to commit changes
    • Whether they have access to 1ES Pipeline Templates is not controllable
    • If/when 1ESPT is added to their org, they need to remember to manually re-enable the setting. Knowing how to do this isn't obvious, because at a glance it'll look like the setting is already enabled (see picture below)
      -- We had an internal discussion and have decided to not change the value without user interaction. Even if the user is not eligible to use the feature and they enable it, we will keep it enabled. We have a text next to the feature option indicating the prerequisites for the feature to be enabled
  3. I would recommend changing the wording of the non-MS account message to use the 2nd-person (you vs user). In addition, "Microsoft account" here is ambiguous. I am signed in with a Microsoft account - my personal MSA. I would suggest finding a way to clarify that this is for Microsoft employees only. -- Modified it to tell that feature is allowed for @microsoft.com user accounts only

  4. Why do I get a message that the 1ESPT Schema is disabled even if I don't have the setting enabled in the first place? And why does it keep recreating a settings.json every time I try to remove it? -- Removed this message. Now, a message will be shown to enable the feature only after verifying that user has 1ESPT repo in their org. The settings.json gets updated when the value is changed. It is not getting recreated for me

I am blocking on points 1, 3, and 4. Regarding point 2 specifically, I know we've already gone over this. I respect you and your team's stance and won't block this PR because we have different config philosophies, but to reduce friction and increase discoverability of this feature I would highly suggest:

  1. Turning this feature on by default (even better would be removing the setting entirely) -- We cannot enable this feature silently for all users as they might have 1ESPT in their ADO org but they are working on OneBranch pipelines
  2. Silently falling back to the other schemas if the prerequisites aren't met

This way anyone using this extension automatically gets the best intellisense available to them without needing to configure anything (other than signing in once).

unclear-enablement-state

Copy link
Member

@winstliu winstliu 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 small things

src/messages.ts Outdated Show resolved Hide resolved
src/schema-association-service-1espt.ts Outdated Show resolved Hide resolved
src/schema-association-service-1espt.ts Outdated Show resolved Hide resolved
src/schema-association-service-1espt.ts Outdated Show resolved Hide resolved
src/schema-association-service.ts Outdated Show resolved Hide resolved
priyatejankar and others added 3 commits September 12, 2023 19:27
Co-authored-by: Winston Liu <Wliu1402@gmail.com>
Co-authored-by: Winston Liu <Wliu1402@gmail.com>
Copy link
Member

@winstliu winstliu left a comment

Choose a reason for hiding this comment

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

Looking forward to seeing this in action! Should really help people using the 1ES templates :).
:shipit:

@winstliu winstliu merged commit a640222 into microsoft:main Sep 13, 2023
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.

3 participants