* 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
* 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
* 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
* 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.
* 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
* 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
* 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>
* 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
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.
* 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
* 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
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.
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.
* 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
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
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.