Some errors can be thrown in contexts without a version to acquire such as the install linux dependencies command. Using ! is an anti pattern and removes type safety. We just need to make sure the install key is included everywhere we error from the acquisition context, which I do believe is the case, otherwise this fix will not work in those edge cases
The other thing to note here is how I added the version being set in the mock acquisition worker... the version is set by the extension in extension.ts but this does not happen in unit tests so we needed to add that logic now that everyone needs an acquisition context to be happy
remove extra sdk feature band check thats already done in the linux distro code
make the context optional in places where it may not actually exist, e.g. if vs code telemetry setting is changed before we call an acquire command, there would be no acquire context
- First moving the mock object import in index.ts resolved the dependency loading order problem where classes were being imported out of order
- Then, removing the getInstallKey function out of the worker prevented loading the vscode module which will always cause a failure in the library tests
- Also cleans up imports and adds whitespace
Some problems remain post refactor which I will fix next
Do this to deduplicate event stream, timeout time, extension state, proxy url, arch, and install key so we can throw errors from other places
uses a hack for the telemetry observer because it needs to be created before the acquisition context can be created
'vscode' cannot be referenced outside of code that's directly part of an extension. So wrapper classes are necessary to access the vscode ui api, or the environment, or the extension context environment. If referencing a file that references these types the build will pass but tests will fail to execute.
The utility context is where things like this will go in the future. Some of these objects must be created before the acquisition context can be ready and it is best to have some 'global' state for utilities. File Utilities could probably go there in the future as well.
It is an ugly hack but the best option. Note the runtime extension test is timing out, which I am investigating.
The process environment is for the extension host, which is separate from the vscode terminal environment. That needs to be edited as well, which we now do here.
- the shell option is needed for spawn to access windows shell commands, exec does this by default but exec does not capture detailed output streams
- fix a timeout where ms was used as seconds
- note that you need to restart for telemetry notice to change
Move global code to axios. Expect JSON objects from the web worker
Fix typos
Fix package json and yarn lock files that got messy in the merge (we delibereately merged with conflicts.)
Forward proxy into web workers created by global code (should verify that everyone is using the proxy, could be done cleaner)
mock objects use the newer interfaces
Co-authored-by: Annie Li <59816815+JL03-Yue@users.noreply.github.com>
Improve whitespace from file licensing.
Co-authored-by: Annie Li <59816815+JL03-Yue@users.noreply.github.com>
Improve whitespace from file licensing.
Co-authored-by: Annie Li <59816815+JL03-Yue@users.noreply.github.com>
Improve whitespace from file licensing.
Co-authored-by: Annie Li <59816815+JL03-Yue@users.noreply.github.com>
Improve whitespace from file licensing.
Co-authored-by: Annie Li <59816815+JL03-Yue@users.noreply.github.com>
Improve whitespace from file licensing.
Co-authored-by: Annie Li <59816815+JL03-Yue@users.noreply.github.com>
Improve whitespace from file licensing.
Co-authored-by: Annie Li <59816815+JL03-Yue@users.noreply.github.com>
Improve whitespace from file licensing.
Co-authored-by: Annie Li <59816815+JL03-Yue@users.noreply.github.com>
Improve whitespace from file licensing.
Co-authored-by: Annie Li <59816815+JL03-Yue@users.noreply.github.com>
Improve whitespace from file licensing.
Co-authored-by: Annie Li <59816815+JL03-Yue@users.noreply.github.com>
Improve whitespace from file licensing.
Co-authored-by: Annie Li <59816815+JL03-Yue@users.noreply.github.com>
Improve whitespace from file licensing.
Co-authored-by: Annie Li <59816815+JL03-Yue@users.noreply.github.com>
Fixes SDK tests
Improves event variable names to match what they are actually getting
A few events still use version. This may be a bit annoying with the telemetry, because the beginning events are before architecture is determined, so they use a different version key vs the install key. I worry this may make it harder to drive failure insights. We could change this. but I left it because this is technically an existing problem -- the version used in these events is the unresolved version, so it will not be the fully specified version used in later events.
I moved the removal of legacy installs down incase someone is offline, then we keep their legacy install if the new install failed to reduce breakage chance
the e2e test to show sdk and runtime versions did not remove each other did not work as the sdk commands are not registered in the other extension
we could eventually fix this
the versions will be different as the fully specified version is given in production, which is how they should not overlap
Add to the local SDK tests that fail if you have a global SDK a warning so they dont fail when building on a devbox
Merge in the version resolver changes to expect a json object from WRWorker
Merge all of the package upgrades together