dynatrace-extensions / dynatrace-extensions-vscode

A VisualStudio Code extension to support all aspects of developing Dynatrace Extensions 2.0
Apache License 2.0
16 stars 6 forks source link

Do not block adding a Dynatrace environment if URL does match the expected format #150

Closed juliusloman closed 9 months ago

juliusloman commented 9 months ago

Summary Sometimes managed environments APIs and UI can be accessed using non-standard ports or context. This blocks adding such environments to the VScode. I assume the vscode extension accesses just the environment APIs, thus it should be possible to use Cluster ActiveGate for that. Currently, such environments cannot be added if the port does not match the standard https port.

Current vs. Expected Behavior Please provide a warning, but do not block adding such an environment.

radu-stefan-dt commented 9 months ago

Hi @juliusloman

We have a set of regexes that test the input the user provides so that we can guide them. Without validation we had complaints that Environment URL is not clear enough as to what it refers.

Regarding why we have standard URLs that are targetting the environment (rather than an ActiveGate) it's because we also have features that load up URLs in your browser based on the environment URL. Features like opening the Extension configuration page or pages of Unified Analysis screens.

I'll have a think about how we can marry everything up and offer both guidance as well as allowing non-standard configurations at the cost of losing ability to open web pages.

In the meantime, can you share an example of your setup or pattern that you're using?

juliusloman commented 9 months ago

Sure, we have customers where we have limited VPN access and we can run just a browser for example. But Cluster ActiveGate can be reached in such environments remotely, however, it's not using a standard HTTPS port, but 9999 (or another one) instead. Sure opening the UI will not work with such setups, but we should be able to use the vscode extension easily.

I'm wondering - could this be added manually by editing a config? It should probably cover our cases.

radu-stefan-dt commented 9 months ago

If you want to hack your way through it for now, it is possible :D

VSCode provides a global storage where we maintain the list of registered environments.

On Windows this is at:

C:\Users\<your.user>\AppData\Roaming\Code\User\globalStorage\dynatraceplatformextensions.dynatrace-extensions\dynatraceEnvironments.json

If you're on a different O/S you'll have to find out the equivalent.

Either way, in this file you can modify the URL manually, then reload your editor. Nothing else should re-validate the URL once it's been written to this file.

juliusloman commented 9 months ago

Oh, excellent. It required a little game with the token, but luckily, the extension is open source :+1:
It works this way and it's perfectly fine for our purpose.