Skip to content

fix(jetbrains): scope HTTP version fetch to selected IDEs only#822

Merged
DevelopmentCats merged 2 commits intomainfrom
matifali/fix-jetbrains-http-fetch-scope
Apr 1, 2026
Merged

fix(jetbrains): scope HTTP version fetch to selected IDEs only#822
DevelopmentCats merged 2 commits intomainfrom
matifali/fix-jetbrains-http-fetch-scope

Conversation

@matifali
Copy link
Copy Markdown
Member

@matifali matifali commented Apr 1, 2026

Problem

The data "http" "jetbrains_ide_versions" resource fetches release info from data.services.jetbrains.com for all configured IDE options at plan time, regardless of what the user actually selected. When the API is unreachable (air-gapped environments, DNS failures, transient outages), this causes a fatal Terraform error that blocks the workspace build — even when no JetBrains IDEs were selected.

Fix

Changed the for_each on the HTTP data source (and all dependent locals) from iterating over var.options/var.default to local.selected_ides — the user's actual selection.

Scenario Before After
No IDEs selected ([]) 9 HTTP requests 0 HTTP requests
1 IDE selected (["GO"]) 9 HTTP requests 1 HTTP request
All IDEs selected 9 HTTP requests 9 HTTP requests

Validation

  • All 17 existing terraform test cases pass
  • Tested end-to-end on dev.coder.com with Docker template:
    • jetbrains_ides=[] — zero HTTP requests, build succeeds
    • jetbrains_ides=["GO"] — single HTTP request for GoLand only, coder_app.jetbrains["GO"] created

Closes #821

🤖 This PR was created with the help of Coder Agents, and needs a human review. 🧑💻

The data "http" "jetbrains_ide_versions" resource previously iterated
over all IDE options (or all defaults) at plan time, regardless of the
user's actual selection. When the JetBrains API was unreachable (e.g.
air-gapped environments, DNS failures), this caused a fatal Terraform
error — even when no JetBrains IDEs were selected.

Changed the for_each on the HTTP data source (and all dependent locals)
to use local.selected_ides instead of the full var.options/var.default
set. Now:

- When no IDEs are selected (default []), zero HTTP requests are made
- When N IDEs are selected, only N requests are made (not 9)
- Reduces unnecessary latency on every workspace build

Closes #821
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Scopes JetBrains release lookups to only the IDEs a user actually selects, avoiding unnecessary (and sometimes fatal) HTTP requests during Terraform plan in environments where data.services.jetbrains.com is unreachable.

Changes:

  • Update data "http" "jetbrains_ide_versions" for_each to iterate over local.selected_ides instead of all configured options/defaults.
  • Refactor dependent locals (parsed_responses, filtered_releases, selected_releases, options_metadata) to also iterate over local.selected_ides.
  • Move/introduce the selected_ides computation earlier in the locals block to drive the new iteration strategy.

Comment thread registry/coder/modules/jetbrains/main.tf
Comment thread registry/coder/modules/jetbrains/main.tf
@matifali matifali added the version:patch Add to PRs requiring a patch version upgrade label Apr 1, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 1, 2026

Version Bump Required

One or more modules in this PR need their versions updated.

To fix this:

  1. Run the version bump script locally:
    ./.github/scripts/version-bump.sh patch
  2. Commit the changes:
    git add . && git commit -m "chore: bump module versions (patch)"
  3. Push your changes

The CI will automatically re-run once you push the updated versions.

@DevelopmentCats DevelopmentCats merged commit fc66478 into main Apr 1, 2026
4 checks passed
@DevelopmentCats DevelopmentCats deleted the matifali/fix-jetbrains-http-fetch-scope branch April 1, 2026 15:33
DevelopmentCats pushed a commit that referenced this pull request Apr 1, 2026
…r (1.4.0) (#823)

PR #822 bumped the jetbrains module version from `1.3.0` to `1.4.0`
(minor), but the change was a bugfix and should have been a patch bump.

This corrects all 7 version references in the README from `1.4.0` to
`1.3.1`.

Co-authored-by: blink-so[bot] <211532188+blink-so[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

version:patch Add to PRs requiring a patch version upgrade

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: data "http" "jetbrains_ide_versions" failure can be fatal even when no JetBrains IDE is selected

4 participants