Skip to content
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

feat(Jetbrains-Gateway): Specify IDE Version or Latest #217

Open
2 of 3 tasks
djarbz opened this issue Apr 6, 2024 · 15 comments · Fixed by #226
Open
2 of 3 tasks

feat(Jetbrains-Gateway): Specify IDE Version or Latest #217

djarbz opened this issue Apr 6, 2024 · 15 comments · Fixed by #226

Comments

@djarbz
Copy link
Contributor

djarbz commented Apr 6, 2024

I would like to request an option to use a specific or latest version of the selected IDE.

For example:

  • Case 1: We specify 2024.1 to use the 2024.1 version of the IDE.
  • Case 2: We specify latest and upon startup of the workspace the latest version of the selected IDE will be discovered and utilized. If a new version is released, we simply would need to restart the workspace to link the new version.
  • Case 3: We leave the input blank and the version hardcoded into the module is used.
@michaelbrewer
Copy link
Contributor

I am not sure if Jetbrians has a handy api to fetch the latest versions and build number.

@djarbz
Copy link
Contributor Author

djarbz commented Apr 12, 2024

I found one! Shows all (recent) versions as well as a marker for the latest!

https://data.services.jetbrains.com/help-versions?product=go

@matifali
Copy link
Member

I found one! Shows all (recent) versions as well as a marker for the latest!

data.services.jetbrains.com/help-versions?product=go

This doesn't list the build number that is needed to construct the download URL.

@djarbz
Copy link
Contributor Author

djarbz commented Apr 14, 2024

Well shoot, I'll keep looking...

@djarbz
Copy link
Contributor Author

djarbz commented Apr 14, 2024

This one looks promising!
https://data.services.jetbrains.com/products?code=GO&release.type=release

We can change the code=GO to match the selected IDE and under releases the first entry is the latest release with download links, version number, and build number, along with a bunch of other goodies!

@matifali
Copy link
Member

matifali commented Apr 14, 2024

So we should be able to get the items using
download link: .[0].releases[0].downloads.linux.link
build: .[0].releases[0].build
version: .[0].releases[0].version

and HTTP provider.

@djarbz
Copy link
Contributor Author

djarbz commented Apr 14, 2024

Looks like it, I'm wondering if we should default to the latest version and allow end users to optionally specify a specific version?

@michaelbrewer
Copy link
Contributor

Default to fetch will slow down builds and not work for air gapped environments.

@djarbz
Copy link
Contributor Author

djarbz commented Apr 15, 2024

Ok, so can we trigger the HTTP query pragmatically after the workspace owner selects and IDE and if they want the latest version? I'm not familiar enough with Terraform yet to know the inner workings of data access like that.

I also found this endpoint that will only provide the latest release, but we would need to call it for each IDE.
I think this would be a quick enough API call that we could default to latest with a fallback?
https://data.services.jetbrains.com/products/releases?code=GO&latest=true&type=release

Does this module even work in air gapped systems? Coder would need internet access to download the IDE anyways.
Unless the system has the IDE pre-installed? In which case, perhaps we should have a backend parameter to override the IDE, version, and build number?

@michaelbrewer
Copy link
Contributor

Air-gapped solutions would self-host terraform modules. But i like the idea that you can select for "latest" and it would dynamically look it up.

@michaelbrewer
Copy link
Contributor

Actually, I am not sure how air-gapped solutions would allow for JetBrains download in the first place. 😆. You would have to pre-install the idea on the running workspace.

@djarbz
Copy link
Contributor Author

djarbz commented Apr 15, 2024

Actually, I am not sure how air-gapped solutions would allow for JetBrains download in the first place. 😆. You would have to pre-install the idea on the running workspace.

That's kind of what I was getting at... But if you are on an air gapped system with a pre-installed IDE, wouldn't it be easier to manually specify the Gateway link to match the version than to match what is specified in this module?

IMHO I don't think this module is useful in an air gapped system.

@matifali
Copy link
Member

#226 addresses points 2 and 3 but needs to handle 1. I need help finding an easy way to get details of a specific version. It can be done with parsing and some regex matching. So, reopening this issue. if anyone wants to do that.

@matifali matifali reopened this Apr 17, 2024
@matifali matifali removed their assignment Apr 17, 2024
@djarbz
Copy link
Contributor Author

djarbz commented Apr 23, 2024

@matifali

I found this endpoint that will return the info for a specific release/eap version.

https://data.services.jetbrains.com/products?code=GO&type=release&majorVersion=2024.1

@matifali
Copy link
Member

Great. This would work.
I won't be able to do this in next few weeks. Feel free to submit a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants