Граф коммитов

1295 Коммитов

Автор SHA1 Сообщение Дата
Noah Gilson 7bdf2dfec9 Try to pass var into another job since we cant have a template in the jobs 2024-10-10 13:16:47 -07:00
Noah Gilson 592349be71 try to fix bug where version is not passed and publish args is wrong 2024-10-10 13:12:02 -07:00
Noah Gilson 1cc6c40b1c Switch to a different ordering so windows runs first, then linux 2024-10-09 13:42:26 -07:00
Noah Gilson a76a167828 Set 'use 1es pool' to true 2024-10-09 13:12:33 -07:00
Noah Gilson de0d438bd6 Move windows to the top 2024-10-08 16:29:10 -07:00
Noah Gilson e8fc53dcd4 Set the emoji 2024-10-08 16:27:24 -07:00
Noah Gilson 16996f1953 wait for wait job 2024-10-08 16:21:15 -07:00
Noah Gilson b109f9a46e The deployment step is not necessary 2024-10-08 16:17:52 -07:00
Noah Gilson c5c85f2e09 Maybe it has to be in plaintext 2024-10-08 16:14:22 -07:00
Noah Gilson ca2374d9b6 It's pretty silly you cant define a variable in a template but here we are 2024-10-08 15:59:15 -07:00
Noah Gilson 6edc9279ec Condition the name of the build based on OS
Why is windows the bomb emoji and not the windows emoji?
And why did I do this:

The windows build goes last because its in alphabetical order based on the behavior of how devops works. This is bad because it should go first and makes the other steps take longer as they depend on only the windows task. The bomb emoji is one of the first emojis thats not an emoticon before the penguin emoji so I picked that one..
2024-10-08 15:51:40 -07:00
Noah Gilson 422fe1a150 Use a different pool 2024-10-08 15:24:34 -07:00
Noah Gilson e5e537cab4 Try to fix pool condition 2024-10-08 14:35:46 -07:00
Noah Gilson f2b41c850b Use pool vs vmimage 2024-10-08 13:14:03 -07:00
Noah Gilson c43c72002b Only deploy on internal 2024-10-08 11:53:52 -07:00
Noah Gilson 6ecb129652 Fix ps1 issue 2024-10-08 11:48:03 -07:00
Noah Gilson 0e4d15e157 Switch to MI instead of a PAT 2024-10-08 11:40:32 -07:00
Noah Gilson b33684b0f4 vsixs are stored in the root, so don't check in the extension folder 2024-10-08 11:14:15 -07:00
Noah Gilson c0703d9003 add approval step: 2024-10-08 11:13:11 -07:00
Noah Gilson 072a91d185
Merge branch 'main' into nagilson-managed-identity 2024-10-07 16:48:15 -07:00
Noah Gilson 389f40e290
Branding for version 2.2.0 (#1971)
* Branding for version 2.2.0

Bumping to a new major version considering the stabilization of the new dotnet find path API.

* Update vscode-dotnet-runtime-extension/CHANGELOG.md
2024-10-07 13:19:31 -07:00
Noah Gilson 1cd3b7b2f5
🦅 Enable TSA Per Requirement ✈️ (#1975) 2024-10-07 13:19:08 -07:00
Noah Gilson 38edf5482f
Fix the parsing of other regional characters for find path API (#1969)
* Use Unicode Code Page to Parse dotnet output

 For Windows, we need to change the code page to UTF-8 to handle the output of the command. https://github.com/nodejs/node-v0.x-archive/issues/2190

Resolves https://github.com/dotnet/vscode-dotnet-runtime/issues/1967

* Ensure that utf8 is available
2024-10-07 13:18:58 -07:00
Noah Gilson 2a876ace5d
Permit Installing .NET via a package.json file (#1976)
* Permit Installing .NET via a package.json file

Extensions that rely on .NET often have a slow startup time due to our existing API.

For extensions that want the .NET runtime to be installed as soon as possible, they can now also make an API request in their package.json.

They should add a [IDotnetAcquireContext](https://github.com/dotnet/vscode-dotnet-runtime/blob/main/vscode-dotnet-runtime-library/src/IDotnetAcquireContext.ts) object in a section titled 'x-dotnet-acquire' to do so. They don't need to include the `requestingExtensionId`, since this is already in their `package.json`,

This should go at the root of a `package.json`, and not in the `contributes` section.
```
"x-dotnet-acquire": {
    "version": "8.0",
    "mode": "aspnetcore"
}
```

We run the install on startup and also whenever a new extension is installed via the onDidChange API. https://code.visualstudio.com/api/references/vscode-api#Extension<T>

You can easily test this by modifying the SDK extension and adding this, then packging t with `vsce`, installing it, and running the Runtime Extension under the Debug tab. If you do so, you will see that:

If you install a new extension, the request is made.

If you had already installed the extension, the request is also made.

* Respond to linter

* Add a very basic test.

* Fix typo

* Fix typo
2024-10-04 09:22:04 -07:00
Noah Gilson 40d1a8bc66
Add new API `dotnet.findPath` to find the .NET host to use if one already exists that meets a requirement. (#1954)
* update PATH setting description to make it more clear

* add very prototype code

* add tests and get runtime check working

* Fix some bugs

* Consider that the .NET SDK can also satisfy the Runtime

* fix typo

* fix the tests

* fix

* fix another test

* Fix tests even more

* undo yarn changes

* fix the final test hopefully

* undo yarn changes

* Dont use dotnet.exe as its not platform agnostic

* use "markdownDescription" for nicer rendering in VSCode

* Tweak call to action to use VSCode mechanisms first, then our standard installation docs, and only in the last resort mention PATH munging.

* Fix URLs

* Move to version 2.1.7

* add basic command'

* Ignore existingPath setting for SDK installs.

C# DevKit never uses the path returned by our installation. This means users would think this path would change the sdk that this extension uses but that is not the case. This path to dotnet.exe is meant to be the path for the runtime for extensions to run on, and not the SDK path. It's confusing that the setting was used for both and a misstep in a way. DevKit is the main caller of this API so we think we can change this with minimal breakage.

* Remove warning setting and fix invalid path setting

The setting must be accessed earlier. This means vscode will need to be restarted. We also update the readme and messaging a bit so its more publicly clear in all places what the setting is for.

* Fix test

* Refactor code out into a Validator for Conditions

dotnet --list-runtimes and more need to be called in more places. This is a separate task so it should be done. I did not change the code in any way except for adding the requirement clause type.

* Prepare code to validate the path

* add a lot of prototypey code

* add comment for future work

* merge with main

* look up the architecture

* Improve the code

* Go 2 Directories Up to find the True Path on PATH

* Final initial loop of API code

* Fix bug parsing list runtimes

* Add tests

* Fix test and search for where if its not installed

* Consider where may return multiple values

* Fix test

* tests mostly working

* code cleanup - get rid of extra api to set env

* Restore the env var so we dont edit it for other processes

* Uncomment the remaining tests

* Respond to lint

* fix callback

* Fix path to be os-gnostic

* Only search for where on windows and also search for which

* provide env to the find command so /usr/bin/whcih can be used

* Call which which instead of which so the correct command can be found

* Install 3.1 instead of 7.0 because the DTL CI machines seem to have a 7.0 SDK on them :zany:

* give up on arch check for now because it is inaccurate, see comment

* Add github issue in comment for context

* make linter happy

* Respond to PR feedback

* Migrate to connection strings

Resolves https://github.com/dotnet/vscode-dotnet-runtime/issues/1958

The old application insights key was created by @LakshanF, when we migrated to the new vscode-extension-telemetry service, their API had a breaking change to require a connection string instead of an insights key. https://github.com/dotnet/vscode-dotnet-runtime/pull/1948

The connection key can be public and is hard coded. Our existing key has been in our open source, source code for many years. Here is what their guidance says: https://www.npmjs.com/package/@vscode/extension-telemetry

> Follow guide to set up Application Insights in Azure and get your connection string. Don't worry about hardcoding it, it is not sensitive.

* Respond to PR Feedback

---------

Co-authored-by: Chet Husk <chusk3@gmail.com>
2024-09-30 22:31:09 +00:00
Noah Gilson d13a8db5ce
Add await that eslint asked to remove (#1957)
TS Lint failed this  `Unexpected `await` of a non-Promise (non-"Thenable") value`.

But the callback can be a promise type. Its just not smart enough to realize that.
2024-09-23 15:40:59 -07:00
Noah Gilson 00f70442ab
Update `existingDotnetPath` to only take affect if it works. (#1946)
* update PATH setting description to make it more clear

* add very prototype code

* add tests and get runtime check working

* Fix some bugs

* Consider that the .NET SDK can also satisfy the Runtime

* fix typo

* fix the tests

* fix

* fix another test

* Fix tests even more

* undo yarn changes

* fix the final test hopefully

* undo yarn changes

* Dont use dotnet.exe as its not platform agnostic

* use "markdownDescription" for nicer rendering in VSCode

* Tweak call to action to use VSCode mechanisms first, then our standard installation docs, and only in the last resort mention PATH munging.

* Fix URLs

* Ignore existingPath setting for SDK installs.

C# DevKit never uses the path returned by our installation. This means users would think this path would change the sdk that this extension uses but that is not the case. This path to dotnet.exe is meant to be the path for the runtime for extensions to run on, and not the SDK path. It's confusing that the setting was used for both and a misstep in a way. DevKit is the main caller of this API so we think we can change this with minimal breakage.

* Remove warning setting and fix invalid path setting

The setting must be accessed earlier. This means vscode will need to be restarted. We also update the readme and messaging a bit so its more publicly clear in all places what the setting is for.

* Fix test

---------

Co-authored-by: Chet Husk <chusk3@gmail.com>
2024-09-18 16:49:50 -07:00
Noah Gilson 6911490b30
Upgrade to the newest version of extension telemetry (#1948)
* upgrade to the newest version of extension telemetry

* remove vscode-extension-telemetry where its not needed

* Update vscode-test as well since its a new library
2024-09-18 13:18:19 -07:00
Noah Gilson 82b6a041fe
Improve ARM Mac Path Check (#1947)
* fix emu

* improve mac path check

* Account for when SDK is not installed under emulation but node js is
2024-09-17 09:33:34 -07:00
Noah Gilson 0b37e6610a
Add PATH for Arm emulation x64 on Mac (#1932)
* 2.1.6 branding

* add other potential mac path from installer/generatePKG.targets -- need to add tests

* fix tests

* Simplfiy expression logic

Co-authored-by: Michael Yanni <MiYanni@microsoft.com>

* Fix syntax

---------

Co-authored-by: Michael Yanni <MiYanni@microsoft.com>
2024-09-11 16:31:23 +00:00
Noah Gilson e9c440e1e8
Migrate to ESLint (#1944)
* get eslint running but its failing a lot of checks

* Fix the linting after migration

* Fix many errors

* 65 errors to go

* fix almost every lint issue

* clean lint

* Remove references to tslint

* dont install eslint as it is already here

* install eslint

* update eslint

* dont empty cache because eslint is failing to register the types that exist

* try to help eslint find the files for type defs

* Set typescript resolver

* Fix imports

* Add some import plugin but still cant import vscode correctly

* install eslint globally

* skip npm installl

* add imports

* try to fix the import issue

* build before hand so the types are picked up -_____-

* Revert "build before hand so the types are picked up -_____-"

This reverts commit e5381b42df.

* rollback to eslint 8 but still run build
2024-09-10 21:39:51 -07:00
Noah Gilson 63cbaf19a7
Quote the Installer Path (#1941)
* Encase the installer path in quotes to protect against spaces in username being parsed poorly, and other path issues. Don't know why we didnt do this before.

* fix linter
2024-09-04 23:29:16 +00:00
Noah Gilson a699c9fe6b run package on publi 2024-09-04 16:13:05 -07:00
Noah Gilson ea5b8971a1 use vsce latest 2024-09-04 15:59:12 -07:00
Noah Gilson f637f6ee24 add depends on chain 2024-09-04 15:56:31 -07:00
Noah Gilson f0e7138726 dont pass 1es pool 2024-09-04 15:52:32 -07:00
Noah Gilson a1be060ebb get rid of pool 2024-09-04 15:50:51 -07:00
Noah Gilson 8f9a527625 move template out of steps and into jobs 2024-09-04 15:46:37 -07:00
Noah Gilson 785784c999 add publish task 2024-09-04 15:34:27 -07:00
Noah Gilson 50261827f3
2.1.6 branding (#1931) 2024-08-20 16:25:38 -07:00
Noah Gilson d57a31f3c8
Handle .NET Failed: Undefined (#1930)
Rejecting a promise with a rejected promise as a return value from a function does not reject with the object the inner promise rejected with. Instead it rejects with an undefined value.

This means if the SDK installer fails or we fail to elevate, that counts as .NET Install failed: undefined. This fixes this. It also adds a check for the string error as this seems to happen sometimes if the password prompt is rejected.

How to test this? Set a break point in win mac global installer on the execute install and edit the command to point to a non existent file. It will then fail and you can see it works now.
2024-08-20 15:34:04 -07:00
Noah Gilson ffc2590f5e
2.1.5 branding (#1929)
* Fix an issue parsing promises

We changed the function `getPromise` to not use a lock in version 2.1.2. This was a mistake. I thought it would return the unresolved `Promise` object if it was a sync function. That is not the behavior, instead it will skip that line of code and return null even if the promise exists. This causes multiple processes to try to grab the installer file handle.

When one fails to grab the file handle, it causes a chain-reaction of cascading failures for concurrent requests, because that is supposed to be blocked from happening.

In addition, the check I added to kill the sudo process once it is finished runs on all platforms despite the master sudo process only being present on Linux, which has resulted in some higher timeout rates. We need to not do this on other platforms.

* Fix tests

we need to clear the promise out after each test is done

* dont call uninstall all in sdk test, its the wrong command

* reset event stream in the test

* 2.1.4 branding - new version due to vscode marketplace outage causing failure to upload version 2.1.3 correctly

* 2.1.5 branding prepare for a new version

bump the version after 2.1.4 was released and skipping a version due to vscode outage
2024-08-20 14:27:36 -07:00
Noah Gilson 95432c0296
2.1.4 branding (#1928)
* Fix an issue parsing promises

We changed the function `getPromise` to not use a lock in version 2.1.2. This was a mistake. I thought it would return the unresolved `Promise` object if it was a sync function. That is not the behavior, instead it will skip that line of code and return null even if the promise exists. This causes multiple processes to try to grab the installer file handle.

When one fails to grab the file handle, it causes a chain-reaction of cascading failures for concurrent requests, because that is supposed to be blocked from happening.

In addition, the check I added to kill the sudo process once it is finished runs on all platforms despite the master sudo process only being present on Linux, which has resulted in some higher timeout rates. We need to not do this on other platforms.

* Fix tests

we need to clear the promise out after each test is done

* dont call uninstall all in sdk test, its the wrong command

* reset event stream in the test

* 2.1.4 branding - new version due to vscode marketplace outage causing failure to upload version 2.1.3 correctly
2024-08-20 13:23:26 -07:00
Noah Gilson 909fcb1bae
Fix an issue parsing promises (#1927)
* Fix an issue parsing promises

We changed the function `getPromise` to not use a lock in version 2.1.2. This was a mistake. I thought it would return the unresolved `Promise` object if it was a sync function. That is not the behavior, instead it will skip that line of code and return null even if the promise exists. This causes multiple processes to try to grab the installer file handle.

When one fails to grab the file handle, it causes a chain-reaction of cascading failures for concurrent requests, because that is supposed to be blocked from happening.

In addition, the check I added to kill the sudo process once it is finished runs on all platforms despite the master sudo process only being present on Linux, which has resulted in some higher timeout rates. We need to not do this on other platforms.

* Fix tests

we need to clear the promise out after each test is done

* dont call uninstall all in sdk test, its the wrong command

* reset event stream in the test
2024-08-20 11:25:33 -07:00
Noah Gilson 524b14e992
Don't set HOME environment variable (#1923)
* prevent proxy settings from setting HOME

* Update changelog.md
2024-08-16 14:00:59 -07:00
Noah Gilson 8bc2ecfdc3
Allow uninstallation of global .NET Installations (#1897)
* Add failure handling for file integrity check

This is now what is hitting the EPERM and ENOENT errors.
We need to skip the check and see what happens from here, such as allowing to elevate via windows.

This also adds specific handlers for when we fail to download the SDK.

* elevate on windows

* Retry if no permission is available the first time

Need to double check that cancelling is handled properly now that its a promise reject

* respond to linter

* Add API to uninstall any install

* Add tests

* undo bad save

* dont uninstall if there are multiple owners

* add some basic uninstall capability

* allow elevation on mac

* fix promise chain a bit, may need to await still

* add uninstall functionality to linux

* add uninstall on linux

* fix merge

* Add a test

* add ui element to pick uninstall

we need to fix the uninstallglobal functoin logic to print out and such still
then test it

* add some output, need to test and check graveyard

* add uninstall events

* fix build

* Fix uninstall to pop up above window

* ui changes per request

* fix test

* fix merge err

* fix mac test

* fix name option

* fix promise logic

* fix promise code again xd

* Add icons for the extension

* add icons to shield and uninstall

* set minimum vscode version to require new icons

* dont sort if no install exists

* use noninteractive frontend in master process to fix dpk unable to re open stdin on uninstall

* try to exit sudo process master and set env var for stdin uninstall fix

* fix eventstream

* fix detection logic for uninstall

* add -y to uninstall

* fix bug with uninstall

* add version check for when disk is full and version string ui fails

* also kill sudo process on uninstall

* use -f to delete file as they may not exist and we dont want to fail due to this at the end

* add -y to update

* respond to linter

* remove unnecessary img

* respond to linter

* respond to pr feedback

* fix when extension may have null record
2024-08-15 22:22:20 +00:00
Noah Gilson 20261b57c3
Don't fail if the user is offline (#1898)
* add function to call in extensoin.ts for offline mode acceptAlternativeVersions on acquirectx

* refactor version helper functions outside of version resolver

version resolver is a class that is based around using the internet. It probably should have been like this before.

* add code to check existing installing versions

* Update test name

* respond to linter

* Update lint

* Fix bugs and add messages

* respond to pr feedback
2024-08-15 19:29:03 +00:00
Noah Gilson 5763a14e48
Fix MicroBuild Staging (#1915)
* move signing prep into another template so we can not push microbuild to staging directory

* condition the signing prep

* fix the cond since yaml has dumbest syntax ever

* fix whitespace i hate yaml

* remove junk:

* succeded doesnt work
2024-08-14 13:48:42 -07:00
Noah Gilson c2c90e5795
Update Axios (#1913)
* update axios

* update axios to latest

* remove unnecessary dependency

* remove axios

this is not needed here

* remove axios

* reset sha integrities
2024-08-14 13:43:15 -07:00
Noah Gilson 76d021ec1a
Fix parsing `-preview` versions in the registry when installed via Visual Studio (#1914)
* remove -preview from the version parsing to prevent trying to cast it to a number

* fix nullabilty check
2024-08-13 22:31:09 +00:00