-
Notifications
You must be signed in to change notification settings - Fork 4
impl: support for latest_eap, latest_release and latest_installed placeholders
#237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This is the IDE model from the https://data.services.jetbrains.com/products? feed. Only `release` and `eap` IDEs will be supported for now. This commit is in preparation for supporting placeholders like `last_release` or `last_eap` in the URI handler. Unfortunately Toolbox does not expose a way to determine if a build like 251.2829.367 is an eap build or an actual release, so we have to look up the metadata in the feed mentioned earlier.
This commit implements an IDE feed manager that depending on whether Toolbox runs in offline mode or not loads the eap and release information from two local json files or from the https://data.services.jetbrains.com/products. The feed manager is also able to intersect a list of available build versions (the IDE versions available for install on a workspace) with the list of versions fetched from the feed and return the latest version available for install. The intersection happens only after the feed was filtered by product code release type. Support for offline mode is WIP. The commit assumes that in offline mode Toolbox exposes a certain system property.
To be used later for resolving the placeholders.
…d` placeholders This PR adds support for the IDE placeholders in the URI build number parameter. This is a request coming from Netflix, the placeholders provide an easier way to fill in the build number from the web dashboard without having to know the available versions of IDE from Toolbox. IDE launch flow is refactored to support dynamic build selectors, and it also improves the install/launch logic. When latest_eap or latest_release is used: - prefer the newest matching version that is available for install - install it only if it isn’t already installed - fall back to the latest available version if no match exists - show an error if none of the above happens When latest_installed is used: - launch the newest installed version - if none are installed, install and launch the latest available version - show an error if none of the above happens
code-asher
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very nice 👌
|
|
||
| val basePath = when (os) { | ||
| OS.MAC -> Path.of(userHome, "Library", "Application Support") | ||
| OS.LINUX -> Path.of(userHome, ".local", "share") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For Linux we should first try XDG_DATA_HOME if set.
I think we have some overlap with getting the Coder data dir in the settings store, I wonder if we can share some code here.
Actually, I wonder if XDG_CACHE_HOME (defaults to ~/.cache) may be more appropriate, based on the function name. On macOS I think the equivalent is ~/Library/Caches?
| } | ||
|
|
||
| @Test | ||
| fun `given a workspace with multiple agents when getMatchingAgent is called with a valid agent name then it correctly resolves resolves an agent`() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why were the getMatchingAgent tests removed?
This PR adds support for the IDE placeholders in the URI build number parameter. This is a request
coming from Netflix, the placeholders provide an easier way to fill in the build number from the
web dashboard without having to know the available versions of IDE from Toolbox.
IDE launch flow is refactored to support dynamic build selectors, and it also improves the
install/launch logic. When latest_eap or latest_release is used:
When latest_installed is used:
When simply matching a build number:
Besides the above behavior an IDE feed manager was added which depending on whether Toolbox
runs in offline mode or not - it loads the eap and release information from two local json files or from the https://data.services.jetbrains.com/products.
The feed manager is also able to intersect a list of available build versions (the IDE versions available for install
on a workspace) with the list of versions fetched from the feed and return the latest version available for install.
The intersection happens only after the feed was filtered by product code release type. All this is needed because we don't have a way in Toolbox to determine if a build number in the form
242.1234.567is a release or an eap build. Which is whywe need to rely on data from https://data.services.jetbrains.com/products
Support for offline mode is WIP. The commit assumes that in offline mode Toolbox exposes a certain system property.