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

1265 Коммитов

Автор SHA1 Сообщение Дата
Noah Gilson 79b9139089
Improve VS Code SDK Error Diagnosability (#1822)
* Introduce error to wrap all global sdk errors

* Wrap installation in success event to improve trackability

* Expose the original event name for property expansion

* Respond to linter

* Improve Error Message Specificity

* Update the event stream to use the right install key

* Update Errors to be EventBasedErrors that contain the Event Name

This is a mildly ugly pattern. See the PR description for more detail.

* Make legacy code throw an error instead of throwing a string

Throwing other object types up makes it harder for us to get the callstack etc

* Fix bug with install key management where it would not have -global or the architecture would be unspecified

* respond to linter

* Fix whitespace

* Fix whitespace
2024-06-10 14:15:49 -07:00
Noah Gilson 30beed1ede
2.0.6 branding (#1829) 2024-06-10 10:29:32 -07:00
Noah Gilson 90a71c754d
Don't rely on english output for registry lookups (#1830)
* Don't rely on english output for registry lookups

This will fail with another display language.

* Update reg test to account for 2 command execution calls

* Account for executing multiple commands with status output on the mock object

* Remove whitespace xd

* Scan command args for potential matches to mock commands

* Fix registry lookup test logic

* Make sure the return status is not null for mock objects
2024-06-07 09:49:14 -07:00
Noah Gilson c75c9ce4ad
Track which Extensions Own Which Installs (#1748)
* WIP - Migrate Install Key strings to type to allow future flexibility with installs -- e.g. non-versioned install folder names so we can auto update. Start collecting more information during install about who installed it so we can ref count them for uninstalls. Does not migrate telemetry events or other code yet which needs to be experimented on further

* WIP - Migrate all code to use InstallKey Type & Fix Bugs

There are several big things here that might seem like small code changes.

1 - Before when we found a 'partial install' we would delete ALL local runtimes. I am astounded this exists. There are other extensions that might depend on those other runtimes and this just deletes it from underneath them. A partial install is rare, I think you need to pkill vscode or something since the install script runs out of proc. We consider an install partial if our code never got to mark it as installed after calling the install script. Its rare but does happen, at 2010 occurences out of 470k in recent days.

Renames a function which appears to handle partial installs to clarify it only manages local ones.

Gets rid of some unused functions or moves them to a better place.

Renames IInstallKey to DotnetInstall. The install key is the string representing the directory of the install. It shouldn't have two meanings.

Add logic for ref counting which extensoins own which installs.

* wip - record extension owner for installs

Fix record keeping to properly ref count extensions
Rename types to match standard better

Still need to figure out how to manage uninstalling and 'graveyard' as well as how to remove a 'legacy' install via version when it is a dotnetinstall object.

* Separate out 'graveyard' code or management of old installs to another class

* Dont pull files from dist - bad copilot, bad

* Update some more of the code to use new types

* update mock objects to get the build working

* respond to linter

* Add back in the old telemetry prooperties

I got rid of them because they are duplicated data. But TBH there are a lot of things that rely on the pre-existing property names. It would be much harder to query new and old data together if getting rid of them, so I added them back even though it causes some data duplication.

* Fix bugs with install management

* add missing semicolon lol

* Fix a bug with clearing out the installed list

The logic was missing a !.

* Fix Install Graveyard Logic

* Fix test logic for legacy installs

* Skip unnecessary preinstall local sdk check on global sdk

* Add back code to account for preinstall in sdk status check

* Remove unnecessary string checks

We never give a string to this class anymore so it's not needed

* Add event for when tracking installs messes up somehow

* Refactor classes out to many more files

* Respond to linter

* Isolate install tracking management to a separate class

* Clean up acquisition worker and remove unnecessary logic

* Port the worker to using an external install manager to isolate protected data

* Respond to linter concerns

* Remove potential deadlock with installation management

* Increase timeouts

With the change where you need to hold a lock to edit extension state to protect against timing challenges where an install is being added or deleted at the same time and can cause incorrect behavior, we had to slow down the product.

* Migrate to a singleton for install tracker so no dupliacte lock is created

* Working build for changing 'isRuntime' to mode for 'aspnet' 'sdk' or 'runtime'

* undo the singleton in test as the context needs to be per test

* remove the singleton pattern as it will result in a bug with multiple acquisition requests having a stale context

* Add Tests for Install Tracking with who owns what install

* improve timeout on test

* Revert "improve timeout on test"

This reverts commit a4168f6ec5.

* fix timeout

* Fix Test

* Fix Logic for adding pre existing installs

* Fix tests to be successful

* Code Cleanup & Remove Potential Tech Debt for Modes

remove places where we make assumptions on the existing model (sdk or runtime) to prevent future tech debt

* respond to linter

* Fix bug with context being in a different mode than a legacy installation

Mark old function as deprecated and add a comment explaining why our assumption there works

Fix possible bugs with context management where context could be a different mode than what was previously installed which could cause future bugs down the line that would be hard to track down

* Add back in removed events to prevent breaking old telemetry dashboards

* Final Code Review from Me

* Fix Test

* Remove circular dependency from test artifact

* add missing file header from refactor

* fix test

* delete directory per mode file as there is a git bug where changes in file caps is not being picked up

* Add back into directory file with proper capitilzation per git bug

* Add missing await which might cause test to fail inconsistently

* Make the lock based timeout based on the user setting for timeouts
2024-06-05 00:07:38 +00:00
Noah Gilson 22b76ecfe3
Enable SBOM Generation 📜 (#1816)
* try adding sbom generation

* Fix SBOM Generation

* Fix comment for old pipeline name

* improve whitespace
2024-06-04 23:56:01 +00:00
Noah Gilson 5d3ab464f5
Enable Policheck 🌎 per Compliance to Scan for Offensive Terms (#1811)
* Enable Policheck

* Remove the old pipeline

We probably should have done this post 1ES Migration

* azdo is being buggy and not letting me move from 1 to another
so undo this and do it in another pr
Revert "Remove the old pipeline"

This reverts commit 3c4cc97fa0.

* azdo is buggy no more
Revert "azdo is being buggy and not letting me move from 1 to another"

This reverts commit 012133fd34.
2024-05-28 09:38:53 -07:00
Noah Gilson 6946df5bd5
Update Axios Cache Interceptor Bundle for Runtime Error Change (#1810)
* Update axios cache interceptor for bug fix

* Force update axios as well

* Migrate from vsce to @vscode/vsce

This is required for using newer versions of vsce.

* Update Node to 18 from 16 as VSCE now requires 18

* Extend log test timeout since it seems to sometimes take longer

* Make the assert not a question
2024-05-23 22:21:58 +00:00
Chet Husk 64acdca3bc
Update distro schema file to account for changes in the file. (#1801)
* Update distro schema file to account for changes in the file.

Break out the shared types into reusable definitions to make it easier to reflect reality.

* fix offset on required properties
2024-05-23 10:30:42 -07:00
Noah Gilson 14ab7565f0
2.0.5 Branding (#1782)
* 2.0.5 Branding

* Update CHANGELOG.md
2024-05-07 17:55:37 +00:00
JL03-Yue 607809bf9b
Add global shared file path for extension (#1726)
* add logic for adding a global shared path to extension

* add tests for global path config

* update comment out code

* update mock comment

* remove commented out code in ExtensionConfigurationWorker

* update ExistingPathResolver

* add tests for global shared path

* remove empty line

* resolve duplicate import

* fix tslint

* resolve format comments

* get rid of set global path to avoid type error

* add logic for checking local paths first in ExistingPathResolver

* create set global path method

* fix test

* Fix Typo

* change the field name for global shared path; add sharedExistingDotnetPath to package.json; change get and set method for shared path for ExtensionConfigurationWorker

* fix typo

* update readme for global shared path

* Add more examples to the path for .NET

* Consolidate read.me section to one page

* Simplify Logic for Failure to set Manual Path

I thought about the direction this should go, and I think that the old logic only makes sense because we'd need to concat the existing settings. In this case we are setting the global setting, so we can just add it without having to do any additional logic.

* Consolidate setting global and local to one function for simplicity

* update sample page to use the string instead of path obj

* Refactor path setting functions to two separate ones

We need to access the configuration with the direct objects the users can use the settings json file, hence this could not be simplified to a shared object.

* update class member names to disambiguate overloaded terms

* Check whether a matching extension id extension exists before calling the global path

* Make read.me more clear

* Update read.me to show that the example is only an example

* .some may not exist in certain versions so dont use it?

* Dont activate the runtime extension under test

* dont rely on test env variable since we cant set one within vscode launch profile

* Fix ability to run extension tests under launch json

We activate the extension in the test to inject custom objects to track 'telemetry' under test and analyze the telemetry events to ensure things are going well.

We cant activate the extension twice.
In the recent past we made a change to auto activate as a necessity to check the operating system before exposing APIs to users that were not available on their OS.

When I made that change I think we actually broke the ability to run the runtime extension tests under the launch profile. This fixes that.

* Remove global setting from test

This setting impacts the return path of all tests when correctly implemented. We dont want to dupe the extension test configuration for a single test to run it with a different configuration either, so we cant test it this way.

* Add tests that dont rely on the extension

* fix typo

* improve warning messages to correctly diagnose what went wrong

* remark that you need to restart vscode for the setting to take effect

* return empty properties array instead of undefined so properties are forwarded via telemetry observer

---------

Co-authored-by: Noah Gilson <noahgilson@microsoft.com>
Co-authored-by: Noah Gilson <nagilson@umich.edu>
2024-05-07 16:17:04 +00:00
Noah Gilson d5d957c4ff
Update the changelog to include details about 2.0.4 (#1781)
* Update the changelog to include details about this version

* add the release date

* Use \ to get a new line

* Use \ to get a new line for better readability

* Use \ to get a new line for better readability
2024-04-30 22:25:44 +00:00
Noah Gilson ce6fcc47f7
Improve the error message for failing to install the .NET SDK. (#1770)
* Improve the error message for failing to install the .NET SDK.

* Use https in the url.
2024-04-24 15:59:37 -07:00
Noah Gilson 63803e87c5
Always collect install script stdout and stderr. (#1769)
Per our discussion at https://github.com/dotnet/vscode-dotnet-runtime/issues/1741#issuecomment-2051238090, it would be useful to have stdout even if we dont error, because the error condition is only if:

When running the install script:
The process could not be spawned.
The process could not be killed.
Sending a message to the child process failed.
The child process was aborted via the signal option.
2024-04-24 15:47:10 -07:00
Noah Gilson cc510402c2
Protect against no versions of .NET to recommend (#1768)
* Update Dependencies

* Remove is online

Is-online now requires ES6.
It has not been maintained in over 2 years.
The checks it does are fairly rudimentary. We only rely on this code to try to diagnose the error which has already happened.
I would trust this code rather than rely on external libraries.

* Fix timeout logic for no is online

* Fix Linting Issues

* Protect against no versions of .NET to recommend

The API contract is to return an IDotnetVersion which is an array of versions. If there are no packages of .NET available to install, we should have a specific message for that and return an empty array instead of what we do right now, which is

a - returning a bad version
b - returning undefined
c - erroring out

* respond to linter to accept any error type
2024-04-24 14:51:41 -07:00
Noah Gilson 2895d85bc2
Fix Sample Extension to expect the correct API type after breaking change (#1764) 2024-04-19 21:32:14 +00:00
Noah Gilson dc058c717e
Update Is Online Lookup (#1758)
* Update Dependencies

* Remove is online

Is-online now requires ES6.
It has not been maintained in over 2 years.
The checks it does are fairly rudimentary. We only rely on this code to try to diagnose the error which has already happened.
I would trust this code rather than rely on external libraries.

* Fix timeout logic for no is online

* Fix Linting Issues
2024-04-18 11:04:38 -07:00
Noah Gilson f60f952a25
collect stack trace on axios error to diagnose better (#1745) 2024-04-11 13:59:09 -07:00
Noah Gilson f6648e7302
Enable global SDK feature by default (#1727) 2024-04-08 15:29:09 -07:00
Noah Gilson a6f79e7c3b
2.0.4 branding (#1728) 2024-04-08 21:52:08 +00:00
Noah Gilson 41f75bd5e4
rename output channel to install tool and focus on it when installing sdk so people see progress (#1730) 2024-04-01 11:32:48 -07:00
JL03-Yue 606893d9dd
Merge pull request #1714 from nagilson/nagilson-recommended-version-ex
Make Recommended Version API Return Version instead of String
2024-03-25 10:37:28 -07:00
Noah Gilson ee219cc26a
Remark on the fact that the return type is [] 2024-03-21 15:42:00 -07:00
Noah Gilson 65593e68dd
Fix Spacing 2024-03-21 15:41:07 -07:00
Noah Gilson 446f932cb9 Update to version 2 0 3 2024-03-21 15:37:40 -07:00
Noah Gilson 0ac87cd715 Merge branch 'nagilson-recommended-version-ex' of https://github.com/nagilson/vscode-dotnet-runtime into nagilson-recommended-version-ex 2024-03-20 16:15:30 -07:00
Noah Gilson 49746e28d8 fix test 2024-03-20 16:15:22 -07:00
Noah Gilson f603f5039a
Merge branch 'main' into nagilson-recommended-version-ex 2024-03-20 15:31:52 -07:00
Noah Gilson 56220a0cac Make Recommended Version API Return Version instead of String
This will make calling the API simpler for external users. Breaking change, but we have not documented this and its relatively new, so should be OK.
2024-03-20 15:30:31 -07:00
Noah Gilson 856fe78ce1
Use official templates so we get counted on the internal pie chart (#1713)
The migration tool and doc examples all use the unofficial one ecks dee

Also create a dupe of the PR pipeline so we can migrate main to that file once it is checked in and then delete the other one to rename it to a more descriptive name.
2024-03-19 15:32:11 -07:00
Noah Gilson 3501803d33 Use official templates so we get counted on the internal pie chart
The migration tool and doc examples all use the unofficial one ecks dee

Also create a dupe of the PR pipeline so we can migrate main to that file once it is checked in and then delete the other one to rename it to a more descriptive name.
2024-03-19 14:38:17 -07:00
Noah Gilson 0289a6d048
Migrate to 1ES Pipeline (#1679)
* Migrate pipeline to 1es

* Clean up changes made from migration tool

* Separate pipeline out into many yaml files so we can have 2 pipelines without code duplication
due to new internal requirement

* remove unncessary pipeline backup

* Remove pipeline from 1es for public as it is not going to be added to the organization in public

* Update yaml loop logic
Remove devcontainer as it is out of compliance and not used by anyone

* fix mappping by adding body to the loop with indentation:

* add a 1es repository

* Create a separate 1es pipeline

* use self to search in the correct repository

* migrate to self on 1es

* use folder name pipeline-templates over templates

* use yaml over yml

* temporarily move jobs into one os

* split pools

* Move the loop to out of the job

* move the task into steps instead of a job as u cant do a job in a job

* remove template keyword

* dont call steps template in job outside of steps

* use yaml instead of yml

* add sdl

* use unique names for jobs

* use _ instead of space

* Use azure pipelines name to conform to style

* give image to each parameter

* make it 1 os for 1 os job and use different pool

* Call pool explicyk

* try to fix names

* Use different source for mac instead of 1es

* Update get-func-name

* Update public PR pipeline

* use public pool as thats what the name param is for

* give image name instead of vmimage as it snot used

* try to switch to a better pool

* try using internal pool on public as external is not available

* Publish logs to os specific folder

* condition steps so they are skipped if not needed per os

* dont care if it succeeded

* add paran

* remove paran

* use parameter pools instead of agent os

* move to 7.0 instead of 6 bc six is broken in the cache online maybe

* switch to 1es pool

* try using public  pool

* See if mac pipeline has a mirror in svc

* use image names from open

* Use vm image in the image

* Use vm image in the image

* update vm image

* try to condition the pool

* code cleanup now that everything was working

* fix whitespace

* Update vscode-test

* Update vscode-test to the new name

* respond to most pr feedback

* rename the file as I cannot change the pipeline name while its in main maybe
2024-03-14 15:09:21 -07:00
Noah Gilson f08b1858c4
Merge pull request #1676 from nagilson/nagilson-resolver-added-bug
Treat Version Errors as Install Cancellations + Other minor logging improvements
2024-02-29 11:20:47 -08:00
Noah Gilson 7805325c01 Change Bad Versions Into Cancellations Instead of Error
When users enter manual versions we will see a lot more bad version strings which currently are reported as a failure for us to acquire. We dont want to pollute the telemetry with bad data for failure analysis.

When doing this change, I also improved logging for powershell and noticed some cancellation errors are still counted as failure due to some bugs like throwing a new error instead of bumping up the error, and some places throw the event and others throw the error inside of the event, We need to update the code to do both, although it is probably better to migrate all code to one system, that is a big change I dont want to do right now
2024-02-22 11:55:57 -08:00
Noah Gilson 1f0f2cf4fc Add logging for wsl detection 2024-02-21 15:11:30 -08:00
Noah Gilson b4e5ea63af Make version parsing always work for extended runtime versions 2024-02-21 14:38:54 -08:00
Noah Gilson 720f316370
Merge pull request #1668 from JL03-Yue/origin/jl03-version-split
Fix Version Parsing & Test Activation
2024-02-21 13:53:08 -08:00
Noah Gilson 72c5f863a7
Parenthesize the order of operations for and logic to represent correct behavior 2024-02-21 13:41:21 -08:00
annie 329671857e Change options to include red hat 2024-02-20 13:49:18 -08:00
annie 6d6d601863 Merge branch 'origin/jl03-version-split' of https://github.com/JL03-Yue/vscode-dotnet-runtime into origin/jl03-version-split 2024-02-20 13:16:19 -08:00
annie 3629d4e968 Add more option to include red hat 2024-02-20 13:15:45 -08:00
Noah Gilson b58dd5b8ed access env var in a safer way 2024-02-20 10:53:38 -08:00
Noah Gilson e4a0f6d365 Set test environment variable to prevent double activation
When we add activation on startup finished we encountered a new bug with the test process that has existed for many years
it will activate twice and the extension will be in a bad state. we need to allow manual activation to inject the correct mock classes into the extension and prevent it from activating on startupfinished under test.
2024-02-20 10:52:22 -08:00
Noah Gilson 12e06d3e81 Only activate the extension on start up to prevent re-registering the commands already registered from another copy of the extension 2024-02-14 10:15:07 -08:00
annie c1d4de1f30 change to original state 2024-02-13 21:22:00 -08:00
annie d8974edfe0 Merge branch 'origin/jl03-version-split' of https://github.com/JL03-Yue/vscode-dotnet-runtime into origin/jl03-version-split 2024-02-13 21:11:40 -08:00
annie 6ab592e66d add version split option for test 2024-02-13 21:10:54 -08:00
JL03-Yue e15e8d0d7b
Merge branch 'main' into origin/jl03-version-split 2024-02-13 16:45:31 -08:00
annie 751a219a0e change version split for test 2024-02-13 16:42:35 -08:00
Noah Gilson 35b93581b7
Merge pull request #1660 from nagilson/nagilson-Fix-stdout-err
Fix Bug where Password Prompt Failure to Launch could be considered Success
2024-02-12 10:17:00 -08:00
Noah Gilson af331bec50 Merge branch 'nagilson-Fix-stdout-err' of https://github.com/nagilson/vscode-dotnet-runtime into nagilson-Fix-stdout-err 2024-02-06 14:31:50 -08:00