Skip to content

Commit 6ab463d

Browse files
Merge branch 'coder:main' into fix/kubernetes-devcontainer-awswrkshop
2 parents 918fc6c + 898219b commit 6ab463d

File tree

64 files changed

+3441
-135
lines changed

Some content is hidden

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

64 files changed

+3441
-135
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
Closes #
2-
31
## Description
42

53
<!-- Briefly describe what this PR does and why -->
64

75
## Type of Change
86

97
- [ ] New module
8+
- [ ] New template
109
- [ ] Bug fix
1110
- [ ] Feature/enhancement
1211
- [ ] Documentation
@@ -20,10 +19,16 @@ Closes #
2019
**New version:** `v1.0.0`
2120
**Breaking change:** [ ] Yes [ ] No
2221

22+
## Template Information
23+
24+
<!-- Delete this section if not applicable -->
25+
26+
**Path:** `registry/[namespace]/templates/[template-name]`
27+
2328
## Testing & Validation
2429

2530
- [ ] Tests pass (`bun test`)
26-
- [ ] Code formatted (`bun run fmt`)
31+
- [ ] Code formatted (`bun fmt`)
2732
- [ ] Changes tested locally
2833

2934
## Related Issues

.github/workflows/ci.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ jobs:
2828
run: bun install
2929
- name: Run TypeScript tests
3030
run: bun test
31+
- name: Run Terraform tests
32+
run: ./scripts/terraform_test_all.sh
3133
- name: Run Terraform Validate
3234
run: bun terraform-validate
3335
validate-style:
@@ -48,7 +50,7 @@ jobs:
4850
- name: Validate formatting
4951
run: bun fmt:ci
5052
- name: Check for typos
51-
uses: crate-ci/typos@v1.36.2
53+
uses: crate-ci/typos@v1.37.2
5254
with:
5355
config: .github/typos.toml
5456
validate-readme-files:

.icons/auto-dev-server.svg

Lines changed: 4 additions & 0 deletions
Loading

.icons/nexus-repository.svg

Lines changed: 5 additions & 0 deletions
Loading

.icons/rustdesk.svg

Lines changed: 5 additions & 0 deletions
Loading

CONTRIBUTING.md

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -124,18 +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 at least one `.tftest.hcl`** to test your module with `terraform test`
127+
3. **Create tests for your module:**
128+
- **Terraform tests**: Create a `*.tftest.hcl` file and test with `terraform test`
129+
- **TypeScript tests**: Create `main.test.ts` file if your module runs scripts or has business logic that Terraform tests can't cover
128130
4. **Add any scripts** or additional files your module needs
129131

130132
### 4. Test and Submit
131133

132134
```bash
133-
# Test your module (from the module directory)
135+
# Test your module
136+
cd registry/[namespace]/modules/[module-name]
137+
138+
# Required: Test Terraform functionality
134139
terraform init -upgrade
135140
terraform test -verbose
136141

137-
# Or run all tests in the repo
138-
./scripts/terraform_test_all.sh
142+
# Optional: Test TypeScript files if you have main.test.ts
143+
bun test main.test.ts
139144

140145
# Format code
141146
bun run fmt
@@ -343,8 +348,8 @@ coder templates push test-[template-name] -d .
343348
terraform init -upgrade
344349
terraform test -verbose
345350

346-
# Test all modules
347-
./scripts/terraform_test_all.sh
351+
# Optional: If you have TypeScript tests
352+
bun test main.test.ts
348353
```
349354

350355
### 3. Maintain Backward Compatibility
@@ -393,7 +398,9 @@ Example: `https://github.com/coder/registry/compare/main...your-branch?template=
393398
### Every Module Must Have
394399

395400
- `main.tf` - Terraform code
396-
- One or more `.tftest.hcl` files - Working tests with `terraform test`
401+
- **Tests**:
402+
- `*.tftest.hcl` files with `terraform test` (to test terraform specific logic)
403+
- `main.test.ts` file with `bun test` (to test business logic, i.e., `coder_script` to install a package.)
397404
- `README.md` - Documentation with frontmatter
398405

399406
### Every Template Must Have
@@ -493,6 +500,10 @@ When reporting bugs, include:
493500
2. **No tests** or broken tests
494501
3. **Hardcoded values** instead of variables
495502
4. **Breaking changes** without defaults
496-
5. **Not running** formatting (`bun run fmt`) and tests (`terraform test`) before submitting
503+
5. **Not running** formatting (`bun run fmt`) and tests (`terraform test`, and `bun test main.test.ts` if applicable) before submitting
504+
505+
## For Maintainers
506+
507+
Guidelines for reviewing PRs, managing releases, and maintaining the registry. [See the maintainer guide for detailed information.](./MAINTAINER.md)
497508

498509
Happy contributing! 🚀

MAINTAINER.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Check that PRs have:
2323
- [ ] Working tests (`terraform test`)
2424
- [ ] Formatted code (`bun run fmt`)
2525
- [ ] Avatar image for new namespaces (`avatar.png` or `avatar.svg` in `.images/`)
26+
- [ ] Version label: `version:patch`, `version:minor`, or `version:major`
2627

2728
### Version Guidelines
2829

@@ -32,7 +33,8 @@ When reviewing PRs, ensure the version change follows semantic versioning:
3233
- **Minor** (1.2.3 → 1.3.0): New features, adding inputs
3334
- **Major** (1.2.3 → 2.0.0): Breaking changes (removing inputs, changing types)
3435

35-
PRs should clearly indicate the version change (e.g., `v1.2.3 → v1.2.4`).
36+
PRs should clearly indicate the intended version change (e.g., `v1.2.3 → v1.2.4`) and include the appropriate label: `version:patch`, `version:minor`, or `version:major`.
37+
The “Version Bump” CI uses this label to validate required updates (README version refs, etc.).
3638

3739
### Validate READMEs
3840

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,7 @@ Simply include that snippet inside your Coder template, defining any data depend
4848
## Contributing
4949

5050
We are always accepting new contributions. [Please see our contributing guide for more information.](./CONTRIBUTING.md)
51+
52+
## For Maintainers
53+
54+
Guidelines for maintainers reviewing PRs and managing releases. [See the maintainer guide for more information.](./MAINTAINER.md)

examples/modules/MODULE_NAME.tftest.hcl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ run "app_url_uses_port" {
1515
}
1616

1717
assert {
18-
condition = resource.coder_app.MODULE_NAME.url == "http://localhost:19999"
19-
error_message = "Expected MODULE_NAME app URL to include configured port"
18+
condition = resource.coder_app.module_name.url == "http://localhost:19999"
19+
error_message = "Expected module-name app URL to include configured port"
2020
}
2121
}

examples/modules/main.tf

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ variable "agent_id" {
3535

3636
variable "log_path" {
3737
type = string
38-
description = "The path to log MODULE_NAME to."
39-
default = "/tmp/MODULE_NAME.log"
38+
description = "The path to the module log file."
39+
default = "/tmp/module_name.log"
4040
}
4141

4242
variable "port" {
4343
type = number
44-
description = "The port to run MODULE_NAME on."
44+
description = "The port to run the application on."
4545
default = 19999
4646
}
4747

@@ -59,9 +59,9 @@ variable "order" {
5959
# Add other variables here
6060

6161

62-
resource "coder_script" "MODULE_NAME" {
62+
resource "coder_script" "module_name" {
6363
agent_id = var.agent_id
64-
display_name = "MODULE_NAME"
64+
display_name = "Module Name"
6565
icon = local.icon_url
6666
script = templatefile("${path.module}/run.sh", {
6767
LOG_PATH : var.log_path,
@@ -70,10 +70,10 @@ resource "coder_script" "MODULE_NAME" {
7070
run_on_stop = false
7171
}
7272

73-
resource "coder_app" "MODULE_NAME" {
73+
resource "coder_app" "module_name" {
7474
agent_id = var.agent_id
75-
slug = "MODULE_NAME"
76-
display_name = "MODULE_NAME"
75+
slug = "module-name"
76+
display_name = "Module Name"
7777
url = "http://localhost:${var.port}"
7878
icon = local.icon_url
7979
subdomain = false
@@ -88,10 +88,10 @@ resource "coder_app" "MODULE_NAME" {
8888
}
8989
}
9090

91-
data "coder_parameter" "MODULE_NAME" {
92-
type = "list(string)"
93-
name = "MODULE_NAME"
94-
display_name = "MODULE_NAME"
91+
data "coder_parameter" "module_name" {
92+
type = "string"
93+
name = "module_name"
94+
display_name = "Module Name"
9595
icon = local.icon_url
9696
mutable = var.mutable
9797
default = local.options["Option 1"]["value"]

0 commit comments

Comments
 (0)