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

☁️ 🐚 Migrate Azure Cloud Shell feature #848

Merged
merged 14 commits into from
May 7, 2024

Conversation

alexweininger
Copy link
Member

@alexweininger alexweininger commented May 2, 2024

Purpose: In order to deprecate Azure Account, we need move the Azure Cloud Shell feature to the Azure Resources extension.

I will be making updates to the code later but wanted to perform an initial migration without changing the code too much.

  • Removed webworker webpack config. We no longer ship a web version of Azure Resources, so it should've been removed a while ago. This config is not compatible with the Azure Cloud Shell feature.
  • My process was copying over the files and adding comments. I tried to keep my changes minimal.
  • Replaced the reliance on the Azure Account auth with our subscription provider. If a user has multiple tenants, we will prompt the user to select one every time they launch cloud shell. I think we can improve this later, but it's fine for now.
  • The feature relies on node-fetch and request-promise, in a future update I hope to replace both of these with built-in fetch.

This feature is fairly complex and does a lot of out of the ordinary stuff to make it work. Please ask questions. I'm tentatively planning to write a document in the repo explaining the workings of the feature.

edit: Also I purposely left two prominent bugs in the code from AA. I will fix those in follow up PRs. The fixes for those are in #851, so use that for testing.

Copy link
Member

@nturinski nturinski left a comment

Choose a reason for hiding this comment

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

Don't see anything obviously wrong that stands out to me.

Only thing that I don't see is the equivalent of uploadFile being migrated over.
https://github.com/microsoft/vscode-azure-account/pull/958/files#diff-04bba6a35cad1c794cbbe677678a51de13441b7a6ee8592b7b50be1f05c6f626L112

package.json Show resolved Hide resolved
package.json Show resolved Hide resolved
@@ -4,14 +4,16 @@
"target": "es6",
"outDir": "out",
"lib": [
"es6"
"es6",
"DOM"
Copy link
Member

Choose a reason for hiding this comment

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

👀

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 know. I'm not happy we have to add that but I hope to be able to remove it once I move this whole feature onto built-in fetch.

@@ -44,18 +30,18 @@ const webConfig = dev.getDefaultWebpackConfig({
'../build/default/validation': 'commonjs ../build/default/validation',
'../build/Release/bufferutil': 'commonjs ../build/Release/bufferutil',
'../build/default/bufferutil': 'commonjs ../build/default/bufferutil',

// required for cloud shell feature
bufferutil: 'commonjs bufferutil',
Copy link
Member

Choose a reason for hiding this comment

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

This is the scary stuff 😬

Copy link
Member Author

Choose a reason for hiding this comment

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

Honestly I don't know what this does

Copy link
Member

Choose a reason for hiding this comment

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

lmao I'm pretty sure it's polyfilling. Probably has to do with cloud shell stuff running on its own node process.

@alexweininger
Copy link
Member Author

Only thing that I don't see is the equivalent of uploadFile being migrated over.
https://github.com/microsoft/vscode-azure-account/pull/958/files#diff-04bba6a35cad1c794cbbe677678a51de13441b7a6ee8592b7b50be1f05c6f626L112

#852

@alexweininger alexweininger merged commit 795544f into main May 7, 2024
3 checks passed
@alexweininger alexweininger deleted the alex/migrate-cloudshell branch May 7, 2024 22:32
await delay(300);

for (let i = 0; i < 10; i++) {
if (token !== resizeToken) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Q: Is it possible for token to not equal resizeToken here?

@microsoft microsoft locked and limited conversation to collaborators Jun 22, 2024
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