From 959f4bfc956847cf98dcbf1c5556b18a65da9da4 Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Mon, 19 May 2025 19:30:27 +0000 Subject: [PATCH] feat: add `group` attribute to `coder_app` resource --- docs/resources/app.md | 1 + provider/app.go | 6 ++++++ provider/app_test.go | 3 ++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/resources/app.md b/docs/resources/app.md index b3ac728f..338b1837 100644 --- a/docs/resources/app.md +++ b/docs/resources/app.md @@ -63,6 +63,7 @@ resource "coder_app" "vim" { - `command` (String) A command to run in a terminal opening this app. In the web, this will open in a new tab. In the CLI, this will SSH and execute the command. Either `command` or `url` may be specified, but not both. - `display_name` (String) A display name to identify the app. Defaults to the slug. - `external` (Boolean) Specifies whether `url` is opened on the client machine instead of proxied through the workspace. +- `group` (String) The name of a group that this app belongs to. - `healthcheck` (Block Set, Max: 1) HTTP health checking to determine the application readiness. (see [below for nested schema](#nestedblock--healthcheck)) - `hidden` (Boolean) Determines if the app is visible in the UI (minimum Coder version: v2.16). - `icon` (String) A URL to an icon that will display in the dashboard. View built-in icons here: https://github.com/coder/coder/tree/main/site/static/icon. Use a built-in icon with `"${data.coder_workspace.me.access_url}/icon/"`. diff --git a/provider/app.go b/provider/app.go index 2d0d6b09..213372b4 100644 --- a/provider/app.go +++ b/provider/app.go @@ -223,6 +223,12 @@ func appResource() *schema.Resource { }, }, }, + "group": { + Type: schema.TypeString, + Description: "The name of a group that this app belongs to.", + ForceNew: true, + Optional: true, + }, "order": { Type: schema.TypeInt, Description: "The order determines the position of app in the UI presentation. The lowest order is shown first and apps with equal order are sorted by name (ascending order).", diff --git a/provider/app_test.go b/provider/app_test.go index 444b6b0d..aeb42d08 100644 --- a/provider/app_test.go +++ b/provider/app_test.go @@ -40,6 +40,7 @@ func TestApp(t *testing.T) { interval = 5 threshold = 6 } + group = "Apps" order = 4 hidden = false open_in = "slim-window" @@ -63,6 +64,7 @@ func TestApp(t *testing.T) { "healthcheck.0.url", "healthcheck.0.interval", "healthcheck.0.threshold", + "group", "order", "hidden", "open_in", @@ -476,5 +478,4 @@ func TestApp(t *testing.T) { }) } }) - }