Skip to content

problems with validation for jetbrains gateway module folder #61

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
Forestsoft-de opened this issue May 11, 2024 · 2 comments
Open

problems with validation for jetbrains gateway module folder #61

Forestsoft-de opened this issue May 11, 2024 · 2 comments
Labels
good first issue Good for newcomers

Comments

@Forestsoft-de
Copy link

The error message is:

Error: Invalid value for variable
on main.tf line 248, in module "jetbrains_gateway":
  248:   folder         = "/home/coder/${local.folder_name}"
    ├────────────────
    │ var.folder is "/home/coder/foo/"
The folder must be a full path and must not start with a ~.
This was checked by the validation rule at .terraform/modules/jetbrains_gateway/main.tf:29,3-13.

The hcl is

locals {
    base_name = try(element(split("/", data.coder_parameter.git_repo.value), length(split("/", data.coder_parameter.git_repo.value)) - 1), "project/")
    #folder_name = try(local.base_name, "project/")
    folder_name = "foo/"

}
}
module "jetbrains_gateway" {
  source         = "registry.coder.com/modules/jetbrains-gateway/coder"
  version        = "1.0.13"
  agent_id       = coder_agent.main.id
  agent_name     =  "main"
  folder         = "/home/coder/${local.folder_name}"
  jetbrains_ides = ["PS", "GO", "IU", "PY", "WS"]
  default        = "PS"
}

i guessed there is a problem with the evaluation of folder_name and so i tried to set on the foldername directly.

BR
Sebastian

@matifali matifali transferred this issue from coder/coder May 12, 2024
@matifali
Copy link
Member

@Forestsoft-de the current regex at
https://github.com/coder/modules/blob/dcd605c52efedbb09ac718968e2eeb11f8a1d80a/jetbrains-gateway/main.tf#L30
Does not accept a trailing /. That's why it's failing for you. We should allow accepting / as the last character for the folder

@michaelbrewer
Copy link

I am running into the same issue when it comes cases where you only no the folder name of the project (like after doing the initial git clone) and you want to open it in Jetbrians later one.

@matifali matifali added the good first issue Good for newcomers label May 30, 2024
@Parkreiner Parkreiner transferred this issue from coder/modules May 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants