Skip to content

Commit 266c445

Browse files
committed
Merge remote-tracking branch 'origin/main' into ssncferreira/feat-prebuilds-cache-invalidation
2 parents 30771cf + 60fd03d commit 266c445

File tree

70 files changed

+803
-634
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+803
-634
lines changed

.github/dependabot.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,21 @@ updates:
104104
update-types:
105105
- version-update:semver-major
106106
open-pull-requests-limit: 15
107+
108+
- package-ecosystem: "terraform"
109+
directories:
110+
- "dogfood/*/"
111+
- "examples/templates/*/"
112+
schedule:
113+
interval: "weekly"
114+
commit-message:
115+
prefix: "chore"
116+
groups:
117+
coder:
118+
patterns:
119+
- "registry.coder.com/coder/*/coder"
120+
labels: []
121+
ignore:
122+
- dependency-name: "*"
123+
update-types:
124+
- version-update:semver-major

.github/workflows/ci.yaml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
docs-only: ${{ steps.filter.outputs.docs_count == steps.filter.outputs.all_count }}
2525
docs: ${{ steps.filter.outputs.docs }}
2626
go: ${{ steps.filter.outputs.go }}
27-
ts: ${{ steps.filter.outputs.ts }}
27+
site: ${{ steps.filter.outputs.site }}
2828
k8s: ${{ steps.filter.outputs.k8s }}
2929
ci: ${{ steps.filter.outputs.ci }}
3030
db: ${{ steps.filter.outputs.db }}
@@ -92,9 +92,8 @@ jobs:
9292
gomod:
9393
- "go.mod"
9494
- "go.sum"
95-
ts:
95+
site:
9696
- "site/**"
97-
- "Makefile"
9897
k8s:
9998
- "helm/**"
10099
- "scripts/Dockerfile"
@@ -774,7 +773,7 @@ jobs:
774773
test-js:
775774
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
776775
needs: changes
777-
if: needs.changes.outputs.ts == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
776+
if: needs.changes.outputs.site == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
778777
timeout-minutes: 20
779778
steps:
780779
- name: Harden Runner
@@ -805,7 +804,7 @@ jobs:
805804
#- premium: true
806805
# name: test-e2e-premium
807806
# Skip test-e2e on forks as they don't have access to CI secrets
808-
if: (needs.changes.outputs.go == 'true' || needs.changes.outputs.ts == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main') && !(github.event.pull_request.head.repo.fork)
807+
if: (needs.changes.outputs.go == 'true' || needs.changes.outputs.site == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main') && !(github.event.pull_request.head.repo.fork)
809808
timeout-minutes: 20
810809
name: ${{ matrix.variant.name }}
811810
steps:
@@ -874,11 +873,13 @@ jobs:
874873
path: ./site/test-results/**/debug-pprof-*.txt
875874
retention-days: 7
876875

876+
# Reference guide:
877+
# https://www.chromatic.com/docs/turbosnap-best-practices/#run-with-caution-when-using-the-pull_request-event
877878
chromatic:
878879
# REMARK: this is only used to build storybook and deploy it to Chromatic.
879880
runs-on: ubuntu-latest
880881
needs: changes
881-
if: needs.changes.outputs.ts == 'true' || needs.changes.outputs.ci == 'true'
882+
if: needs.changes.outputs.site == 'true' || needs.changes.outputs.ci == 'true'
882883
steps:
883884
- name: Harden Runner
884885
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
@@ -888,9 +889,10 @@ jobs:
888889
- name: Checkout
889890
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
890891
with:
891-
# Required by Chromatic for build-over-build history, otherwise we
892-
# only get 1 commit on shallow checkout.
892+
# 👇 Ensures Chromatic can read your full git history
893893
fetch-depth: 0
894+
# 👇 Tells the checkout which commit hash to reference
895+
ref: ${{ github.event.pull_request.head.ref }}
894896

895897
- name: Setup Node
896898
uses: ./.github/actions/setup-node
@@ -900,7 +902,7 @@ jobs:
900902
# the check to pass. This is desired in PRs, but not in mainline.
901903
- name: Publish to Chromatic (non-mainline)
902904
if: github.ref != 'refs/heads/main' && github.repository_owner == 'coder'
903-
uses: chromaui/action@30b6228aa809059d46219e0f556752e8672a7e26 # v11.11.0
905+
uses: chromaui/action@d7afd50124cf4f337bcd943e7f45cfa85a5e4476 # v12.0.0
904906
env:
905907
NODE_OPTIONS: "--max_old_space_size=4096"
906908
STORYBOOK: true
@@ -915,6 +917,7 @@ jobs:
915917
projectToken: 695c25b6cb65
916918
workingDir: "./site"
917919
storybookBaseDir: "./site"
920+
storybookConfigDir: "./site/.storybook"
918921
# Prevent excessive build runs on minor version changes
919922
skip: "@(renovate/**|dependabot/**)"
920923
# Run TurboSnap to trace file dependencies to related stories
@@ -931,7 +934,7 @@ jobs:
931934
# infinitely "in progress" in mainline unless we re-review each build.
932935
- name: Publish to Chromatic (mainline)
933936
if: github.ref == 'refs/heads/main' && github.repository_owner == 'coder'
934-
uses: chromaui/action@30b6228aa809059d46219e0f556752e8672a7e26 # v11.11.0
937+
uses: chromaui/action@d7afd50124cf4f337bcd943e7f45cfa85a5e4476 # v12.0.0
935938
env:
936939
NODE_OPTIONS: "--max_old_space_size=4096"
937940
STORYBOOK: true
@@ -944,6 +947,7 @@ jobs:
944947
projectToken: 695c25b6cb65
945948
workingDir: "./site"
946949
storybookBaseDir: "./site"
950+
storybookConfigDir: "./site/.storybook"
947951
# Run TurboSnap to trace file dependencies to related stories
948952
# and tell chromatic to only take snapshots of relevant stories
949953
onlyChanged: true

.github/workflows/docs-ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- name: Setup Node
2929
uses: ./.github/actions/setup-node
3030

31-
- uses: tj-actions/changed-files@480f49412651059a414a6a5c96887abb1877de8a # v45.0.7
31+
- uses: tj-actions/changed-files@3981e4f74104e7a4c67a835e1e5dd5d9eb0f0a57 # v45.0.7
3232
id: changed-files
3333
with:
3434
files: |

cli/testdata/coder_list_--output_json.golden

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
"workspace_name": "test-workspace",
2525
"workspace_owner_id": "==========[first user ID]===========",
2626
"workspace_owner_name": "testuser",
27-
"workspace_owner_avatar_url": "",
2827
"template_version_id": "============[version ID]============",
2928
"template_version_name": "===========[version name]===========",
3029
"build_number": 1,

cli/testdata/coder_users_list_--output_json.golden

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
{
33
"id": "==========[first user ID]===========",
44
"username": "testuser",
5-
"avatar_url": "",
65
"name": "Test User",
76
"email": "testuser@coder.com",
87
"created_at": "====[timestamp]=====",
@@ -23,8 +22,6 @@
2322
{
2423
"id": "==========[second user ID]==========",
2524
"username": "testuser2",
26-
"avatar_url": "",
27-
"name": "",
2825
"email": "testuser2@coder.com",
2926
"created_at": "====[timestamp]=====",
3027
"updated_at": "====[timestamp]=====",

codersdk/organizations.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ type OrganizationMember struct {
7474

7575
type OrganizationMemberWithUserData struct {
7676
Username string `table:"username,default_sort" json:"username"`
77-
Name string `table:"name" json:"name"`
78-
AvatarURL string `json:"avatar_url"`
77+
Name string `table:"name" json:"name,omitempty"`
78+
AvatarURL string `json:"avatar_url,omitempty"`
7979
Email string `json:"email"`
8080
GlobalRoles []SlimRole `json:"global_roles"`
8181
OrganizationMember `table:"m,recursive_inline"`

codersdk/users.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ type UsersRequest struct {
4040
type MinimalUser struct {
4141
ID uuid.UUID `json:"id" validate:"required" table:"id" format:"uuid"`
4242
Username string `json:"username" validate:"required" table:"username,default_sort"`
43-
AvatarURL string `json:"avatar_url" format:"uri"`
43+
AvatarURL string `json:"avatar_url,omitempty" format:"uri"`
4444
}
4545

4646
// ReducedUser omits role and organization information. Roles are deduced from
@@ -49,11 +49,11 @@ type MinimalUser struct {
4949
// required by the frontend.
5050
type ReducedUser struct {
5151
MinimalUser `table:"m,recursive_inline"`
52-
Name string `json:"name"`
52+
Name string `json:"name,omitempty"`
5353
Email string `json:"email" validate:"required" table:"email" format:"email"`
5454
CreatedAt time.Time `json:"created_at" validate:"required" table:"created at" format:"date-time"`
5555
UpdatedAt time.Time `json:"updated_at" table:"updated at" format:"date-time"`
56-
LastSeenAt time.Time `json:"last_seen_at" format:"date-time"`
56+
LastSeenAt time.Time `json:"last_seen_at,omitempty" format:"date-time"`
5757

5858
Status UserStatus `json:"status" table:"status" enums:"active,suspended"`
5959
LoginType LoginType `json:"login_type"`

codersdk/workspacebuilds.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ type WorkspaceBuild struct {
5858
WorkspaceName string `json:"workspace_name"`
5959
WorkspaceOwnerID uuid.UUID `json:"workspace_owner_id" format:"uuid"`
6060
WorkspaceOwnerName string `json:"workspace_owner_name"`
61-
WorkspaceOwnerAvatarURL string `json:"workspace_owner_avatar_url"`
61+
WorkspaceOwnerAvatarURL string `json:"workspace_owner_avatar_url,omitempty"`
6262
TemplateVersionID uuid.UUID `json:"template_version_id" format:"uuid"`
6363
TemplateVersionName string `json:"template_version_name"`
6464
BuildNumber int32 `json:"build_number"`

docs/admin/templates/extending-templates/parameters.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,6 @@ The "Options" column in the table below indicates whether the form type requires
480480
| `input` | `string`, `number` | No | Standard single-line text input field. Default for string/number parameters without options. |
481481
| `key-value` | `string` | No | For entering key-value pairs (as JSON). |
482482
| `multi-select` | `list(string)` | Yes | Select multiple items from a list with checkboxes. |
483-
| `password` | `string` | No | Masked input field for sensitive information. |
484483
| `radio` | `string`, `number`, `bool`, `list(string)` | Yes | Radio buttons for selecting a single option with all choices visible at once. |
485484
| `slider` | `number` | No | Slider selection with min/max validation for numeric values. |
486485
| `switch` | `bool` | No | Toggle switch alternative for boolean parameters. |

dogfood/coder-envbuilder/main.tf

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ terraform {
55
}
66
docker = {
77
source = "kreuzwerker/docker"
8-
version = "~> 3.0.0"
8+
version = "~> 3.0"
99
}
1010
envbuilder = {
1111
source = "coder/envbuilder"
@@ -109,35 +109,35 @@ data "coder_workspace" "me" {}
109109
data "coder_workspace_owner" "me" {}
110110

111111
module "slackme" {
112-
source = "registry.coder.com/modules/slackme/coder"
112+
source = "registry.coder.com/coder/slackme/coder"
113113
version = "1.0.2"
114114
agent_id = coder_agent.dev.id
115115
auth_provider_id = "slack"
116116
}
117117

118118
module "dotfiles" {
119-
source = "registry.coder.com/modules/dotfiles/coder"
120-
version = "1.0.15"
119+
source = "registry.coder.com/coder/dotfiles/coder"
120+
version = "1.0.29"
121121
agent_id = coder_agent.dev.id
122122
}
123123

124124
module "personalize" {
125-
source = "registry.coder.com/modules/personalize/coder"
125+
source = "registry.coder.com/coder/personalize/coder"
126126
version = "1.0.2"
127127
agent_id = coder_agent.dev.id
128128
}
129129

130130
module "code-server" {
131-
source = "registry.coder.com/modules/code-server/coder"
132-
version = "1.0.15"
131+
source = "registry.coder.com/coder/code-server/coder"
132+
version = "1.2.0"
133133
agent_id = coder_agent.dev.id
134134
folder = local.repo_dir
135135
auto_install_extensions = true
136136
}
137137

138138
module "jetbrains_gateway" {
139-
source = "registry.coder.com/modules/jetbrains-gateway/coder"
140-
version = "1.0.13"
139+
source = "registry.coder.com/coder/jetbrains-gateway/coder"
140+
version = "1.1.1"
141141
agent_id = coder_agent.dev.id
142142
agent_name = "dev"
143143
folder = local.repo_dir
@@ -147,13 +147,13 @@ module "jetbrains_gateway" {
147147
}
148148

149149
module "filebrowser" {
150-
source = "registry.coder.com/modules/filebrowser/coder"
151-
version = "1.0.8"
150+
source = "registry.coder.com/coder/filebrowser/coder"
151+
version = "1.0.31"
152152
agent_id = coder_agent.dev.id
153153
}
154154

155155
module "coder-login" {
156-
source = "registry.coder.com/modules/coder-login/coder"
156+
source = "registry.coder.com/coder/coder-login/coder"
157157
version = "1.0.15"
158158
agent_id = coder_agent.dev.id
159159
}

dogfood/coder/main.tf

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -217,48 +217,48 @@ data "coder_workspace_tags" "tags" {
217217

218218
module "slackme" {
219219
count = data.coder_workspace.me.start_count
220-
source = "dev.registry.coder.com/modules/slackme/coder"
221-
version = ">= 1.0.0"
220+
source = "dev.registry.coder.com/coder/slackme/coder"
221+
version = "1.0.2"
222222
agent_id = coder_agent.dev.id
223223
auth_provider_id = "slack"
224224
}
225225

226226
module "dotfiles" {
227227
count = data.coder_workspace.me.start_count
228-
source = "dev.registry.coder.com/modules/dotfiles/coder"
229-
version = ">= 1.0.0"
228+
source = "dev.registry.coder.com/coder/dotfiles/coder"
229+
version = "1.0.29"
230230
agent_id = coder_agent.dev.id
231231
}
232232

233233
module "git-clone" {
234234
count = data.coder_workspace.me.start_count
235-
source = "dev.registry.coder.com/modules/git-clone/coder"
236-
version = ">= 1.0.0"
235+
source = "dev.registry.coder.com/coder/git-clone/coder"
236+
version = "1.0.18"
237237
agent_id = coder_agent.dev.id
238238
url = "https://github.com/coder/coder"
239239
base_dir = local.repo_base_dir
240240
}
241241

242242
module "personalize" {
243243
count = data.coder_workspace.me.start_count
244-
source = "dev.registry.coder.com/modules/personalize/coder"
245-
version = ">= 1.0.0"
244+
source = "dev.registry.coder.com/coder/personalize/coder"
245+
version = "1.0.2"
246246
agent_id = coder_agent.dev.id
247247
}
248248

249249
module "code-server" {
250250
count = data.coder_workspace.me.start_count
251-
source = "dev.registry.coder.com/modules/code-server/coder"
252-
version = ">= 1.0.0"
251+
source = "dev.registry.coder.com/coder/code-server/coder"
252+
version = "1.2.0"
253253
agent_id = coder_agent.dev.id
254254
folder = local.repo_dir
255255
auto_install_extensions = true
256256
}
257257

258258
module "vscode-web" {
259259
count = data.coder_workspace.me.start_count
260-
source = "registry.coder.com/modules/vscode-web/coder"
261-
version = ">= 1.0.0"
260+
source = "dev.registry.coder.com/coder/vscode-web/coder"
261+
version = "1.1.0"
262262
agent_id = coder_agent.dev.id
263263
folder = local.repo_dir
264264
extensions = ["github.copilot"]
@@ -279,31 +279,31 @@ module "jetbrains" {
279279

280280
module "filebrowser" {
281281
count = data.coder_workspace.me.start_count
282-
source = "dev.registry.coder.com/modules/filebrowser/coder"
283-
version = ">= 1.0.0"
282+
source = "dev.registry.coder.com/coder/filebrowser/coder"
283+
version = "1.0.31"
284284
agent_id = coder_agent.dev.id
285285
agent_name = "dev"
286286
}
287287

288288
module "coder-login" {
289289
count = data.coder_workspace.me.start_count
290-
source = "dev.registry.coder.com/modules/coder-login/coder"
291-
version = ">= 1.0.0"
290+
source = "dev.registry.coder.com/coder/coder-login/coder"
291+
version = "1.0.15"
292292
agent_id = coder_agent.dev.id
293293
}
294294

295295
module "cursor" {
296296
count = data.coder_workspace.me.start_count
297-
source = "dev.registry.coder.com/modules/cursor/coder"
298-
version = ">= 1.0.0"
297+
source = "dev.registry.coder.com/coder/cursor/coder"
298+
version = "1.1.0"
299299
agent_id = coder_agent.dev.id
300300
folder = local.repo_dir
301301
}
302302

303303
module "windsurf" {
304304
count = data.coder_workspace.me.start_count
305-
source = "registry.coder.com/modules/windsurf/coder"
306-
version = ">= 1.0.0"
305+
source = "registry.coder.com/coder/windsurf/coder"
306+
version = "1.0.0"
307307
agent_id = coder_agent.dev.id
308308
folder = local.repo_dir
309309
}

examples/templates/aws-devcontainer/main.tf

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,9 +321,11 @@ resource "coder_metadata" "info" {
321321
}
322322
}
323323

324+
# See https://registry.coder.com/modules/coder/code-server
324325
module "code-server" {
325-
count = data.coder_workspace.me.start_count
326-
source = "registry.coder.com/modules/code-server/coder"
327-
version = "1.0.18"
326+
count = data.coder_workspace.me.start_count
327+
source = "registry.coder.com/coder/code-server/coder"
328+
# This ensures that the latest non-breaking version of the module gets downloaded, you can also pin the module version to prevent breaking changes in production.
329+
version = "~> 1.0"
328330
agent_id = coder_agent.dev[0].id
329331
}

0 commit comments

Comments
 (0)