Skip to content

feat(saheli): add jetbrains-plugins module for issue #208 … #225

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Sahelisaha04
Copy link

Description

Enhanced the JetBrains module to support pre-installing plugins in workspaces. When users specify plugin IDs, the module creates configuration files that automatically suggest plugin installation when connecting via JetBrains Gateway. This eliminates the need for manual plugin installation after workspace setup.

Type of Change

  • New module
  • Bug fix
  • Feature/enhancement
  • Documentation
  • Other

Module Information

  • Path: registry/coder/modules/jetbrains
  • New version: v1.0.1
  • Breaking change: [ ] Yes [x] No

Changes Made

1. Added Plugin Configuration Variable

$ grep -A 4 "variable \"plugins\"" main.tf
variable "plugins" {
  type        = list(string)
  description = "A list of plugin IDs to pre-install in the JetBrains IDEs. Plugin IDs can be found on the JetBrains Marketplace."
  default     = []
}

2. Created Plugin Configuration Script

$ ls -la scripts/
total 12
drwxrwxr-x 2 user user 4096 Jan 12 10:30 .
drwxrwxr-x 3 user user 4096 Jan 12 10:29 ..
-rw-rw-r-- 1 user user 4985 Jan 12 10:30 install-plugins.sh

3. Added Conditional Script Resource

$ grep -A 8 "coder_script.*jetbrains_plugins" main.tf
resource "coder_script" "jetbrains_plugins" {
  count              = length(var.plugins) > 0 ? 1 : 0
  agent_id           = var.agent_id
  display_name       = "Configure JetBrains Plugins"
  icon               = "/icon/jetbrains-toolbox.svg"
  run_on_start       = true
  start_blocks_login = false
  timeout            = 120
}

Testing & Validation

Terraform Validation

$ terraform init
Initializing the backend...
Initializing provider plugins...
- Installing coder/coder v2.8.0...
- Installing hashicorp/http v3.5.0...
Terraform has been successfully initialized!

$ terraform validate
Success! The configuration is valid.

Test Plan with Plugins

$ terraform plan -var='agent_id=demo-agent' -var='folder=/workspace' -var='default=["IU","PY"]' -var='plugins=["org.jetbrains.plugins.github","com.intellij.ml.llm"]'

Terraform will perform the following actions:

  # coder_app.jetbrains["IU"] will be created
  + resource "coder_app" "jetbrains" {
      + display_name = "IntelliJ IDEA"
      + slug         = "jetbrains-iu"
      + url          = "jetbrains://gateway/coder?&workspace=default&owner=default&folder=/workspace&url=https://mydeployment.coder.com&token=$SESSION_TOKEN&ide_product_code=IU&ide_build_number=251.26927.53"
    }

  # coder_app.jetbrains["PY"] will be created
  + resource "coder_app" "jetbrains" {
      + display_name = "PyCharm"
      + slug         = "jetbrains-py"
    }

  # coder_script.jetbrains_plugins[0] will be created
  + resource "coder_script" "jetbrains_plugins" {
      + display_name = "Configure JetBrains Plugins"
      + run_on_start = true
      + script       = <<-EOT
            PLUGINS=(org.jetbrains.plugins.github com.intellij.ml.llm)
            SELECTED_IDES=(IU PY)
            echo "🚀 JetBrains Plugin Configuration Setup"
            echo "Configuring 2 plugin(s) for auto-installation..."
        EOT
    }

Plan: 3 to add, 0 to change, 0 to destroy.

Script Syntax Check

$ bash -n scripts/install-plugins.sh
# No output = syntax is valid

Format Check

$ terraform fmt -check
# No output = formatting is correct
Screencast.from.2025-07-12.12-21-52.mp4

Checklist

  • Tests pass (terraform validate)
  • Code formatted (terraform fmt)
  • Changes tested locally
  • Documentation updated (README.md)
  • Backwards compatible (no breaking changes)
  • Script follows module conventions (scripts/ folder)

Example Usage

module "jetbrains" {
  source   = "registry.coder.com/coder/jetbrains/coder"
  version  = "1.0.1"
  agent_id = coder_agent.main.id
  folder   = "/workspace"
  default  = ["IU", "PY"]
  
  # Pre-configure plugins for auto-installation
  plugins = [
    "org.jetbrains.plugins.github",    # GitHub integration
    "com.intellij.ml.llm",             # AI Assistant
    "Pythonid",                        # Python support
    "org.intellij.plugins.markdown"    # Markdown support
  ]
}

Related Issues

Closes #208 - Pre-install JetBrains plugins in Workspaces
/claim #208

│                                                                                                                                                                      │
│   - Wraps official coder/jetbrains module with plugin pre-configuration                                                                                              │
│   - Adds plugins variable to accept list of JetBrains plugin IDs                                                                                                     │
│   - Creates IDE configuration files for automatic plugin suggestions                                                                                                 │
│   - Works with JetBrains Gateway workflow for seamless plugin installation                                                                                           │
│   - Follows namespace guidelines by creating module under saheli namespace                                                                                           │
│                                                                                                                                                                      │
│   Closes coder#208
@matifali
Copy link
Member

Please contribute this functionality to the already published jetbrains module linked in the issue.

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

Successfully merging this pull request may close these issues.

Pre-install JetBrains plugins in Workspaces
2 participants