Skip to content

Commit 1a36efd

Browse files
committed
Merge branch 'sourcegraph-amp-module' of github.com:Harsh9485/registry into sourcegraph-amp-module
2 parents 88613b6 + ea70ea7 commit 1a36efd

File tree

34 files changed

+1494
-135
lines changed

34 files changed

+1494
-135
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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ on:
1414
paths:
1515
- ".github/workflows/deploy-registry.yaml"
1616
- "registry/**/templates/**"
17+
- "registry/**/README.md"
1718
- ".icons/**"
1819

1920
jobs:
@@ -34,7 +35,7 @@ jobs:
3435
workload_identity_provider: projects/309789351055/locations/global/workloadIdentityPools/github-actions/providers/github
3536
service_account: [email protected]
3637
- name: Set up Google Cloud SDK
37-
uses: google-github-actions/setup-gcloud@6a7c903a70c8625ed6700fa299f5ddb4ca6022e9
38+
uses: google-github-actions/setup-gcloud@cb1e50a9932213ecece00a606661ae9ca44f3397
3839
- name: Deploy to dev.registry.coder.com
3940
run: gcloud builds triggers run 29818181-126d-4f8a-a937-f228b27d3d34 --branch main
4041
- name: Deploy to registry.coder.com

CONTRIBUTING.md

Lines changed: 18 additions & 13 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
@@ -89,7 +89,7 @@ Create `registry/[your-username]/README.md`:
8989
---
9090
display_name: "Your Name"
9191
bio: "Brief description of who you are and what you do"
92-
avatar_url: "./.images/avatar.png"
92+
avatar: "./.images/avatar.png"
9393
github: "your-username"
9494
linkedin: "https://www.linkedin.com/in/your-username" # Optional
9595
website: "https://yourwebsite.com" # Optional
@@ -102,7 +102,7 @@ status: "community"
102102
Brief description of who you are and what you do.
103103
```
104104

105-
> **Note**: The `avatar_url` must point to `./.images/avatar.png` or `./.images/avatar.svg`.
105+
> **Note**: The `avatar` must point to `./.images/avatar.png` or `./.images/avatar.svg`.
106106
107107
### 2. Generate Module Files
108108

@@ -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: 3 additions & 3 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

@@ -127,7 +127,7 @@ tags: ["tag1", "tag2"]
127127
```yaml
128128
display_name: "Your Name"
129129
bio: "Brief description of who you are and what you do"
130-
avatar_url: "./.images/avatar.png"
130+
avatar: "./.images/avatar.png"
131131
github: "username"
132132
linkedin: "https://www.linkedin.com/in/username" # Optional
133133
website: "https://yourwebsite.com" # Optional
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/anomaly/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
display_name: "Jay Kumar"
33
bio: "I'm a Software Engineer :)"
4-
avatar_url: "./.images/avatar.png"
4+
avatar: "./.images/avatar.jpeg"
55
github: "35C4n0r"
66
linkedin: "https://www.linkedin.com/in/jaykum4r"
77
support_email: "[email protected]"

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

registry/coder/modules/agentapi/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The AgentAPI module is a building block for modules that need to run an AgentAPI
1616
```tf
1717
module "agentapi" {
1818
source = "registry.coder.com/coder/agentapi/coder"
19-
version = "1.1.0"
19+
version = "1.1.1"
2020
2121
agent_id = var.agent_id
2222
web_app_slug = local.app_slug

0 commit comments

Comments
 (0)