feat(jetbrains): add plugin pre-installation support#718
feat(jetbrains): add plugin pre-installation support#718Rhan2020 wants to merge 3 commits intocoder:mainfrom
Conversation
Add a 'plugins' parameter to the JetBrains module that accepts a list of Marketplace plugin IDs and automatically downloads and installs them when the workspace starts. Key design decisions: - Downloads plugins directly from JetBrains Marketplace API instead of using the IDE CLI (which doesn't work while the IDE is running) - Uses build numbers already available in the module to fetch compatible plugin versions - Runs installation in background to avoid blocking workspace startup - Searches multiple plugin directory locations (Toolbox, RemoteDev, config) Closes coder#208
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 53cf1d9d88
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…onfig path - Use POSIX [[:space:]] in grep regex for productCode detection so non-minified product-info.json files are matched correctly in RemoteDev dist directories. - Derive versioned config directory (e.g. PyCharm2025.3) from the build number when synthesizing the fallback plugins path, matching the layout the IDE actually looks up.
|
Fixed both issues in the latest push:
|
|
Both P1 issues flagged by the Codex review were already addressed in commit 92dd0be:
Ready for review! |
- Replace grep-based productCode extraction with jq for proper JSON parsing, handling any whitespace/formatting in product-info.json - Validate build-number format (exactly 3 digits) before deriving the IDE version for the fallback config path, preventing bogus directory creation from unexpected build strings
|
Good idea! When I was researching and working on this issue, I found suggestions online to use the IDE CLI tool to install plugins, so I started implementing that approach, but it failed 😅. What I learned is that it’s always important to explore all possible approaches to solving the same issue. |
|
Thanks for sharing that! Yeah I actually went down the same rabbit hole initially — the IDE CLI approach seems like the obvious choice, but it turns out the CLI isn't always available in headless/remote environments (which is exactly where Coder workspaces run). The direct download + extract to the plugins dir ended up being way more reliable since it doesn't depend on the IDE process being running or the CLI being in PATH. Totally agree though, exploring multiple approaches is how you end up finding the one that actually works in all the edge cases. Appreciate the feedback 🙏 |
Summary
Adds a
pluginsparameter to the JetBrains module that accepts a list of Marketplace plugin IDs and pre-installs them when the workspace starts./claim #208
Approach
Previous PRs attempted to use the JetBrains CLI (
installPlugins) which doesn't work while the IDE is running — creating an unsolvable race condition. This PR takes a different approach:https://plugins.jetbrains.com/pluginManager?action=download&id=<pluginXmlId>&build=<productCode>-<buildNumber>nohupso workspace startup isn't blockedUsage
Changes
pluginsvariable (list(string)), plugin-related locals, andcoder_script.jetbrains_pluginsresourcepluginsparameter with usage exampleTesting
All 20 tests pass (17 existing + 3 new):
no_plugin_script_when_plugins_empty— no script created when plugins=[]plugin_script_created_when_plugins_set— script created when plugins specifiedplugin_script_with_multiple_ides— single script handles multiple IDEsRequirements
Workspace needs
curl,jq, andunzipavailable (standard on most Coder workspace images).