Skip to content

Commit 75472e4

Browse files
authored
Merge branch 'main' into feat-codex-cli
2 parents 0f23e73 + 61554aa commit 75472e4

File tree

19 files changed

+869
-129
lines changed

19 files changed

+869
-129
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
- name: Validate formatting
4949
run: bun fmt:ci
5050
- name: Check for typos
51-
uses: crate-ci/typos@v1.34.0
51+
uses: crate-ci/typos@v1.35.3
5252
with:
5353
config: .github/typos.toml
5454
validate-readme-files:

.github/workflows/deploy-registry.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
workload_identity_provider: projects/309789351055/locations/global/workloadIdentityPools/github-actions/providers/github
3636
service_account: [email protected]
3737
- name: Set up Google Cloud SDK
38-
uses: google-github-actions/setup-gcloud@6a7c903a70c8625ed6700fa299f5ddb4ca6022e9
38+
uses: google-github-actions/setup-gcloud@cb1e50a9932213ecece00a606661ae9ca44f3397
3939
- name: Deploy to dev.registry.coder.com
4040
run: gcloud builds triggers run 29818181-126d-4f8a-a937-f228b27d3d34 --branch main
4141
- name: Deploy to registry.coder.com

CONTRIBUTING.md

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ The Coder Registry is a collection of Terraform modules and templates for Coder
2424

2525
### Install Dependencies
2626

27-
Install Bun:
27+
Install Bun (for formatting and scripts):
2828

2929
```bash
3030
curl -fsSL https://bun.sh/install | bash
@@ -124,19 +124,23 @@ This script generates:
124124
- Accurate description and usage examples
125125
- Correct icon path (usually `../../../../.icons/your-icon.svg`)
126126
- Proper tags that describe your module
127-
3. **Create `main.test.ts`** to test your module
127+
3. **Create at least one `.tftest.hcl`** to test your module with `terraform test`
128128
4. **Add any scripts** or additional files your module needs
129129

130130
### 4. Test and Submit
131131

132132
```bash
133-
# Test your module
134-
bun test -t 'module-name'
133+
# Test your module (from the module directory)
134+
terraform init -upgrade
135+
terraform test -verbose
136+
137+
# Or run all tests in the repo
138+
./scripts/terraform_test_all.sh
135139

136140
# Format code
137-
bun fmt
141+
bun run fmt
138142

139-
# Commit and create PR
143+
# Commit and create PR (do not push to main directly)
140144
git add .
141145
git commit -m "Add [module-name] module"
142146
git push origin your-branch
@@ -335,11 +339,12 @@ coder templates push test-[template-name] -d .
335339
### 2. Test Your Changes
336340

337341
```bash
338-
# Test a specific module
339-
bun test -t 'module-name'
342+
# Test a specific module (from the module directory)
343+
terraform init -upgrade
344+
terraform test -verbose
340345

341346
# Test all modules
342-
bun test
347+
./scripts/terraform_test_all.sh
343348
```
344349

345350
### 3. Maintain Backward Compatibility
@@ -388,7 +393,7 @@ Example: `https://github.com/coder/registry/compare/main...your-branch?template=
388393
### Every Module Must Have
389394

390395
- `main.tf` - Terraform code
391-
- `main.test.ts` - Working tests
396+
- One or more `.tftest.hcl` files - Working tests with `terraform test`
392397
- `README.md` - Documentation with frontmatter
393398

394399
### Every Template Must Have
@@ -488,6 +493,6 @@ When reporting bugs, include:
488493
2. **No tests** or broken tests
489494
3. **Hardcoded values** instead of variables
490495
4. **Breaking changes** without defaults
491-
5. **Not running** `bun fmt` before submitting
496+
5. **Not running** formatting (`bun run fmt`) and tests (`terraform test`) before submitting
492497

493498
Happy contributing! 🚀

MAINTAINER.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ sudo apt install golang-go
1818

1919
Check that PRs have:
2020

21-
- [ ] All required files (`main.tf`, `main.test.ts`, `README.md`)
21+
- [ ] All required files (`main.tf`, `README.md`, at least one `.tftest.hcl`)
2222
- [ ] Proper frontmatter in README
23-
- [ ] Working tests (`bun test`)
23+
- [ ] Working tests (`terraform test`)
2424
- [ ] Formatted code (`bun run fmt`)
2525
- [ ] Avatar image for new namespaces (`avatar.png` or `avatar.svg` in `.images/`)
2626

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
run "plan_with_required_vars" {
2+
command = plan
3+
4+
variables {
5+
agent_id = "example-agent-id"
6+
}
7+
}
8+
9+
run "app_url_uses_port" {
10+
command = plan
11+
12+
variables {
13+
agent_id = "example-agent-id"
14+
port = 19999
15+
}
16+
17+
assert {
18+
condition = resource.coder_app.MODULE_NAME.url == "http://localhost:19999"
19+
error_message = "Expected MODULE_NAME app URL to include configured port"
20+
}
21+
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"fmt": "bun x prettier --write **/*.sh **/*.ts **/*.md *.md && terraform fmt -recursive -diff",
55
"fmt:ci": "bun x prettier --check **/*.sh **/*.ts **/*.md *.md && terraform fmt -check -recursive -diff",
66
"terraform-validate": "./scripts/terraform_validate.sh",
7-
"test": "bun test",
7+
"test": "./scripts/terraform_test_all.sh",
88
"update-version": "./update-version.sh"
99
},
1010
"devDependencies": {

registry/coder-labs/modules/gemini/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Run [Gemini CLI](https://ai.google.dev/gemini-api/docs/cli) in your workspace to
1313
```tf
1414
module "gemini" {
1515
source = "registry.coder.com/coder-labs/gemini/coder"
16-
version = "1.0.0"
16+
version = "1.0.1"
1717
agent_id = coder_agent.example.id
1818
gemini_api_key = var.gemini_api_key
1919
gemini_model = "gemini-2.5-pro"
@@ -42,7 +42,7 @@ variable "gemini_api_key" {
4242
module "gemini" {
4343
count = data.coder_workspace.me.start_count
4444
source = "registry.coder.com/coder-labs/gemini/coder"
45-
version = "1.0.0"
45+
version = "1.0.1"
4646
agent_id = coder_agent.example.id
4747
gemini_api_key = var.gemini_api_key # we recommend providing this parameter inorder to have a smoother experience (i.e. no google sign-in)
4848
gemini_model = "gemini-2.5-flash"

registry/coder-labs/modules/gemini/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ EOT
166166

167167
module "agentapi" {
168168
source = "registry.coder.com/coder/agentapi/coder"
169-
version = "1.0.0"
169+
version = "1.1.1"
170170

171171
agent_id = var.agent_id
172172
web_app_slug = local.app_slug
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
run "required_vars" {
2+
command = plan
3+
4+
variables {
5+
agent_id = "foo"
6+
}
7+
}
8+
9+
run "offline_and_use_cached_conflict" {
10+
command = plan
11+
12+
variables {
13+
agent_id = "foo"
14+
use_cached = true
15+
offline = true
16+
}
17+
18+
expect_failures = [
19+
resource.coder_script.code-server
20+
]
21+
}
22+
23+
run "offline_disallows_extensions" {
24+
command = plan
25+
26+
variables {
27+
agent_id = "foo"
28+
offline = true
29+
extensions = ["ms-python.python", "golang.go"]
30+
}
31+
32+
expect_failures = [
33+
resource.coder_script.code-server
34+
]
35+
}
36+
37+
run "url_with_folder_query" {
38+
command = plan
39+
40+
variables {
41+
agent_id = "foo"
42+
folder = "/home/coder/project"
43+
port = 13337
44+
}
45+
46+
assert {
47+
condition = resource.coder_app.code-server.url == "http://localhost:13337/?folder=%2Fhome%2Fcoder%2Fproject"
48+
error_message = "coder_app URL must include encoded folder query param"
49+
}
50+
}

registry/coder/modules/cursor/README.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Uses the [Coder Remote VS Code Extension](https://github.com/coder/vscode-coder)
1616
module "cursor" {
1717
count = data.coder_workspace.me.start_count
1818
source = "registry.coder.com/coder/cursor/coder"
19-
version = "1.2.1"
19+
version = "1.3.0"
2020
agent_id = coder_agent.example.id
2121
}
2222
```
@@ -29,8 +29,33 @@ module "cursor" {
2929
module "cursor" {
3030
count = data.coder_workspace.me.start_count
3131
source = "registry.coder.com/coder/cursor/coder"
32-
version = "1.2.1"
32+
version = "1.3.0"
3333
agent_id = coder_agent.example.id
3434
folder = "/home/coder/project"
3535
}
3636
```
37+
38+
### Configure MCP servers for Cursor
39+
40+
Provide a JSON-encoded string via the `mcp` input. When set, the module writes the value to `~/.cursor/mcp.json` using a `coder_script` on workspace start.
41+
42+
```tf
43+
module "cursor" {
44+
count = data.coder_workspace.me.start_count
45+
source = "registry.coder.com/coder/cursor/coder"
46+
version = "1.3.0"
47+
agent_id = coder_agent.example.id
48+
mcp = jsonencode({
49+
mcpServers = {
50+
coder = {
51+
command = "coder"
52+
args = ["exp", "mcp", "server"]
53+
env = {
54+
CODER_MCP_APP_STATUS_SLUG = "cursor"
55+
CODER_MCP_AI_AGENTAPI_URL = "http://localhost:3284"
56+
}
57+
}
58+
}
59+
})
60+
}
61+
```

0 commit comments

Comments
 (0)