From 7f51b2ffdd634d9fa2c3bc8b36bf131995e49712 Mon Sep 17 00:00:00 2001 From: Matt Wise Date: Wed, 9 Jul 2025 07:56:08 -0700 Subject: [PATCH] feat(dotfiles): add custom variable for the dotfiles parameter description (#151) ## Description When passing in custom dotfiles URIs, the format for those (`git@...` vs `https://...`) are going to be different for different environments, and admins are going to want to give their developers particular instructions. This PR makes the parameter `description` customizable so that we can change the default description a developer sees. --- ## Type of Change - [ ] New module - [ ] Bug fix - [x] Feature/enhancement - [ ] Documentation - [ ] Other --- ## Module Information **Path:** `registry/coder/modules/dotfiles` **New version:** `v1.2.0` **Breaking change:** [ ] Yes [X] No --- ## Testing & Validation - [X] Tests pass (`bun test`) - [X] Code formatted (`bun run fmt`) - [x] Changes tested locally --------- Co-authored-by: DevCats --- registry/coder/modules/dotfiles/README.md | 12 ++++++------ registry/coder/modules/dotfiles/main.tf | 8 +++++++- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/registry/coder/modules/dotfiles/README.md b/registry/coder/modules/dotfiles/README.md index bae98b96..0f55d0a8 100644 --- a/registry/coder/modules/dotfiles/README.md +++ b/registry/coder/modules/dotfiles/README.md @@ -19,7 +19,7 @@ Under the hood, this module uses the [coder dotfiles](https://coder.com/docs/v2/ module "dotfiles" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder/dotfiles/coder" - version = "1.1.0" + version = "1.2.0" agent_id = coder_agent.example.id } ``` @@ -32,7 +32,7 @@ module "dotfiles" { module "dotfiles" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder/dotfiles/coder" - version = "1.1.0" + version = "1.2.0" agent_id = coder_agent.example.id } ``` @@ -43,7 +43,7 @@ module "dotfiles" { module "dotfiles" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder/dotfiles/coder" - version = "1.1.0" + version = "1.2.0" agent_id = coder_agent.example.id user = "root" } @@ -55,14 +55,14 @@ module "dotfiles" { module "dotfiles" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder/dotfiles/coder" - version = "1.1.0" + version = "1.2.0" agent_id = coder_agent.example.id } module "dotfiles-root" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder/dotfiles/coder" - version = "1.1.0" + version = "1.2.0" agent_id = coder_agent.example.id user = "root" dotfiles_uri = module.dotfiles.dotfiles_uri @@ -77,7 +77,7 @@ You can set a default dotfiles repository for all users by setting the `default_ module "dotfiles" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder/dotfiles/coder" - version = "1.1.0" + version = "1.2.0" agent_id = coder_agent.example.id default_dotfiles_uri = "https://github.com/coder/dotfiles" } diff --git a/registry/coder/modules/dotfiles/main.tf b/registry/coder/modules/dotfiles/main.tf index b96b1e66..9dfb7240 100644 --- a/registry/coder/modules/dotfiles/main.tf +++ b/registry/coder/modules/dotfiles/main.tf @@ -26,6 +26,12 @@ variable "agent_id" { description = "The ID of a Coder agent." } +variable "description" { + type = string + description = "A custom description for the dotfiles parameter. This is shown in the UI - and allows you to customize the instructions you give to your users." + default = "Enter a URL for a [dotfiles repository](https://dotfiles.github.io) to personalize your workspace" +} + variable "default_dotfiles_uri" { type = string description = "The default dotfiles URI if the workspace user does not provide one" @@ -64,7 +70,7 @@ data "coder_parameter" "dotfiles_uri" { display_name = "Dotfiles URL" order = var.coder_parameter_order default = var.default_dotfiles_uri - description = "Enter a URL for a [dotfiles repository](https://dotfiles.github.io) to personalize your workspace" + description = var.description mutable = true icon = "/icon/dotfiles.svg" }